S
ssamuel
Has anyone had any luck managing namespace scoping using
System.Xml.XmlDocument? Specifically, I'm trying to avoid this:
<root xmlns="urn:1">
<prefix:child xmlnsrefix="urn:2"/>
<prefix:child xmlnsrefix="urn:2"/>
</root>
I'd like to see something like this instead:
<root xmlns="urn:1" xmlnsrefix="urn:2">
<prefix:child/>
<prefix:child/>
</root>
I understand that if I'm using XML streams (like an XmlTextWriter)
it's impossible to predict all the prefixes at the root node, but if
I've got a DOM object (like an XmlDocument) I should be able to "up-
scope" prefix declarations one way or another.
I'm writing an API so I need a solid solution, not a hack.
Thanks,
Stephan
System.Xml.XmlDocument? Specifically, I'm trying to avoid this:
<root xmlns="urn:1">
<prefix:child xmlnsrefix="urn:2"/>
<prefix:child xmlnsrefix="urn:2"/>
</root>
I'd like to see something like this instead:
<root xmlns="urn:1" xmlnsrefix="urn:2">
<prefix:child/>
<prefix:child/>
</root>
I understand that if I'm using XML streams (like an XmlTextWriter)
it's impossible to predict all the prefixes at the root node, but if
I've got a DOM object (like an XmlDocument) I should be able to "up-
scope" prefix declarations one way or another.
I'm writing an API so I need a solid solution, not a hack.
Thanks,
Stephan