473,396 Members | 2,036 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.

selectnodes method not working

I'm building a print manager that will bind XML data to a crystal report for
printing.' The printing will be done in batches. Each "batch" will have its
own set of reports generated. I'm trying to loop thru each batch, retreive
all the "agreement" child nodes into a node list, then loop through those, &
printing an "agreement" report from each item in the secondary loop. When I
try to retreive the "agreement" nodes via the "SelecNodes" method of the
XmlNode object, I come up empty. I'm 99% sure it's an xpath issue but can't
narrow it down more. Code & xml data follow:

------------------- XML---------------------
<?xml version="1.0" encoding="ISO-8859-1" ?>
<job xmlns="http://www.w3schools.com">
<batch>
<invoice>
<header>
<customerid>4883</customerid>
<invoiceid>5SFGMFC</invoiceid>
<amount>45.98</amount>
<arinvoicedate>12/5/2004</arinvoicedate>
</header>
<detail id="1">
<type>package unit</type>
<unitprice>package unit</unitprice>
<quantity>5</quantity>
</detail>
</invoice>
<agreement>
<coveragestartdate>8/3/2005</coveragestartdate>
<coverageenddate>3/19/2007</coverageenddate>
<partnumber>RSCU-10-4LP</partnumber>
<agreementnumber>5022883003</agreementnumber>
<agreementcharge>45.02</agreementcharge>
<distributornumber>A90394</distributornumber>
</agreement>
<agreement>
<coveragestartdate>7/7/2002</coveragestartdate>
<coverageenddate>3/19/2007</coverageenddate>
<partnumber>GCS1SC-05-31LP</partnumber>
<agreementnumber>1926347</agreementnumber>
<agreementcharge>120.47</agreementcharge>
<distributornumber>G100-00200</distributornumber>
</agreement>
<agreement>
<coveragestartdate>12/31/2004</coveragestartdate>
<coverageenddate>3/19/2007</coverageenddate>
<partnumber>GCS1SC-10-31LP</partnumber>
<agreementnumber>9484777</agreementnumber>
<agreementcharge>67.11</agreementcharge>
<distributornumber>F1009-55900</distributornumber>
</agreement>
</batch>
</job>
------------------- CODE ---------------------
objBatchDataDoc = New XmlDocument
objBatchDataDoc.Load("http://localhost/ReportData.xml")
objBatchNodeList = objBatchDataDoc.GetElementsByTagName("batch")
For x = 0 To (objBatchNodeList.Count - 1)
objAgreementNodeList = objBatchNodeList.itemOf(x).SelectNodes("agreement" )

' I'm using this to test. count property keeps coming up 0
response.write(objAgreementNodeList.count & "<br>")

[CODE TO PARSE THE AGREEMENT NODES GOES HERE]
next

Sep 29 '05 #1
0 1204

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

Similar topics

7
by: Robert Mark Bram | last post by:
Hi All! In the code below, I am reading in an xhtml document and attempting to use selectNodes to find a <p id="rmb"> node.. But the result is: 2 - */* 0 - */p Can anyone suggest what I...
1
by: MacDk | last post by:
Hi, Given this: http://rss.asdf.dk/theothermusic.rss how do you use selectnodes/Xpath to return all title-items (//title is not working). I think it a problem with namespace but i can't...
8
by: e-mid | last post by:
i want to get childs of specific xml node. normally i use xmlNodeList fooList = myNode.SelectNodes("foo"); but in compactframework , there is no selectNodes() method or selectSingleNode()...
2
by: Dave | last post by:
Hi, Is there an easier way to pull a subset of nodes from one XmlDocument to another? I have the code below but would like to know if there is a more streamlined method. Thanks, Dave ...
2
by: Joe | last post by:
Hello All: Does anyone know the differnce between the GetElementsByTagName method and the SelectNodes method? I know that they take different arguments. They also both return a NodeList. I'm...
0
by: Glenn Venzke | last post by:
I'm building a print manager that will bind XML data to a crystal report for printing.' The printing will be done in batches. Each "batch" will have its own set of reports generated. I'm trying to...
16
by: PiotrKolodziej | last post by:
Hi I'am using SelectNodes method to find if node followed by string exists, and if so i going to select that node. Create doc i such a way: doc = new XmlDocument(); ...
2
by: DeveloperX | last post by:
SelectNodes under 1.1 is confusing me. Imagine an xml file that looks like this. It's just an example: <drive> <dir a="a"> <file>aA</file> <file>aB</file> <dir a="ab"> <file>abA</file> <dir...
3
by: John Smith | last post by:
I'm trying to make some Javascript X-browser. foo is a HTML DOM. I have foo.documentElement.selectNodes("xpath"); in the source. I see later down there is also a foo.transformNode. Yuck. ...
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: 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
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
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...
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.