I repeated my test using xmlParse and got the same results.

<cfsavecontent variable="test">
<obs>
<users>
        <name type="root">Ray</name>
        <name>Foo</name>
</users>
</obs>
</cfsavecontent>
<cfset test2 = xmlParse(test)>
<cfdump var="#test2#">
<cfset node = test2.obs.users.name[2]>
<cfoutput>#xmlGetNodeType(node)#</cfoutput>
<p>
<cfoutput>#node.getClass()#</cfoutput>

Again, I don't think it's critical, but I really think I'm right here.
These _aren't_ exactly array/structs.

On Fri, Jan 20, 2012 at 6:10 AM, Andrew Scott <[email protected]> wrote:
>
> Raymond,
>
> From what I have experienced what is returned from XMLParse is indeed an
> associate array, an array of structs, and your example doesn't use XMLParse.
>
> So Justin is actually correct.
>
> --
> Regards,
> Andrew Scott
> WebSite: http://www.andyscott.id.au/
> Google+: http://plus.google.com/108193156965451149543
>
>
>
>
> On Fri, Jan 20, 2012 at 11:02 PM, Raymond Camden 
> <[email protected]>wrote:
>
>>
>> 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. ;)
>>
>>
>>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:349562
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to