Simple XML reading

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have the following xml file -
<?xml version="1.0" encoding="utf-8" ?>
<Publisher1>Mary</Publisher1>
<Distributor>Joe</Distributor>

and snippet of vb.net code that is failing with the error-
"The <Publisher1> tag from namespace is not expected"

Dim XmlReader As New XmlTextReader("ReplConfig.xml")
Return XmlReader.ReadElementString("Distributor")

Any ideas?
 
A valid XML file can only have one root tag.

<Config>
<Publisher />
<Distributor />
</Config>

is fine, but

<Publisher />
<Distributor />

is not..

HTH,

Sam
 
And that written by the man who wrote in 2003 a lot in Cockney.

Cheeky bugger, I ain't no London Cockey guv!! I'm from Kent! :-)

Nick.
 

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

Back
Top