tags:

views:

233

answers:

1

For example,
In this document

< ?xml version="1.0" ? >   

< SOAP-ENV:Envelope 

xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 

xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" 

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 

xmlns:xsd="http://www.w3.org/2001/XMLSchema" 

xmlns:ns1="http://opcfoundation.org/webservices/XMLDA/1.0/" 

xmlns:ns2="Service"> 

< SOAP-ENV:Body id="_0" >

if I need to select the element "Body", I need to know the prefix "SOAP-ENV". How can I get that? getting a root element and slicing the colon (:) off seems a dirty idea to me, I am sure there should be a neat way to do that. Google does not help (may be I am not searching for the right thing).

+1  A: 

If you're doing XML processing you shouldn't need to know the prefix.

To select a node in an XML document, you need not know the prefix. You need to know the namespace, not the prefix.

If you are processing a SOAP document, then you know the namespace is http://schemas.xmlsoap.org/soap/envelope/. And that's all you need. In the XML application, you can assign your own namespace prefix.

Cheeso
Thank you, Let me try it tomorrow.
Gollum