473,326 Members | 2,173 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

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

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

Sep 26 '07 #1
2 3298
On Sep 26, 12:49 pm, JB <jb.bross...@gmail.comwrote:
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.

Sep 26 '07 #2
"JB" <jb*********@gmail.comschrieb:
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!!!
'xml:space="preserve"':

<URL:http://www.w3.org/TR/2000/REC-xml-20001006#sec-white-space>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Sep 26 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: Guyon Morée | last post by:
what is the difference? if I open a text file in binary (rb) mode, it doesn't matter... the read() output is the same.
3
by: Anne-Marte | last post by:
Hi I simply don't understand how to read a simple file using std::istream. How do I open a file for reading with istream?? Anne-Marte
7
by: Kueishiong Tu | last post by:
I have a text file with wide characters. I use the following C++ code to read them in. However the wide characters are read in properly. What is wrong? String* path = "C:\\Documents and...
14
by: spike | last post by:
Im trying to write a program that should read through a binary file searching for the character sequence "\name\" Then it should read the characters following the "\name\" sequence until a NULL...
4
by: ESPN Lover | last post by:
Below is two snippets of code from MSDN showing how to read a file. Is one way preferred over the other and why? Thanks. using System; using System.IO; class Test { public static void...
1
by: JenHu | last post by:
Hi, I want to open a file and read every line and characters. The characters are fix length text file, no specific delimited method between each fields. If the first character is "H" then it's...
35
by: RyanS09 | last post by:
Hello- I am trying to write a snippet which will open a text file with an integer on each line. I would like to read the last integer in the file. I am currently using: file = fopen("f.txt",...
6
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
9
by: Adi | last post by:
Hello eveyone, I wanna ask a very simple question here (as it was quite disturbing me for a long time.) My problem is to read a file line by line. I've tried following implementations but still...
1
by: aemado | last post by:
I am trying to read in several lines, each should have exactly 5 pieces of data. I am using try/catch/throw to determine if the data is in the correct format, and trying to use iss to separate the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.