Package net.sf.saxon.tree

Examples of net.sf.saxon.tree.NamespaceNode


    XPathExpression xPathExpression = XPathFactory.newInstance().newXPath().compile("//namespace::*");
    List<NamespaceNode> nodeList = (ArrayList<NamespaceNode>) xPathExpression.evaluate(new StreamSource(new StringReader(xml)), XPathConstants.NODESET);
    Map<String, String> allNamespacesMap = new TreeMap<String, String>();
    if (nodeList != null) {
      for (int i = 0; i < nodeList.size(); i++) {
        NamespaceNode node = nodeList.get(i);

        if (!allNamespacesMap.containsKey(node.getLocalPart())) {
          allNamespacesMap.put(node.getLocalPart(), node.getStringValue());
        }
      }
    }

    return allNamespacesMap;
View Full Code Here

TOP

Related Classes of net.sf.saxon.tree.NamespaceNode

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.