Package net.sf.saxon.om

Examples of net.sf.saxon.om.NamespaceBinding


        matcher.addEndElement();
    }

    public boolean processStartElement(XdmNode node) throws SaxonApiException {
        NodeInfo inode = node.getUnderlyingNode();
        NamespaceBinding inscopeNS[] = inode.getDeclaredNamespaces(null);
        NamespaceBinding newNS[] = null;

        if ("attributes".equals(applyTo)) {
            matcher.addStartElement(new NameOfNode(inode), inode.getSchemaType(), inscopeNS);
        } else {
            if (inscopeNS.length > 0) {
                int countNS = 0;

                for (int pos = 0; pos < inscopeNS.length; pos++) {
                    NamespaceBinding ns = inscopeNS[pos];
                    String uri = ns.getURI();
                    if (!from.equals(uri) || !"".equals(to)) {
                        countNS++;
                    }
                }

                newNS = new NamespaceBinding[countNS];
                int newPos = 0;
                for (int pos = 0; pos < inscopeNS.length; pos++) {
                    NamespaceBinding ns = inscopeNS[pos];
                    String pfx = ns.getPrefix();
                    String uri = ns.getURI();
                    if (from.equals(uri)) {
                        if ("".equals(to)) {
                            // Nevermind, we're throwing the namespace away
                        } else {
                            NamespaceBinding newns = new NamespaceBinding(pfx,to);
                            newNS[newPos++] = newns;
                        }
                    } else {
                        newNS[newPos++] = ns;
                    }
View Full Code Here

TOP

Related Classes of net.sf.saxon.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.