Can't read Tab characters from an XML File...

J

JB

Hi All,

I can write a Tab character in the Value of an XML field, but when I
read the XML file back I get an empty string instead!!!

Here's the sample code:

'Write the Tab char in Separator Field. Works fine (i.e. there's a Tab
in the File)
Writer.WriteElementString("Separator", vbTab)

'Read the field back and sSeparatorChar contains an emppty String!
sSeparatorChar = Reader.ReadElementContentAsString("Separator", "")

Can anybody help me on that one?
Thanks
JB
 
Z

zacks

Hi All,

I can write a Tab character in the Value of an XML field, but when I
read the XML file back I get an empty string instead!!!

Here's the sample code:

'Write the Tab char in Separator Field. Works fine (i.e. there's a Tab
in the File)
Writer.WriteElementString("Separator", vbTab)

'Read the field back and sSeparatorChar contains an emppty String!
sSeparatorChar = Reader.ReadElementContentAsString("Separator", "")

Can anybody help me on that one?
Thanks
JB

I ran into this same problem a few years ago. There may be a more
elegant way to acheive this, but I did it by storing "\t" as a special
value to indicate the TAB character. After reading the XML file back
in, when processing this node's inner text, I translate "\t" to vbTab.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top