Question any way to prevent .ImportNode() from changing my tags?

jesckom

New member
Joined
Jan 20, 2010
Messages
2
Programming Experience
5-10
I realised after using .ImportNode(), the tags of those nodes with no data in the imported XML node got shortened.

For example,

<a>
<b>some text</b>
<c></c>
<d></d>

</a>

will become the following after being imported into a XML document,

<a>
<b>some text</b>
<c />
<d />

</a>

Is this a default behaviour of the ImportNode method?

I need to retain my tags as "<c></c>" after importing. How can I do that?

Could someone please help?
 
How come you need to retain tags in that format? The two are equivalent, but if youre dealing with a broken parser in some other system, it would be better to fix that problem!!
 
Yes, I know they are equivalent. And, yes, it's because of some stupid parser in another system which I have no control over.

Anyway, I did a reluctant workaround.. in an ungraceful way.. treating and copying them as text streams. =(
 
Back
Top