Can you use XMLSearch()?

<cfset node = XMLSearch ( parsedXML, '/root/goodnode/goodnode_name/text()' ) />

<cfoutput>#node[1].value#</cfoutput>

I recommend dumping the node value to ensure that the way my code
accesses that value is correct.  It may be a little off - I'm winging
it, here.

On 6/13/06, Ian Sheridan <[EMAIL PROTECTED]> wrote:
> My subject line pretty much says it all, but let me clarify. I want to
> return an XML object back to it's original format after I have used
> XMLSEARCH on it. I guess it's a matter of aesthetic but I'd like to be
> able to use the node name as the name of the structure I am accessing.
>
> EX.
>      <root>
>           <goodnode>
>                <goodnode_name>DUDE</goodnode_name>
>           </goodnode>
>      </root>
>
>      .... parse xml ....
>      .... search xml ....
>      .... place xml in xml variable ....
>
>      <cfoutput>#xml.root.goodnode.goodnode_name.xmltext#!</cfoutput>
>
>      .... resulting in ....
>
>      DUDE!
>
> It's a pain to do this:
>
>      
> <cfoutput>#xml.XmlChildren[1].XmlChildren[1].XmlChildren[1].xmltext#!</cfoutput>
>
> I figure that I am missing something and I do not want to reinvent the
> wheel so to speak.
>
>
> - Ian
>
> --
>
> ----------------------
> Ian Sheridan
> http://www.savagevines.com
> ----------------------
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:243330
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to