Hi Mike,

Xerces doesn't magically add new namespace declarations to documents. In
each place you mention what "Java" is doing what are you referring to? A
transformer?

Thanks.

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: [EMAIL PROTECTED]
E-mail: [EMAIL PROTECTED]

"Mike Gardiner" <[EMAIL PROTECTED]> wrote on 10/03/2007 02:44:13 PM:

>  Hello,
>
>  I'm trying to load some XML without it being modified but from what I
> see, no matter which way I load it (.setNamespaceAware = true|false)
> java is making modifications to my XML.
>
>  Eg:
>
>  If I have source XML
>
>  <root xmlns:ns="http://someURI.net";>
>  <ns:tag1>some value</ns:tag1>
>  <ns:tag2>
>  <tag3>some value for tag 3</tag3>
>  </ns:tag2>
>  </root>
>
>  And I load it using a DocumentBuilderFactory with
> .setNamespaceAware=true I get:
>
>  <root xmlns:ns="http://someURI.net";>
>  <ns:tag1>some value</ns:tag1>
>  <ns:tag2>
>  <ns5:tag3 xmlns="http://test.net"; xmlns:ns5="http://test.net";>some
> value for tag 3</ns5:tag3>
>  </ns:tag2>
>  </root>
>
>  And if I load it using .setNamespaceAware=false I get:
>
>  <root xmlns:ns="http://someURI.net";>
>  <ns:tag1 xmlns:ns="">some value</ns:tag1>
>  <ns:tag2 xmlns:ns="">
>  <tag3>some value for tag 3</tag3>
>  </ns:tag2>
>  </root>
>
>
>  So basically what I'm asking is how do I load my source XML as it is
> without having Java modify it?
>
> I have tags that don't have namespace information, and that is by
> design, but if I load the XML and let java assign a random namespace
> to it, it's no longer the same XML. And if I tell the document builder
> to not be namespace aware then it starts redefining namespaces to "".
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to