ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Parsing an XML Document with XPath
Subject:   Parsing a Namespace node with JDK 5.0
Date:   2005-01-14 08:23:02
From:   dvohra09
To parse a namespace node with the JDK 5.0 javax.xml.xpath package, set the NamespaceContext on the XPath object.



XPath xpath;
NamespaceContext namepsaceContext=new NamespaceContextImpl();
xpath.setNamespaceContext(namespaceContext);


For a NamespaceContext object, create a class which implements the NamespaceContext interface.



private class NamespaceContextImpl implements NamespaceContext{


public String uri;
public String prefix;


public String getUri(){
return uri;
}
public void setUri(String uri){
this.uri=uri;
}


public String getPrefix(){
return prefix;
}


public void setPrefix(String prefix){
this.prefix=prefix;
}



}



1 to 2 of 2
  1. Parsing a Namespace node with JDK 5.0
    2005-02-17 07:55:52  Gerg [View]

    • Parsing a Namespace node with JDK 5.0
      2005-02-17 08:01:53  Deepak Vohra | [View]

      • Parsing a Namespace node with JDK 5.0
        2005-02-18 02:16:18  Gerg [View]

        • Parsing a Namespace node with JDK 5.0
          2006-02-22 09:15:26  Gerg [View]

  2. Parsing a Namespace node with JDK 5.0
    2005-01-14 08:38:33  Deepak Vohra | [View]

    • Parsing a Namespace node with JDK 5.0
      2005-01-14 08:56:42  Deepak Vohra | [View]

1 to 2 of 2