I have parsed an XML string into an XML document. I'm
converting it into a query for future operations.
I loop through the xmlNodes I'm interested in and all works
fine except when I'm trying to retrieve an XMLAttribute on a
specific XMLChild.
----------snip---------------
<CFSET var recCnt = ArrayLen(NodeSet) />
<CFLOOP index="r" from="1" to="#recCnt#">
<CFSET bAdd = QueryAddRow(THIS.qry)>
<CFSET tmp = QuerySetCell(THIS.qry, "AID",
NodeSet.XmlAttributes.ID) />
<CFSET tmp = QuerySetCell(THIS.qry, "article_title",
NodeSet.HEADLINE.XmlText) />
<CFSET tmp = QuerySetCell(THIS.qry, "article_abstract",
NodeSet.ABSTRACT.XmlText) />
<CFSET tmp = QuerySetCell(THIS.qry, "article_section_id",
NodeSet.SECTION.XmlAttributes.ID) />
<CFSET tmp = QuerySetCell(THIS.qry, "article_parent",
NodeSet.XmlAttributes.PARENT) />
<CFSET tmp = QuerySetCell(THIS.qry, "pub_name",
NodeSet.PUBLICATION.XmlText) />
<CFSET tmp = QuerySetCell(THIS.qry, "publish_dt",
NodeSet.XmlAttributes.PUBLISHDATE) />
<CFIF
StructKeyExists(NodeSet.XmlAttributes,"TOPSTORY")>
<CFSET tmp = QuerySetCell(THIS.qry, "TSOrdinal",
NodeSet.XmlAttributes.TOPSTORY) />
<CFELSE>
<CFSET tmp = QuerySetCell(THIS.qry, "TSOrdinal", 0) />
</CFIF>
<CFSET tmp = QuerySetCell(THIS.qry, "StoryOrder",
NodeSet.SECTION.XmlAttributes.ORDINAL) />
</CFLOOP>
----------snip-------------
Note that
<CFSET tmp = QuerySetCell(THIS.qry, "article_section_id",
NodeSet.SECTION.XmlAttributes.ID) />
works fine, but
<CFSET tmp = QuerySetCell(THIS.qry, "StoryOrder",
NodeSet.SECTION.XmlAttributes.ORDINAL) />
generates an error:
"Element SECTION.XMLATTRIBUTES.ORDINAL is undefined in a Java
object of type class coldfusion.xml.XmlNodeMap referenced as"
When I CFDUMP the NodeSet.SECTION.XmlAttributes I see both
the ID and the ORDINAL plain as day but when I try to reference the
ORDINAL its never defined.
I've tried DUPLICATEing the structure into a new variable and
referincing.
<CFSET AttCpy =
Duplicate(NodeSet.SECTION.XmlAttributes) />
<CFSET tmp = QuerySetCell(THIS.qry, "StoryOrder",
AttCpy.ORDINAL) />
Still undefined.
I've tried looking at an array of keys from StructKeyArray.
If I CFDUMP the array; ORDINAL is visible - when I try to reference
the Array's position for the key, it's undefined.
At my wits end. Any advice? Have a found a bug?