Re: xml XPath Equivalent in CF Notation

2003-06-25 Thread Sean A Corfield
.. 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

RE: xml XPath Equivalent in CF Notation

2003-06-25 Thread Joe Eugene
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

Re: xml XPath Equivalent in CF Notation

2003-06-25 Thread Sean A Corfield
On Wednesday, Jun 25, 2003, at 18:25 US/Pacific, Joe Eugene wrote: Another xml XPath ? How do i just return Book type=Reference Book publication= / via xmlSearch() Since you get back an array of XML sub-objects, you'll always get the Book ... tag with all its contents - you could just

RE: xml XPath Equivalent in CF Notation

2003-06-25 Thread Joe Eugene
Books Book type=Reference Book publication= / Author firstName= lastName= / /Book Shouldn't this be: Books Book type=Reference Book publication= Author firstName= lastName= / /Book Yes.. Just a typo. But really.. isnt this valid for Dom/XSLT/XPath? xmlSearch

Re: xml XPath Equivalent in CF Notation

2003-06-25 Thread Massimo, Tiziana e Federica
But really.. isnt this valid for Dom/XSLT/XPath? xmlSearch(odoc, Books/[EMAIL PROTECTED]'Reference Book']/Book) Which should only return. Book type=Reference Book publication= / I would suggest to test you XPath expression with this handy (free) tool: http://www.vbxml.com/xpathvisualizer

xml XPath Equivalent in CF Notation

2003-06-24 Thread Joe Eugene
Cant figure this one out OR is it possible in CF xml Notation. XML.. Books Book type=Reference Book TitleJava Programming/Title AuthorIvor Horton/Author AuthorIvor Horton/Author /Book /Books Here is what i want to return using XPath...All the Author for node

Re: xml XPath Equivalent in CF Notation

2003-06-24 Thread Sean A Corfield
Here is what i want to return using XPath...All the Author for node Element Book cfdump var=#xmlSearch(odoc, Books/Book[1]/Author)# What is the CF Equivalent to the above in CFMX Notation odoc.xmlRoot.Book[1]...? You can get to the elements of Book but that will be an array (I think

xpath sum

2003-06-17 Thread jon hall
I've get an xml packet that returns qty available per warehouse, and I want to add up all of the qty's and return a total, but I am getting a crash when I try and use the sum in the xpath statement. The xml looks like this. LineInfo WhseInfo IDCodeMIAMI, FL/IDCode Qty9642/Qty

Re: xpath sum

2003-06-17 Thread Massimo Foti
jon hall [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] This is the error I get. Can not convert #NUMBER to a NodeList! Unfortunately xmlSearch() only accept XPath expressions that return a NodeList, it throws an error in case the expression returns a string or a number. It's

Re: xpath sum

2003-06-17 Thread Massimo, Tiziana e Federica
jon hall [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] This is the error I get. Can not convert #NUMBER to a NodeList! Unfortunately xmlSearch() only accept XPath expressions that return a NodeList, it throws an error in case the expression returns a string or a number. It's

Re: xpath sum

2003-06-17 Thread jon hall
Tuesday, June 17, 2003, 3:21:00 PM, you wrote: MF jon hall [EMAIL PROTECTED] wrote in message MF news:[EMAIL PROTECTED] This is the error I get. Can not convert #NUMBER to a NodeList! MF Unfortunately xmlSearch() only accept XPath expressions that return a MF NodeList, it throws an error

get path to root for any node using Xpath

2003-06-09 Thread Paul Wilson
node and get it's absolute path. i.e. \root\car\tyres. Can you use Axes with CFMX http://www.w3.org/TR/xpath#axes Thanks ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http

Re: get path to root for any node using Xpath

2003-06-09 Thread Massimo Foti
Paul Wilson [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] root car engine/ tyres/ gears/ /car /root I want to know all of the parents/ancestors of the tyres node and get it's absolute path. i.e. \root\car\tyres. Can you use Axes with CFMX http://www.w3.org/TR/xpath#axes

RE: XPath in CFMX

2003-03-12 Thread Mueller, Ben
I don't know what parser CFMX uses, though since I know nothing about the details of parsers, if I did know the name of the parser they are using, that wouldn't help me one iota (-; The Xpath example you are using below is not quite what I am after. Your example: cfset xRes=xmlSearch(odoc

RE: XPath in CFMX

2003-03-12 Thread Reilly, James
CFMX uses: Apache Crimson parser for server side xml parsing Xalam Parser for XSLT. Tkx, Jim -Original Message- From: Mueller, Ben [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 8:46 AM To: CF-Talk Subject: RE: XPath in CFMX I don't know what parser CFMX uses, though since

RE: XPath in CFMX

2003-03-12 Thread James Alexander
Eugene [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 11, 2003 11:13 PM To: CF-Talk Ben, The only difference is see from plain XPath, is using (XmlChildren,XmlText,XmlAttributes). Example ?xml version=1.0 encoding=UTF-8? Books Book type=Reference Book TitleJava Programming/Title AuthorIvor

RE: XPath in CFMX

2003-03-12 Thread Mueller, Ben
- From: James Alexander [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 8:32 AM To: CF-Talk Subject: RE: XPath in CFMX MX uses a DOM parser. SAX parsers by their very nature are event driven, and well, CF isn't an event driven language. There is however a handful of Java SAX parsers

Re: XPath in CFMX

2003-03-12 Thread Kwang Suh
If you're not using the MSXML parser in IE6, then the xpath stuff you're writing may not be w3c standard. MS came out with an implementation of xpath (and xsl in general) that followed the beta standards in IE5/5.5, which is different than the released standard. I can check at work once I'm

RE: XPath in CFMX

2003-03-12 Thread Alexander Sherwood
At 07:45 AM 3/12/2003 -0600, you wrote: I don't know what parser CFMX uses, though since I know nothing about the details of parsers, if I did know the name of the parser they are using, that wouldn't help me one iota (-; The Xpath example you are using below is not quite what I am after

RE: XPath in CFMX

2003-03-12 Thread Mueller, Ben
Yes, that is exactly what I want. It would appear (at least from Microsoft's website) that this is legal Xpath syntax. A previous poster suggested that this may have been an extension MS made that falls outside the w3c spec. At this point, I'd be happy with confirmation that a call like Books

Re: XPath in CFMX

2003-03-12 Thread Jochem van Dieten
Mueller, Ben wrote: Yes, that is exactly what I want. It would appear (at least from Microsoft's website) that this is legal Xpath syntax. A previous poster suggested that this may have been an extension MS made that falls outside the w3c spec. At this point, I'd be happy with confirmation

RE: XPath in CFMX

2003-03-12 Thread Mueller, Ben
That's sort of what I was afraid of. If it's legal XPath syntax, then why doesn't the XmlSearch function support it? Is it a weakness in MX, or is this a deliberate omission? And does anybody know if MM has plans to support this in the future? -Original Message- From: Jochem van

RE: XPath in CFMX

2003-03-12 Thread Alexander Sherwood
At 11:19 AM 3/12/2003 -0600, you wrote: That's sort of what I was afraid of. If it's legal XPath syntax, then why doesn't the XmlSearch function support it? Is it a weakness in MX, or is this a deliberate omission? And does anybody know if MM has plans to support this in the future? Well, i

RE: XPath in CFMX

2003-03-12 Thread Mueller, Ben
The problem is not that MACR returns an array rather than a string in this particular XPath case. The problem is that, in the case where I'm trying to get the value of an attribute, it returns an array of length one that appears to have nothing in it. If you run this code in MX: cfxml variable

Re: RE: XPath in CFMX

2003-03-12 Thread ksuh
Subject: RE: XPath in CFMX The problem is not that MACR returns an array rather than a string in this particular XPath case. The problem is that, in the case where I'm trying to get the value of an attribute, it returns an array of length one that appears to have nothing in it. If you run

RE: XPath in CFMX

2003-03-12 Thread Dan G. Switzer, II
Seems like it is a bug. In following example, the first XPath statement works as expected, the second finds 2 matches, but returns empty arrays. cfxml variable=sampleXML rules rule name=firstRule subelement name=myAttributetext here/subelement /rule rule

RE: XPath in CFMX

2003-03-12 Thread Mueller, Ben
This is exactly the behavior I get--or don't get. (-; So...off to the bug reporting portion of MM's website. -Original Message- From: Dan G. Switzer, II [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 2:34 PM To: CF-Talk Subject: RE: XPath in CFMX Seems like it is a bug

RE: XPath in CFMX

2003-03-12 Thread Dan G. Switzer, II
Oh yeah, to workaround the bug, you could write a UDF that you'd run before passing the xmlSearch() function that would format it via an XPath statement CF likes: So, you'd look for strings ending in: /@attName and replace with [EMAIL PROTECTED] You might also just consider writing your own

RE: XPath in CFMX

2003-03-12 Thread Mueller, Ben
Yeah, we've already considered option 1, and we may in fact do that. We also may end up re-designing our XML structure at some point down the road, which could obviate the need for this particular Xpath call. But, those points aside, it's still mucho annoying that this doesn't work

RE: XPath in CFMX

2003-03-12 Thread Dan G. Switzer, II
this issue to MM. I'd definitely consider it a bug--since it is valid XPath syntax and it's obvious that it's finding the nodes, it's just not returning the correct data. -Dan -Original Message- From: Mueller, Ben [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 3:43 PM To: CF

RE: XPath in CFMX

2003-03-12 Thread Alexander Sherwood
At 02:43 PM 3/12/2003 -0600, you wrote: Yeah, we've already considered option 1, and we may in fact do that. We also may end up re-designing our XML structure at some point down the road, which could obviate the need for this particular Xpath call. But, those points aside, it's still mucho

RE: XPath in CFMX

2003-03-12 Thread Mueller, Ben
It has been reported to MM. Now we wait... -Original Message- From: Dan G. Switzer, II [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 3:11 PM To: CF-Talk Subject: RE: XPath in CFMX I'd almost recommend option 2--because it opens the door a little more. If you choose to use

RE: XPath in CFMX

2003-03-12 Thread Barney Boisvert
overshadowed by Xerces. -Original Message- From: Alexander Sherwood [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 1:04 PM To: CF-Talk Subject: RE: XPath in CFMX At 02:43 PM 3/12/2003 -0600, you wrote: Yeah, we've already considered option 1, and we may in fact do

RE: XPath in CFMX

2003-03-12 Thread I-Lin Kuo
Uh, //[EMAIL PROTECTED] and //rule/@name aren't equivalent XPATH expressions. The first is all element rule nodes which have a name attribute while the second is all name attribute nodes belonging to a rule element node Running this with your example gives: rule name=firstRule subelement name

RE: XPath in CFMX

2003-03-12 Thread Alexander Sherwood
At 01:42 PM 3/12/2003 -0800, you wrote: Uh, //[EMAIL PROTECTED] and //rule/@name aren't equivalent XPATH expressions. The first is all element rule nodes which have a name attribute while the second is all name attribute nodes belonging to a rule element node Running this with your example gives

Re: RE: XPath in CFMX

2003-03-12 Thread ksuh
Crimson looks like it's been killed. Xerces is a parser. Xalan is a transformation engine. - Original Message - From: Barney Boisvert [EMAIL PROTECTED] Date: Wednesday, March 12, 2003 2:41 pm Subject: RE: XPath in CFMX I'd use one of the packages from Apache, depending on your

RE: XPath in CFMX

2003-03-12 Thread Mueller, Ben
Uh, //[EMAIL PROTECTED] and //rule/@name aren't equivalent XPATH expressions. snip Understood. But I think the previous poster was suggesting that, as a workaround for this problem, you could, using something like a regular expression replace, change the second Xpath call into the first call

RE: XPath in CFMX

2003-03-12 Thread Dave Carabetta
Crimson looks like it's been killed. Xerces is a parser. Xalan is a transformation engine. Yes, Crimson was rolled into Xerces 2 in the late fall some time. It is a hibernated project right now, which is to say that it's no longer being actively developed. Look into Xerces 2. Regards, Dave.

RE: XPath in CFMX

2003-03-12 Thread Joe Eugene
The Xpath example you are using below is not quite what I am after. Your example: cfset xRes=xmlSearch(odoc, /Books/[EMAIL PROTECTED]'Reference Book']) The reason why i posted the above was because you were trying to use xmlSearch, which logically means you are searching(xml*Search

RE: XPath in CFMX

2003-03-12 Thread Joe Eugene
Carabetta [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 5:26 PM To: CF-Talk Subject: RE: XPath in CFMX Crimson looks like it's been killed. Xerces is a parser. Xalan is a transformation engine. Yes, Crimson was rolled into Xerces 2 in the late fall some time

RE: XPath in CFMX

2003-03-12 Thread Dan G. Switzer, II
Uh, //[EMAIL PROTECTED] and //rule/@name aren't equivalent XPATH expressions. The first is all element rule nodes which have a name attribute while the second is all name attribute nodes belonging to a rule element node You are correct, but the problem stems more from the way Macromedia

RE: XPath in CFMX

2003-03-12 Thread I-Lin Kuo
Are you suggesting that the value I'm after is somewhere in the returned object, but cfdump doesn't know how to handle it, or that XmlSearch isn't returning it at all. If it's the former, then I'd love to know how to access that information. I haven't worked with xml inside of CFMX to

XPath in CFMX

2003-03-11 Thread Mueller, Ben
My company is in the process of moving over to MX, and I have been tasked with upgrading our XML handling custom tags to MX compliance. I have discovered what appears to be a bug in the way MX handles Xpath, and if it isn't a bug, then it's a deviation away from the standard implementation

RE: XPath in CFMX

2003-03-11 Thread Joe Eugene
Ben, The only difference is see from plain XPath, is using (XmlChildren,XmlText,XmlAttributes). Example ?xml version=1.0 encoding=UTF-8? Books Book type=Reference Book TitleJava Programming/Title AuthorIvor Horton/Author /Book /Books cfset odoc=xmlParse(books) cfoutput

<    1   2