I've got another question... regarding namespaces. If I'm parsing an XML document such as this one: <?xml version='1.0' encoding='ascii'?> <dsi:Information xmlns='http://www.w3.org/2001/XMLSchema' xmlns:dsi='http://www'> <dsi:Alarm>toto</dsi:Alarm> </dsi:Information>
How can I retrieve directly the Alarm node ? I mean, I can request ->getElementsByTagName( ... dsi:Alarm );
but the problem is that to do so, I need to know the prefix that the user has chosen in his XML document for the corresponding namespace.
If I do that, and somebody asks me to parse:
<?xml version='1.0' encoding='ascii'?>
<z:Information xmlns='http://www.w3.org/2001/XMLSchema'
xmlns:z='http://www'>
<z:Alarm>toto</z:Alarm>
</z:Information>
Of course, it won't work...
I saw the getPrefix(), getNamespaceURI() and getLocalName()methods of DOMNode, but does this mean I should parse through _all_ nodes of my XML document, and check for each node whether it's local name is Alarm, and check the namespace URI matches the one I'm expecting ?
Isn't there a shortcut ?
Thanks, Axelle.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
