----- Original Message ----- From: "Bill Schindler" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, March 04, 2000 6:36 AM Subject: Re: getElementsByTagName vs. getElementsByTagNameNS
> "Brett McLaughlin" <[EMAIL PROTECTED]> wrote: > > NodeList nodes = root.getElementsByTagNameNS("JavaXML", "handler"); > > The DOM 2 definition for getElementsByTagNameNS is > > NodeList getElementsByTagNameNS(in DOMString namespaceURI, in DOMString > localName); > > Instead of the prefix, you should be using the namespace URI: > > NodeList nodes = > root.getElementsByTagNameNS("http://www.oreilly.com/catalog/javaxml", "handler"); OK, I chased down what was the actual problem that got me into that mistake (thanks, BTW, Bill)... For the same document: <?xml version="1.0"?> <!DOCTYPE JavaXML:xmlrpc-config SYSTEM "E:\projects\XML-Book\WEB-INF\conf\XMLRPC.dtd"> <JavaXML:xmlrpc-config xmlns:JavaXML="http://www.oreilly.com/catalog/javaxml"> <!-- Configuration Information for Server and Clients --> <JavaXML:hostname>localhost</JavaXML:hostname> <JavaXML:port type="unprotected">85</JavaXML:port> </JavaXML:xmlrpc-config> The method getNamespaceURI() on the Document Node, the root Element Node, or any other node, returns that the namespace URI is null. This is incorrect... I also tried setting the default namespace (xmlns="http://myUrl.com") and then removing the JavaXML namespace prefix from some elements. Those elements also return that the namespace URI is null, also incorrect. 1) Is there anything in using org.apache.xerces.parsers.DOMParser that has to be done to ensure namespace support? 2) Is this a bug? Thanks, Brett > > > > > --Bill >