problem with xmltextreader and stream with &

C

CindyH

Hi

I have an xml stream that I would like to read with xmltextreader.
Problem is that there are some & inside the xml stream.
Parse is not working on them.
Can someone show me sample code for reading a stream like this?

Thanks,
Cindy
 
C

Cor Ligthert[MVP]

Cindy,

No.

Because it with that & not XML.

(You can first try to read the file as simple text file, change or remove
all the & and then read it again as XML)

Cor
 
P

Phill W.

No.
Because it with that "&" is not XML.

A thought ...

The XmlReader classes are inheritable. Do you know of anyone who's
experimented with creating XmlReader subclasses that can detect (and
correct) this kind of thing as the Xml text is read in?

I /may/ be looking at doing something similar, and an extended XmlReader
would be ideal. I'm thinking of writing Xml-formatted log files that
/lack/ a closing root element tag. These can be appended to, like
regular text log files (quick and simple) and a customised XmlReader
could "spot" the errant End-Of-File and append the missing tag, as the
text is read "back in".
Haven't tried it yet, though.

Regards,
Phill W.
 
C

Cor Ligthert[MVP]

Phill,

I would not even think about it to take any minute in it. This lead to
endless changes because whatever not well format XML can be created.

XML is a well describted way to exchange data. Why would I not use that?

Cor
 

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