tracker issue : CF-3039622

select a category, or use search below
(searches all categories and all time range)
Title:

Bug 79364:(Watson Migration Closure)Attempting to use index notation to refer to a nodes named yes or no in a parsed xml document, you get either unexpected behaviour or this error message: The index of a child element is out of range

| View in Tracker

Status/Resolution/Reason: Closed/Won't Fix/LowImpact

Reporter/Name(from Bugbase): Dav Stott / Dav Stott (davstott-csl)

Created: 08/10/2009

Components: Language

Versions: 9.0

Failure Type: Unspecified

Found In Build/Fixed In Build: 9,0,0,241018 /

Priority/Frequency: Normal / Unknown

Locale/System: English / Platforms All

Vote Count: 0

Problem:

Attempting to use index notation to refer to a nodes named yes or no in a parsed xml document, you get either unexpected behaviour or this error message: The index of a child element is out of range.There are only 1 children under this node.Index 0 is out of the allowed range [1-1]. 
Method:

<cfsavecontent variable="myXML">  <myDoc>    <yes>yes text</yes>    <no>no text</no>    <aNode>aNode text</aNode>  </myDoc></cfsavecontent><cfoutput>  <cfset myXML = XMLParse(myXML)>  <cfdump var="#myXML#">  This works: #myXML.myDoc.aNode.xmltext#<br />  This also works: #myXML.myDoc["aNode"].xmltext#<br />  This works: #myXML.myDoc.yes.xmltext#<br />  This does not work but does not throw an exception: #myXML.myDoc["yes"].xmltext#<br />  This works: #myXML.myDoc.no.xmltext#<br />  <!--- This throws an exception: #myXML.myDoc["no"].xmltext# --->  <!--- which makes it  challenging to read specific fields like this: --->  <cfloop list="aNode,yes,no" index="i">    Index '#i#': #myXML.myDoc[i].xmltext#<br />  </cfloop></cfoutput>
Result:

Attempting to use index notation to refer to a nodes named yes or no in a parsed xml document, you get either unexpected behaviour or this error message: The index of a child element is out of range.There are only 1 children under this node.Index 0 is out of the allowed range [1-1].

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3039622

External Customer Info:
External Company:  
External Customer Name: Dav Stott
External Customer Email: 4BE82B4244C09792992015D5
External Test Config: 08/10/2009

Attachments:

Comments: