Hello everyone.  I didn't have much luck on the Macromedia forum online
so I'm hoping maybe someone on this mailing list can help me out.

I am parsing an XML file using MSXML 4.0. I get to a stage in the doc
where I need to iterate over a NodeList object. I write the following
code:

<!--- Retrieve collection of Order tagsets --->
<cfset orderNodes = FCE.xmlDom.getElementsByTagName("Order")>

<cfif orderNodes.length NEQ 0>
  <cfloop collection="#orderNodes#" item="i">
    <cfset FCE.orderID = i.selectSingleNode("//OrderID")>
    <cfoutput>#FCE.orderID.text#</cfoutput>**************
    <cfset FCE.type = i.selectSingleNode("//OrderType")>
    <cfset FCE.currencyID = i.selectSingleNode("//Currency")>
    <cfset FCE.amount = i.selectSingleNode("//Amount")>
    <cfset FCE.name = i.selectSingleNode("//Name")>
    <cfset FCE.address = i.selectSingleNode("//Address")>
    <cfset FCE.phone1 = i.selectSingleNode("//Phone1")>
    <cfset FCE.phone2 = i.selectSingleNode("//Phone2")>
    <cfset FCE.email = i.selectSingleNode("//Email")>

    <!--- Insert verified order --->
    <cfinclude template="qry_insertOrder.cfm">

  </cfloop>
  ...
</cfif>

During 2nd and further iterations of the loop I get the value of
FCE.orderID.text to be equal to the value of the FCE.orderID.text from
the first item in the collection (see ***** line). I've tried switching
out getElementsByTagName() for selectNodes() with an XPath Query of
"/Fufill/Order" and I get the same results.

I guess I should also explain the XML doc's basic structure:

<Fufill>
<Order>
<OrderID></OrderID>
<Currency></Currency>
...
</Order>
<Order>
...
</Fufill>

I've tried using the nextNode() and item() method from the NodeList
object with no luck. I've also tried adding statements like <cfset
FCE.orderID = ""> to destroy the COM object in memory. This action had
no effect.

Right now I'm facing going with a Java CFX tag in place of the MSXML
parser. I like the ease of use associated with MSXML so I'm hoping i can
find a solution. Any help would be appreciated. Thanks.

-Brian


-----------------------+
cf-xml mailing list
list: [EMAIL PROTECTED]
admin: [EMAIL PROTECTED]
home: http://torchbox.com/xml

Reply via email to