I've never been able to get xmlsearch to return the attribute values.
However this works

<cfset myxml='
<parent>
        <child name="jo">
                <weight value="100lbs"/>
        </child>
</parent>
'>
<cfset myXML=xmlSearch(xmlParse(myXML), 'parent/child')>
<cfdump var="#myXML[1].xmlAttributes.name#">

I would think that

<cfoutput>#xmlSearch(xmlParse(myXML), 'parent/[EMAIL PROTECTED]')# would
return "jo" but it just returns the child array

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Justin Balog
Sent: Tuesday, February 03, 2004 3:54 PM
To: '[EMAIL PROTECTED]'
Subject: [CFCDev] OT: XPath() and getting attributes



Would an XPathQueryString look like to find the attributes of an XML
tag?

Basically, is it possible to return the value attribute of the weight
tag, or does xmlSearch() only return the text elements?

<parent>
        <child name="jo">
                <weight value="100lbs"/>
        </child>
</parent>

Thanks,

Justin

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at
www.mail-archive.com/[EMAIL PROTECTED]



----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]

Reply via email to