Package client.net.sf.saxon.ce.om

Examples of client.net.sf.saxon.ce.om.NamespaceBinding


    public void startContent() throws XPathException {

        if (pendingUndeclarations != null) {
            for (int i=0; i<pendingUndeclarations.length; i++) {
                NamespaceBinding nscode = pendingUndeclarations[i];
                if (nscode != null) {
                    namespace(new NamespaceBinding(nscode.getPrefix(), ""), 0);
                    // relies on the namespace() method to prevent duplicate undeclarations
                }
            }
        }
        pendingUndeclarations = null;
View Full Code Here


        // that is, highest precedence first.
        for (int i = 0; i < numberOfAliases; i++) {
            Declaration decl = namespaceAliasList.get(i);
            XSLNamespaceAlias xna = (XSLNamespaceAlias)decl.getSourceElement();
            String scode = xna.getStylesheetURI();
            NamespaceBinding ncode = xna.getResultNamespaceBinding();
            int prec = decl.getPrecedence();

            // check that there isn't a conflict with another xsl:namespace-alias
            // at the same precedence

            if (currentPrecedence != prec) {
                currentPrecedence = prec;
                aliasesAtThisPrecedence.clear();
                //precedenceBoundary = i;
            }
            if (aliasesAtThisPrecedence.contains(scode)) {
                if (!namespaceAliasMap.get(scode).equals(ncode.getURI())) {
                    xna.compileError("More than one alias is defined for the same namespace", "XTSE0810");
                }
            }
            if (namespaceAliasMap.get(scode) == null) {
                namespaceAliasMap.put(scode, ncode);
                aliasResultUriSet.add(ncode.getURI());
            }
            aliasesAtThisPrecedence.add(scode);
        }
        namespaceAliasList = null// throw it in the garbage
    }
View Full Code Here

    public static void sendNamespaces(NodeInfo element, Receiver receiver) throws XPathException {
         if (element.getNodeKind() == Type.ELEMENT) {
            boolean foundDefault = false;
            for (Iterator<NamespaceBinding> iter = iterateNamespaces(element); iter.hasNext();) {
                NamespaceBinding nb = iter.next();
                if (nb.getPrefix().isEmpty()) {
                    foundDefault = true;
                }
                receiver.namespace(nb, 0);
            }
            if (!foundDefault) {
View Full Code Here

    }

    private void advance() {
        while (true) {
            boolean ascend = index >= localDeclarations.length;
            NamespaceBinding nsCode = null;
            if (!ascend) {
                nsCode = localDeclarations[index++];
                ascend = nsCode == null;
            }
            if (ascend) {
                element = element.getParent();
                if (element != null && element.getNodeKind() == Type.ELEMENT) {
                    localDeclarations = element.getDeclaredNamespaces(localDeclarations);
                    index = 0;
                    continue;
                } else {
                    next = null;
                    return;
                }
            }
            String uri = nsCode.getURI();
            String prefix = nsCode.getPrefix();
            if (uri.isEmpty()) {
                // this is an undeclaration
                undeclaredPrefixes.add(prefix);
            } else {
                if (undeclaredPrefixes.add(prefix)) {
View Full Code Here

TOP

Related Classes of client.net.sf.saxon.ce.om.NamespaceBinding

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.