By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,143 Members | 1,855 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,143 IT Pros & Developers. It's quick & easy.

Simple XML reading

P: n/a
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?
Nov 21 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a

A valid XML file can only have one root tag.

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

is fine, but

<Publisher />
<Distributor />

is not..

HTH,

Sam
On Tue, 25 Jan 2005 13:25:07 -0800, "MSSQLServerDeveloper"
<MS******************@discussions.microsoft.com> wrote:
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?


Nov 21 '05 #2

P: n/a
Nak
Hi there,

You might want to take a look at my tutorials...

http://www.npsoftware.co.uk/Tutorial...stence_XML.php

Nick.

"MSSQLServerDeveloper" <MS******************@discussions.microsoft.com>
wrote in message news:2A**********************************@microsof t.com...
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?

Nov 21 '05 #3

P: n/a
Nick,

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

:-)

Cor
Nov 21 '05 #4

P: n/a
Nak
> 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.
Nov 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.