473,386 Members | 1,699 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,386 software developers and data experts.

Simple XML reading

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
4 1730

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
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
Nick,

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

:-)

Cor
Nov 21 '05 #4
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: JKop | last post by:
Take the following simple function: unsigned long Plus5Percent(unsigned long input) { return ( input + input / 20 ); } Do yous ever consider the possibly more efficent:
7
by: dan | last post by:
hey peeps, i am completely new at c++ and i need some help with an assignment. it is basically about file i/o with fstreams. i understand how to open a file with fstream, but how would you read,...
6
by: Scott Niu | last post by:
Hi, I have this following simple c++ program, it will produce memory leak ( see what I did below ). My observation also showed that: There will be a mem leak when all the 3 conditions are true:...
7
by: chris.millar | last post by:
The below xml is saved as a file, i want the quickest way in c# of reading just the DataSource section and returning it as a string, can anyone help me out. Cheers Chris. <NewDataSet>...
5
by: Rob Somers | last post by:
Hey all I am writing a program to keep track of expenses and so on - it is not a school project, I am learning C as a hobby - At any rate, I am new to structs and reading and writing to files,...
6
by: KevinD | last post by:
assumption: I am new to C and old to COBOL I have been reading a lot (self teaching) but something is not sinking in with respect to reading a simple file - one record at a time. Using C, I am...
1
by: Kenny ODell | last post by:
I am struggling a bit with XML, even as I wade through endless help files and several books. I thought it would be useful to toss my particular needs to the group to see what you think is the best...
1
by: Brian Henry | last post by:
Hello, I was tring to learn socket's (being i never used them before) and have a simple question. I want to create a listner that will get any data recieved and print it out. I've been able to...
27
by: one man army | last post by:
Hi All- I am new to PHP. I found FAQTS and the php manual. I am trying this sequence, but getting 'no zip string found:'... PHP Version 4.4.0 $doc = new DomDocument; $res =...
3
by: Bryan | last post by:
I have an MS Access DB with a table' Isometric' . One of the columns is named 'Sheet'. I am doin a test to see if I can change a value in the dataset and update the Access table with the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...

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.