469,573 Members | 1,668 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,573 developers. It's quick & easy.

InnerXML not reading top Node

I'm creating a Windows App in C#(Smart Client)that calls a webservice.
The webservice returns this:

<?xml version="1.0" encoding="utf-8" ?>
<table id="klasse" records="4792">
<record locator="1">
<KlaKey>04424</KlaKey>
<KlaOms>(Niet in gids of internet)</KlaOms>
</record>
<record locator="2">
<KlaKey>03487</KlaKey>
<KlaOms>1-polig/wisselschakelaar</KlaOms>
</record>
<record locator="3">

…and so on

I call the webservice like this and want to parse the result using a
xmlDocument:

MyService.MyServiceObject myObject= new
SC.MyService.MyServiceObject();

System.Xml.XmlDocument xmlDoc = new XmlDocument();
string innerXml = myObject.AllData().InnerXml;
xmlDoc.LoadXml(innerXml);
This goes wrong however because appearently the innerXml looks like
this:
<record locator="1">
<KlaKey>04424</KlaKey>
<KlaOms>(Niet in gids of internet)</KlaOms>
</record>
<record locator="2">
<KlaKey>03487</KlaKey>
<KlaOms>1-polig/wisselschakelaar</KlaOms>
</record>
<record locator="3">

…and so on
So, the first node is gone (the highest-parent so to speak).

What am I doing wrong?
Help greatly appreaciated.

Bas
Nov 15 '05 #1
3 3804
Bas Jaburg <ba********@hotmail.com> wrote:

<snip>
So, the first node is gone (the highest-parent so to speak).

What am I doing wrong?


You're using InnerXml instead of OuterXml. InnerXml is basically
"everything inside this node". OuterXml is "this node and everything
inside it".

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #2
..OuterXml

"Bas Jaburg" <ba********@hotmail.com> schrieb im Newsbeitrag
news:13**************************@posting.google.c om...
I'm creating a Windows App in C#(Smart Client)that calls a webservice.
The webservice returns this:

<?xml version="1.0" encoding="utf-8" ?>
<table id="klasse" records="4792">
<record locator="1">
<KlaKey>04424</KlaKey>
<KlaOms>(Niet in gids of internet)</KlaOms>
</record>
<record locator="2">
<KlaKey>03487</KlaKey>
<KlaOms>1-polig/wisselschakelaar</KlaOms>
</record>
<record locator="3">

.and so on

I call the webservice like this and want to parse the result using a
xmlDocument:

MyService.MyServiceObject myObject= new
SC.MyService.MyServiceObject();

System.Xml.XmlDocument xmlDoc = new XmlDocument();
string innerXml = myObject.AllData().InnerXml;
xmlDoc.LoadXml(innerXml);
This goes wrong however because appearently the innerXml looks like
this:
<record locator="1">
<KlaKey>04424</KlaKey>
<KlaOms>(Niet in gids of internet)</KlaOms>
</record>
<record locator="2">
<KlaKey>03487</KlaKey>
<KlaOms>1-polig/wisselschakelaar</KlaOms>
</record>
<record locator="3">

.and so on
So, the first node is gone (the highest-parent so to speak).

What am I doing wrong?
Help greatly appreaciated.

Bas

Nov 15 '05 #3
Thanks a lot, that solved the problem!

Rgds,

Bas
www.jaburg.com
Nov 15 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Philipp Lenssen | last post: by
1 post views Thread by Ian Walsh | last post: by
1 post views Thread by ALI-R | last post: by
2 posts views Thread by =?Utf-8?B?c2VlbWE=?= | last post: by
4 posts views Thread by =?Utf-8?B?TWFyaw==?= | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.