I don't think that is accurate. Yes you can use array/struct functions
on them, but they are not array/structs. Consider this example:

<cfxml variable="test">
<obs>
<users>
        <name type="root">Ray</name>
        <name>Foo</name>
</users>
</obs>
</cfxml>

<cfdump var="#test#">
<cfset node = test.obs.users.name[2]>
<cfoutput>#xmlGetNodeType(node)#</cfoutput>
<p>
<cfoutput>#node.getClass()#</cfoutput>

The first output clearly shows much more then a structure and much
more than what you see above - ie it recognizes that 'type' is an
xmlAttribute.

The second example shows that the class behind the variable is
org.apache.xerces.dom.DeferredElementNSImpl.

Maybe I'm being picky. ;)


On Thu, Jan 19, 2012 at 11:03 PM, Justin Scott <[email protected]> wrote:
>
>> Yeah, thanks Rick, good tip. You'll find that working with CF XML
>> nodes is a lot like working with structs and arrays, so most of
>> those array*() and struct*() built-in functions will work with your XML.
>
> When you use XMLParse(), the resulting variable is a set of arrays and
> structures, so it's not just "a lot like working" with them, you
> actually are, so all of the relevant functions are applicable.
> Whenever I'm working with parsing XML I tend to make judicious use of
> CFDUMP which will show the entire set of ColdFusion data structures
> and makes navigating them a lot easier.  Glad this got brought up as
> I've run into a lot of people that didn't realize this was the case.
>
>
> -Justin
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349560
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to