J
JB
Hi everyone,
I'm having problems with Tab characters in an XML file.
I want to store a Tab character as part of an element value e.g.
<Separator>TAB</Separator>
I'm using XmlWriter to write my file and XmlReader to read it.
At first my tab character was stored in the element, but was ignored
when it was read back (giving me an empty string as a content).
Herfried K. Wagner suggested on this group to use the
'xml:space="preserve"' attribute. It worked fine, except that now I
have to generate my whole file without indentation otherwise the
reader generates an exception.
Ideally I would like
1) To be able to store Tab characters in an element value
2) Have an indented XML file e.g.
<Config>
<Some Container Element>
<Separator>TAB</Separator>
</Some Container Element>
<Some Other Element>
</Some Other Element>
<Config>
I've tried to play with the values of the XmlReader and XmlWriter
settings, but can only manage to get either 1) or 2) but not both at
the same time.
Can somebody help me with that?
Thanks
JB
I'm having problems with Tab characters in an XML file.
I want to store a Tab character as part of an element value e.g.
<Separator>TAB</Separator>
I'm using XmlWriter to write my file and XmlReader to read it.
At first my tab character was stored in the element, but was ignored
when it was read back (giving me an empty string as a content).
Herfried K. Wagner suggested on this group to use the
'xml:space="preserve"' attribute. It worked fine, except that now I
have to generate my whole file without indentation otherwise the
reader generates an exception.
Ideally I would like
1) To be able to store Tab characters in an element value
2) Have an indented XML file e.g.
<Config>
<Some Container Element>
<Separator>TAB</Separator>
</Some Container Element>
<Some Other Element>
</Some Other Element>
<Config>
I've tried to play with the values of the XmlReader and XmlWriter
settings, but can only manage to get either 1) or 2) but not both at
the same time.
Can somebody help me with that?
Thanks
JB