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

  • Thread starter Thread starter JB
  • Start date Start date
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
 
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.
 
Back
Top