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:38:33
From:   dvohra09
Response to: Parsing a Namespace node with JDK 5.0

Include the interface methods in the implementation class.


An implementation of NamespaceContext with a single prefix corresponding to a namespace uri.


public class NamespaceContextImpl implements NamespaceContext{


public String uri;
public String prefix;


public NamespaceContextImpl(){}


public NamespaceContextImpl(String prefix, String uri){
this.uri=uri;
this.prefix=prefix;
}


public String getNamespaceURI(String prefix){
return uri;
}
public void setNamespaceURI(String uri){
this.uri=uri;
}


public String getPrefix(String uri){
return prefix;
}


public void setPrefix(String prefix){
this.prefix=prefix;
}
public Iterator getPrefixes(String uri){return null;}


}



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

1 to 1 of 1