473,396 Members | 2,059 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,396 software developers and data experts.

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 3934
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Philipp Lenssen | last post by:
Why isn't there a way in standard DOM to access all XML of a node? (Similar to what outerHTML and innerHTML can do on Firefox or Internet Explorer when accessing HTML.) Or am I missing something?...
3
by: Henrik K | last post by:
Selecting element nodes from a xmlDataDocument using the childNodes collection or by using selectSingleNode and then reading innerXml or outerXml leaks cpu-resources. A trivial example showing...
1
by: Peter Nofelt | last post by:
Hey All, I'm running into this issue with parsing through an xml document by tag name. Below is an example xml document: File Name: things.xml <things> <people> <name>Peter</name>
1
by: Ian Walsh | last post by:
XmlDocument oXmlDoc = new XmlDocument(); oXmlDoc.Load(filename); node = oXmlDoc.SelectSingleNode("//config/ldap/userpath"); Console.Write(node.InnerXml); The value I get is: ...
1
by: ALI-R | last post by:
I am showing the InnerXml of a node (in a treeView Control) in a tooltip ,but it is not formatted well ,all the elements after each other ,is there a way to format the innertext in a tooltip. ...
1
by: bkora | last post by:
I am trying to get the innerxml (children xml) of a node (TITLE_REQUEST) into a variable and pass that variable as a parameter to a method. My method is recieving an empty string. I am not sure...
0
by: bkora | last post by:
I am trying to get the innerxml (children xml) of a node (TITLE_REQUEST) into a variable and pass that variable as a parameter to a method. My method is recieving an empty string. I am not sure...
2
by: =?Utf-8?B?c2VlbWE=?= | last post by:
What is the differnce between outerXML and innerXML.
4
by: =?Utf-8?B?TWFyaw==?= | last post by:
Hi... I just noticed something that seems counter-intuitive to me. By default an XmlDocument is set with PreserveWhitespace=false. This means that XmlDocument.Load() or .LoadXml() will...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.