Your intuition was correct, you can indeed use
"/entry[index]/category" - except that index would want to be a
numerical value; ie.

<cfset variables.xml =
XmlParse('http://www.blogger.com/feeds/1550840680584738668/posts/default?published-min=2008-11-11T00:00:00&published-max=2008-11-25T23:59:59')>
<cfset variables.entries = XmlSearch(xml, '/:feed/:entry')>

<cfoutput>
        <cfloop from="1" to="#ArrayLen(entries)#" index="variables.i">
                <cfset variables.categories = XmlSearch(xml, 
'/:feed/:entry[#i#]/:category')>
                <!--- ... etc. --->
        </cfloop>
</cfoutput>

A quick example of what else can be done using XPath in this way:

//[EMAIL PROTECTED]"http://www.google.com"]/category

This will select all the category elements with in an entry element
that has an 'id' attribute with a value of 'http://www.google.com'.

XML and XPath are wonderful beasts. While it may not help you in terms
of your deadline; I'd highly recommend getting a copy of "XML In A
Nutshell". XML can be tricky to explain and this book does it really
comprehensively and readably. W3Schools also have a fairly good
reference and forum:

http://www.w3schools.com/Xpath/

HTH

Dominic

2008/11/25 daniel kessler <[EMAIL PROTECTED]>:
> I thought I was gonna have it off of that, but after mucking with it for 
> quite awhile, I still don't have it working.
> <sigh>
>
> In your example, coming off of my batch of data, there's only one entry.  In 
> my case, I have several entries and I'm already rooting through each one.  I 
> don't know how to set the XPath to designate a particular indexed entry.  For 
> example you have:
> categories = XMLSearch(xml, "/entry/category");
>
> but I need it to be something like:
> categories = XMLSearch(xml, "/entry[index]/category");
>
> Here's the actual structure:
> http://www.blogger.com/feeds/1550840680584738668/posts/default?published-min=2008-11-11T00:00:00&published-max=2008-11-25T23:59:59
>
> I'm really totally lost at this point and I'm just shooting from the hip.
>
>
>
>><cfscript>
>>       xml = XMLParse(xml);
>>       categories = XMLSearch(xml, "/entry/category");
>>       total_categories = ArrayLen(categories);
>></cfscript>
>>
>><!--- <cfdump var="#xml#">
>><cfdump var="#categories#"> --->
>><cfoutput>
>><cfloop index="currentitem" from="1" to="#total_categories#">
>>       #categories[currentitem].XMLAttributes.term#<br />
>></cfloop>
>></cfoutput>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:315902
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to