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.
MIAMI, FL
9642
NORCROSS, GA
Hi, I'm trying to get some XPath to work with respect to a navigation tree.
I can use Xpath to return all the child nodes within a node using
//[EMAIL PROTECTED]"3"]
However, how can I do this in reverse? How can I retrieve the node tha
A little while ago someone, sorry I forget who, had asked about
sharing links to good Xpath tutorials on the web related to
coldfusion, the question basically went unanswered. I started looking
around and noticed there weren't any that I could find. So I set out
to change that and started di
s ARE; e.g.
x = XmlSearch( xml, '/foo/bar[1]' );
y = XmlSearch( x[1], 'baz' );
The really interesting thing is that CF's XPath behaves like a cursor in
the XML object - in the example above, you could search x for "/" and
get the whole docume
Headline
>
>
>
> What would I want to do (in ColdFusion at this time) is parse this
> structure and return a subset structure such as below! In other words, I
> want to return a structure only containing "type" nodes of a certain
> value. I have tied every way I c
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 impleme
"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
"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
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
Anybody know if Xpath in CF is fully compliant with all functions,
expressions,etc... Of the spec?
I tried to use the value() function and got a not defined error. Its
certainly possible I implemented wrong, but I know how CF likes to do
partial implementations every so often ;)
Thanks
Kevin
OK so I have been able to use XMLSearch filter by attributes, however I
want to be able to filter by the actual text between tags...the funny
thing is all of my CFMX books only filter by attributes in their
examples. I know this has to be really easy, but I am not sure how to
write an XPath
I found this site to be an excellent eye opener for xPath.
http://www.zvon.org/xxl/XPathTutorial/General/examples.html
Ian
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ian Sheridan
[EMAIL PROTECTED]
http://www.savagevines.com
I shot that off to fast here is a more focused link. the site is a
little confusing.
http://www.zvon.org/xxl/XPathTutorial/Output/example1.html
On May 21, 2004, at 7:56 AM, Ian Sheridan wrote:
> I found this site to be an excellent eye opener for xPath.
>
> http://www.zvo
At 07:04 AM 5/21/2004, you wrote:
>Hi, I'm trying to get some XPath to work with respect to a navigation tree.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>I can use Xpath to return all the child nodes within a node using
&g
You might find this handy then: http://www.cfdev.com/xml/xpath/
Adam Haskell wrote:
> A little while ago someone, sorry I forget who, had asked about
> sharing links to good Xpath tutorials on the web related to
> coldfusion, the question basically went unanswered. I started looking
>
Yeah been there thats about the only thing I found anywhere :(
Adam
On Fri, 20 Aug 2004 11:53:08 -0400, Pete Freitag <[EMAIL PROTECTED]> wrote:
> You might find this handy then: http://www.cfdev.com/xml/xpath/
>
>
>
> Adam Haskell wrote:
>
> > A little while a
t; search-able, however its elements ARE; e.g.
>x = XmlSearch( xml, '/foo/bar[1]' );
>y = XmlSearch( x[1], 'baz' );
>
> The really interesting thing is that CF's XPath behaves like a cursor in
> the XML object - in the example above, you could search
>Event
>
>
> What relatively basic concept am I not getting here?
Executing an XPath expression on a XML structure with XmlSearch always
return the CFML equivalent of a DOM "NodeList". The NodeList may be empty or
contain only one node but it's still a NodeList, so
Is there a way to get a single, modified XML document/structure?
--
Ian Skinner
Web Programmer
BloodSource
Sacramento, CA
-Original Message-
From: Massimo Foti [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 20, 2003 8:48 AM
To: CF-Talk
Subject: Re: XML/XPATH
>
"Ian Skinner" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Is there a way to get a single, modified XML document/structure?
You have many options, the easier should be:
1) XSLT
2) Serialize the node in the NodeList and build a new XML document from
there
---
Ben,
The only difference is see from plain XPath, is using
(XmlChildren,XmlText,XmlAttributes).
Example
Java Programming
Ivor Horton
#odoc.Books.Book[1].Title.XmlText#
#odoc.Books.Book[1].XmlAttributes["type"]#
Here the only thing different from XPath specs, is u
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:
says "from t
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
From: Joe 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
Java Programming
Ivor Horton
#odoc.Books.Book[1].Title.XmlText#
#odoc.Bo
ssage-
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 S
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 wor
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
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
l
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,
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-
F
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
>suppor
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
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.
text here
text here
text here
I also know that the XPath expression
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
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 writin
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 do
u reported 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:
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 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
or just always been 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:
>
> >Y
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
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 bel
>Uh, "//[EMAIL PROTECTED]" and "//rule/@name" aren't
>equivalent XPATH expressions.
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
>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,
Dav
> The Xpath example you are using below is not quite what I am after. Your
> example:
>
>
The reason why i posted the above was because you were trying to use
xmlSearch, which logically means you are searching(xml*Search*) for
something.
If you are after, all the attribute val
sage-
> From: Dave 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.
>
> Y
> 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&quo
> 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
Here's an XML sample file:
Using the following Xpath and instruction:
Xpath: /addresses/address[2]
Instruction: Insert a new address element before (as a preceding-sibling)
the element selected with the above Xpath. In this case, it would read
"Insert a new addre
> Anybody know if Xpath in CF is fully compliant with all functions,
> expressions,etc... Of the spec?
>
> I tried to use the value() function and got a not defined error. Its
> certainly possible I implemented wrong, but I know how CF likes to do
> partial implementations every
On Tue, 2004-02-10 at 07:50, Massimo Foti wrote:
> > Anybody know if Xpath in CF is fully compliant with all functions,
> > expressions,etc... Of the spec?
> >
> > I tried to use the value() function and got a not defined error. Its
> > certainly possible I implem
--
Webmaster - HealthObjects
[EMAIL PROTECTED]
-Original Message-
From: Rob Rohan [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 10, 2004 11:30 AM
To: CF-Talk
Subject: Re: Xpath expressions compliance
On Tue, 2004-02-10 at 07:50, Massimo Foti wrote:
> > Anybody know if Xpath
This should work:
/catalog/course/subject[text()='DS']
Even better, you could trim the text before comparing it:
/catalog/course/subject[normalize-space(text())='DS']
You can find an excellent tutorial here:
http://www.w3schools.com/xpath/default.asp
A great book:
ht
shkin
Russian
Plato
Greek
I'm trying to fetch an element using XPath and then delete that element from
the XML Object. The code below works, but I don't think it should. Here's
the code:
file="#GetDirectoryFromPath(GetBaseTemplatePath())#simple.xml"
variable="
I'm trying to get all of the "item" elements in the XML doc pasted below
using the following Xpath query but the returned array is empty.
Surley this Xpath statement should get all the item elements as well??
http://www.w3.org/1999/02/22-rdf-syntax-ns#";
xm
Does anyone know how to combine expressions in xmlSearch()? I'm trying
to select all nodes except where a certain attribute matches a value
that I specify. I'm trying this:
xmlSearch( xmlObject, '(/employees/employee) and not
(/employees/[EMAIL PROTECTED]"inactive"])' )
but I get the error:
Can
does anyone know of a visual xpath navigator?
or if there is one in the works...
tony weeg
uncertified advanced cold fusion developer
tony at navtrak dot net
www.navtrak.net
office 410.548.2337
fax 410.860.2337
~|
Archives: http
y, March 12, 2003 12:54 pm
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 l
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
>
Paul: Try this instead...
--
Roger Benningfield
work: http://journurl.com/
blog: http://admin.mxblogspace.journurl.com/
~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net
Messa
> I'm trying to get all of the "item" elements in the XML doc pasted below
> using the following Xpath query but the returned array is empty.
Namespaces without prefixes can be tricky to handle with XPath 1.0...
This should do the job:
Massim
Excellent thanks!
-Original Message-
From: Roger Benningfield [mailto:[EMAIL PROTECTED]
Sent: Monday, 8 November 2004 18:32
To: CF-Talk
Subject: Re: XPATH and RDF XML
>
Paul: Try this instead...
--
Roger Benningfield
work: http://journurl.com/
blog: h
Quick apology, I meant "compound" not "compount"!
On 4/18/05, Brian Kotek <[EMAIL PROTECTED]> wrote:
> Does anyone know how to combine expressions in xmlSearch()? I'm trying
> to select all nodes except where a certain attribute matches a value
> that I specify. I'm trying this:
>
> xmlSearch( xm
That'll return a boolean value (exp1 AND NOT exp2), which isn't what you want.
/employees/[EMAIL PROTECTED] != 'inactive']
should get you what you want.
cheers,
barneyb
On 4/18/05, Brian Kotek <[EMAIL PROTECTED]> wrote:
> Does anyone know how to combine expressions in xmlSearch()? I'm trying
Thanks Barney, I arrived at a similar solution that seems to work:
xmlSearch( local.circuitXML, '/employees/employee[not(@status="inactive")]' )
and just for future info for anyone who stumbles on this thread, you
can specify multiple values to exclude like this:
xmlSearch( local.circuitXML,
'/e
"Tony Weeg" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> does anyone know of a visual xpath navigator?
> or if there is one in the works...
I am not sure what you are looking for, but I've fund this tool very handy
for visually testing XPath expressi
"Tony Weeg" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> does anyone know of a visual xpath navigator?
> or if there is one in the works...
I am not sure what you are looking for, but I've fund this tool very handy
for visually testing XPath expressi
0.860.2337
-Original Message-
From: Massimo Foti (on holiday) [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 16, 2003 10:46 AM
To: CF-Talk
Subject: Re: ot- visual Xpath Navigator
"Tony Weeg" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> does anyone know of a vi
EMAIL PROTECTED]
TW> Sent: Wednesday, July 16, 2003 10:46 AM
TW> To: CF-Talk
TW> Subject: Re: ot- visual Xpath Navigator
TW> "Tony Weeg" <[EMAIL PROTECTED]> wrote in message
TW> news:[EMAIL PROTECTED]
>> does anyone know of a visual xpath navigator?
>> or i
> does anyone know of a visual xpath navigator?
It's not exactly a "navigator", but it's pretty neat and useful, I think:
http://www.vbxml.com/xpathvisualizer/
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5
Cant figure this one out OR is it possible in CF xml Notation.
XML..
Java Programming
Ivor Horton
Ivor Horton
Here is what i want to return using XPath...All the "Author" for node
Element "Book"
What is the CF Equivalent to the ab
On Tuesday, Jun 24, 2003, at 20:04 US/Pacific, Joe Eugene wrote:
> Cant figure this one out OR is it possible in CF xml Notation.
>
> XML..
>
>
> Java Programming
> Ivor Horton
> Ivor Horton
>
>
> Here is what i want to return u
orfield" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, June 24, 2003 11:38 PM
Subject: Re: xml XPath Equivalent in CF Notation
> On Tuesday, Jun 24, 2003, at 20:04 US/Pacific, Joe Eugene wrote:
> > Cant figure this one out OR is it possib
or']");
> 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 ob
> 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 X
On Wednesday, Jun 25, 2003, at 18:25 US/Pacific, Joe Eugene wrote:
> Another xml XPath "?"
> How do i just return ""
> via
> xmlSearch()
Since you get back an array of XML sub-objects, you'll always get the
tag with
all its contents - you could just ignor
> >
> >
> >
> >
>
> Shouldn't this be:
>
>
>
>
>
Yes.. Just a typo.
But really.. isnt this valid for Dom/XSLT/XPath?
xmlSearch(odoc, "Books/[EMAIL PROTECTED]'Reference Book']/Book")
Wh
> But really.. isnt this valid for Dom/XSLT/XPath?
> xmlSearch(odoc, "Books/[EMAIL PROTECTED]'Reference Book']/Book")
>
> Which should only return.
>
I would suggest to test you XPath expression with this handy (free) tool:
http://www.vb
I have a XML file that looks like this
(actually fusebox.xml file from FB4, for those who are familiar)
..
.
.
I need to get a list of all the attribute values for "name" into an array. Right now, I'm using the xpath _expression_ "/circuit/[EMAIL PROTECTED]", to
as an answer.
http://www.dpawson.co.uk/xsl/sect2/sect21.html
-Original Message-
From: Nikhil Madani [mailto:[EMAIL PROTECTED]
Sent: Monday, January 05, 2004 1:39 PM
To: CF-Talk
Subject: XPath expr to get all attributeshow?
I have a XML file that looks like this
(actually fusebox.xml file
age-
> From: Nikhil Madani [mailto:[EMAIL PROTECTED]
> Sent: Monday, January 05, 2004 1:39 PM
> To: CF-Talk
> Subject: XPath expr to get all attributeshow?
>
> I have a XML file that looks like this
> (actually fusebox.xml file from FB4, for those who are familiar)
>
&
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://www.houseoffusion.com/cf_lists/index.cfm?m
"Paul Wilson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
>
>
>
>
>
>
>
> 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 h
83 matches
Mail list logo