473,396 Members | 1,693 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.

Another XML Question

I'm just full of questions today!

Is there a better way to do this?

xNList =
xmlPO.SelectNodes("//SOAP-ENV:Body/PurchaseOrder/OrderBody/Item", xNSM)
For Each xNode In xNList
i = CType(xNode.Attributes.Item(0).InnerText, Short)
xChild = xmlPO.SelectSingleNode( _
"//SOAP-ENV:Body/PurchaseOrder/OrderBody/Item[@LineNumber='" & _
i.ToString & "']/Product[@IDType= 'Buyer']/ID", xNSM)
sVal = sVal & "Item Node LineNumber(" &
xNode.Attributes.Item(0).InnerText & _
") = Part Number: " & xChild.InnerText & vbNewLine
Next

Specifically, I'm getting a Node list before the For Each loop starts, but
within the loop I'm referencing the full path of the document to set xChild.
Can't I set xChild to a relative path from xNode? If so, then how would I
code that?

BTW, here's the XML, if that helps...

<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<PurchaseOrder>
<OrderBody>
<Item LineNumber="1">
<Product IDType="Buyer">
<ID>NTMN34GA70</ID>
<Description>3904 CHARCOAL NORTEL PHONE SET</Description>
</Product>
<Quantity UOM="EA">14</Quantity>
<Amount>170</Amount>
</Item>
<Item LineNumber="2">
<Product IDType="Buyer">
<ID>NTMN35GA70</ID>
<Description>3905 CHARCOAL NORTEL PHONE SET</Description>
</Product>
<Quantity UOM="EA">3</Quantity>
<Amount>248</Amount>
</Item>
<Item LineNumber="3">
<Product IDType="Buyer">
<ID>NTMN18AA70N</ID>
<Description>3905 CHARCOAL NORTEL HANDSET</Description>
</Product>
<Quantity UOM="EA">3</Quantity>
<Amount>29</Amount>
</Item>
</OrderBody>
</PurchaseOrder>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
--
TFWBWY...A
Dec 5 '05 #1
0 706

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

Similar topics

3
by: fig000 | last post by:
Hi, I'm relatively new to Javascript so please bear with me on what might sound like silly questions. This is what I want to do: I'm working in classic asp (I have to for this project). I...
6
by: anon | last post by:
Post Forwarding question...... For this control below, <asp:Button runat="server" PostTargetUrl="page2.aspx" /> The Attribute: PostTargetUrl="page2.aspx" Is this PostTargetUrl Attribute...
2
by: terence.parker | last post by:
I am often faced with the dilemma of whether to use a JOIN query across three tables in order to grab a bunch of results - or whether to create another table to represent what I want. The latter is...
0
by: Sebastian Hiller | last post by:
Hello, i'm new to .Net (i'm using VB as language and i'm working in the code-behind mode) and i can't solve the following problem: I have a WebForm and want to Add a UserControl...
3
by: Brad | last post by:
I have another hopefully simple question. I am so used to writing VB .Net windows apps that there are some things in ASP .Net that just does not easily cross over. I know how to pass variables to...
27
by: Javier Martinez | last post by:
Hi I have asp application in a machine with a virtual directory referring a shared directory in another machine When I try to load any aspx page of my portal I get the following error: ...
17
by: Eric_Dexter | last post by:
def simplecsdtoorc(filename): file = open(filename,"r") alllines = file.read_until("</CsInstruments>") pattern1 = re.compile("</") orcfilename = filename + "orc" for line in alllines: if not...
24
by: David Mathog | last post by:
On a Solaris 8 system if a user "joe" logs in, for instance via ssh, cuserid() returns "joe". That's the expected behavior and so far so good. However if that user then does: % su - sally ...
13
by: shookim | last post by:
I don't care how one suggests I do it, but I've been searching for days on how to implement this concept. I'm trying to use some kind of grid control (doesn't have to be a grid control, whatever...
4
by: MichaelK | last post by:
Hello. I have all data already collected on the current page? I want to open another window with the form, fill the fields and submit that form. So basically the question is how can I fill all...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
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,...

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.