Hey Jonathan -

This worked perfectly for me.  And, if you're really just looking for
that one element it will be much faster than iterating across the
entire document.  The code below, as pointed out by Brad, returns a
single element array.  Code snippet below:

<cfoutput>

<cfxml variable="xmldoc" casesensitive="Yes">
<nitf>
        <head>
                <meta name="ap-transref" content="V1463" />
                <meta name="ap-origin" content="pf1apon" />
                <meta name="ap-selector" content="-----" />
                <meta name="ap-category" content="a" />
                <meta name="ap-format" content="bx" />
                <meta name="ap-routing" content="ENTITLEMENTS,pfONLINE,pf1110" 
/>
                <meta name="ap-profile-country" content="country: United States;
ISOCountry3: USA; UNTop: 021; APGroup: NorthAmerica" />
                <meta name="ap-online-code" content="1110" />
                <meta name="ap-cycle" content="AP" />
                <meta name="ap-keyword" content="Walking Across America" />
                <meta name="ap-xhl" content="Once 410 Pounds, California Man 
Nears
End of His Cross-Country Odyssey" />
                <meta name="ap-dheadline" content="Man nears end of his
cross-country odyssey" />
                <meta name="ap-dxhl" content="Once 410 pounds, California man 
nears
end of his cross-country odyssey" />
                
                <docdata>
                        <doc-id regsrc="AP" id-string="D8HG6H880" />
                        <urgency ed-urg="7" />
                        <date.issue norm="20060509T100123Z" />
                        <du-key key="Walking Across America" />
                        <doc.rights owner="http://www.ap.org";
agent="http://license.icopyright.net"; type="online,reprint" />
                        <doc.copyright year="2006" holder="Copyright 2006 The 
Associated
Press. All rights reserved. This material may not be published,
broadcast, rewritten or redistributed." />
                </docdata>
        </head>
</nitf>
</cfxml>

</cfoutput>

<cfset meta = XMLSearch ( xmldoc, "/nitf/head/[EMAIL 
PROTECTED]'ap-online-code']" ) />

<cfdump var="#meta#" label="meta" expand="Yes" />

On 5/9/06, Jonathan Mauney <[EMAIL PROTECTED]> wrote:
> This didn't work either (after changing outer single quotes to double):
>
> "Complex object types cannot be converted to simple values."
>
> >If you're looking specifically for that element, I'd use
> >XPath/XMLSearch().  Try this:
> >
> >XMLSearch ( mydoc, '/nitf/head/[EMAIL PROTECTED]'ap-online-code']' )
> >
> >On 5/9/06, Ian Skinner <[EMAIL PROTECTED]> wrote:
> >>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:240064
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=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to