> The result of xmlSearch() is an array, not an XML doc.
Figured this one out while i was trying the code..
> As I said in my previous response:
XPath method works fine without having to loop through all the elements.
I think it would be OK, to work with an Array of Sub-Sets of Larger XML Doc.
Another xml XPath "?"
How do i just return "<Book type="Reference Book" publication="" />" via
xmlSearch()
<Books>
<Book type="Reference Book" publication="" />
<Author firstName="" lastName="" />
</Book>
xmlSearch(odoc, "Books/[EMAIL PROTECTED]'Reference Book']") returns all the items
under Book[1].
Thanks,
Joe Eugene
> -----Original Message-----
> From: Sean A Corfield [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, June 25, 2003 11:39 AM
> To: CF-Talk
> Subject: Re: xml XPath Equivalent in CF Notation
>
>
> On Wednesday, Jun 25, 2003, at 08:07 US/Pacific, Joe Eugene wrote:
> > xmlFirstSearch = xmlSearch(odoc, "Books/[EMAIL PROTECTED]'Reference Book']");
> > Now i want to search the Result of the the First Search..
> > xmlSecondSearch = xmlSearch(xmlFirstSearch, "Book/Author']");
> > The above doesnt seem to work.. because xmlFirstSearch is NOT a valid
> > XML
> > DOC...
>
> The docs say:
>
> "Description
> Uses an XPath language expression to search an XML document that is
> represented as a string variable.
> Return value
> An array of XML object nodes that match the search criteria."
>
> The result of xmlSearch() is an array, not an XML doc.
>
> > Is there work around this Other than Searching the Orginal DOC again.
>
> As I said in my previous response:
> > ----- Original Message -----
> > From: "Sean A Corfield" <[EMAIL PROTECTED]>
> > Sent: Tuesday, June 24, 2003 11:38 PM
> >>
> >> You can get to the elements of <Book> but that will be an array (I
> >> think) and you'll have to manually iterate through each element to see
> >> whether it is <Author> or not.
>
> Sean A Corfield -- http://www.corfield.org/blog/
>
> "If you're not annoying somebody, you're not really alive."
> -- Margaret Atwood
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Host with the leader in ColdFusion hosting.
Voted #1 ColdFusion host by CF Developers.
Offering shared and dedicated hosting options.
www.cfxhosting.com/default.cfm?redirect=10481
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4