473,738 Members | 1,949 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XMLNodeReader question

Below is a part of my xml file returned from a webservice. Instead of
converting to a datatable and going through it a record at a time checking
if ClientCodeType = "Balloon_Ty pe" and ClientCode = "R" to the OurCode of 3,
I want to use the XMLNodeReader to get that result back using MoveTo..
functions. My first of probably many question is how come this
XMLNodeReader has no attributes. I can not change the way the webservice
returns the string. Then, how do I use the MoveTo functions to get my 3
back? Thanks

<NewDataSet>
<Table1>
<OurCode>3</OurCode>
<ClientCode>B </ClientCode>
<ClientCodeType >Balloon_Type </ClientCodeType>
</Table1>
<Table1>
<OurCode>3</OurCode>
<ClientCode>R </ClientCode>
<ClientCodeType >Balloon_Type </ClientCodeType>
</Table1>
</NewDataSet>

Jan 31 '07 #1
1 1919
"WalterWalt " <,wrote in message
news:uH******** ******@TK2MSFTN GP06.phx.gbl...
Below is a part of my xml file returned from a webservice. Instead of
converting to a datatable and going through it a record at a time checking
if ClientCodeType = "Balloon_Ty pe" and ClientCode = "R" to the OurCode of
3, I want to use the XMLNodeReader to get that result back using MoveTo..
functions. My first of probably many question is how come this
XMLNodeReader has no attributes. I can not change the way the webservice
returns the string. Then, how do I use the MoveTo functions to get my 3
back? Thanks

<NewDataSet>
<Table1>
<OurCode>3</OurCode>
<ClientCode>B </ClientCode>
<ClientCodeType >Balloon_Type </ClientCodeType>
</Table1>
<Table1>
<OurCode>3</OurCode>
<ClientCode>R </ClientCode>
<ClientCodeType >Balloon_Type </ClientCodeType>
</Table1>
</NewDataSet>
Not sure exactly what you mean but using selectNodes with XPath is easy:
/*/Table1/OurCode[../ClientCode = 'B' and ../ClientCodeType =
'Balloon_Type']
--

Joe Fawcett (MVP - XML)
http://joe.fawcett.name
Feb 2 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
5040
by: Stevey | last post by:
I have the following XML file... <?xml version="1.0"?> <animals> <animal> <name>Tiger</name> <questions> <question index="0">true</question> <question index="1">true</question> </questions>
0
1267
by: Brian Rogers | last post by:
To whom it may concern: Can anyone explain this behaviour in serialization and deserialization? I serialize an object using an XML serializer. I de-serialize the object from a StringReader and it deserializes correctly I de-serialize the object from a XmlNodeReader and it deserializes incorrectly. The xml code contained in the StringReader and XmlNodeReader is IDENTICLE.
4
11399
by: Andy Neilson | last post by:
I've run across a strange behaviour with XmlSerializer that I'm unable to explain. I came across this while trying to use XmlSerializer to deserialize from a the details of a SoapException. This should have worked fine since the class in question was already being serialized and deserialized as part of a Web service interface. What I found was that by deserializing from an XmlNodeReader instead of an XmlTextReader, XML Serialization doesn't work...
1
2591
by: Kris Desmadryl | last post by:
I want to loop all nodes of an xml file, because I want to search the content for a certain search pattern. I did something like this : reader = New XmlNodeReader(doc) While reader.Read() Select Case reader.NodeType Case XmlNodeType.Element Select Case reader.Name Case "al" Dim value As String
3
3089
by: Ekqvist Marko | last post by:
Hi, I have one Access database table including questions and answers. Now I need to give answer id automatically to questionID column. But I don't know how it is best (fastest) to do? table before rowID answID qryrow questionID datafield 1591 12 06e 06e 06e question 1593 12 06f 06f 06f question 1594 12 answer to the question 06f
4
4701
by: David | last post by:
All I have an XML document as illustrated in the extract below. I am trying to use the XmlNodeReader to extract information from the document. What I am having trouble with is when I read the line of the document I am unable to read the value of the element. Below is an extract of the source code that I am using to read the other parts of the document that I want to extract. Any assistance would be appreciated. Thanks
4
3569
by: Samuel R. Neff | last post by:
I'm deserializing an XML file. If I pass a Stream to the file directly to the deserializer as follows it works fine: o = (New XmlSerializer( GetType( CompensationPackage))).Deserialize(stream) But if I pass an XmlNodeReader to the deserializer it doesn't work:
3
1527
by: adhag | last post by:
Hi I am trying to parse through a large file in pieces using the xmlNodeReader. I only need it to be forward only and performance is the key but I am having a problem trying to get all the information out of my xml file. For arguments sake my sample xml file looks like this <?xml version="1.0" encoding="ISO-8859-1" standalone="no"?> <row value="123"> <errorcol e_w_flag="e" value="10003" col="5"/>
10
1667
by: jambalapamba | last post by:
I am trying to skip element in xml document where style attribute is VISIBILITY: hidden or DISPLAY: none. In the following example i want to skip the last two elements but when i skip the element with id=”Div1” and next reader.Read() reads “ includeme” but i expected it to read element <a id ="Div2" style="visibility:hidden "> and skip it instead its writing “ includeme” to the console ...
0
8787
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9473
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9259
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9208
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8208
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6750
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4569
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4824
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.