473,548 Members | 2,716 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.WriteEle mentString("Sep arator", vbTab)

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

Can anybody help me on that one?
Thanks
JB

Sep 26 '07 #1
2 3304
On Sep 26, 12:49 pm, JB <jb.bross...@gm ail.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.WriteEle mentString("Sep arator", vbTab)

'Read the field back and sSeparatorChar contains an emppty String!
sSeparatorChar = Reader.ReadElem entContentAsStr ing("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*********@gm ail.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="pre serve"':

<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
10461
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
6021
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
4781
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 Settings\\kst\\BE.dat"; try { FileStream* fs = new FileStream(path, FileMode::Open); StreamReader* sr = new StreamReader(fs);
14
3749
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 character is encountered. But when my program runs it gets a SIGSEGV (Segmentation vioalation) signal. Whats wrong? And is there a better way...
4
2719
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 Main()
1
2564
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 a header line; "D" or "R" means it's a content; "T" means it's a footer line. How to find the first character of each line? and is it the...
35
11375
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", "r+"); fseek(file, -2, SEEK_END); fscanf(file, "%d", &c); this works fine if the integer is only a single character. When I get into larger...
6
4851
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 the html page controls the form fields that are required. It doesn't function like it's supposed to and I can leave all the fields blank and it still...
9
5193
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 facing problems: Assume that FILE* filePointer; unsigned char lineBuffer;
1
2006
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 parts. However, this is my first time using both, and I am pretty certain that I am missing something obvious. Firstly, by debugging, I found that the...
0
7518
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7711
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7954
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7467
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5367
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5085
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3497
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3478
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1054
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.