!
Thanks!
Lori-
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of ryanm
Sent: Tuesday, August 01, 2006 2:42 PM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] XPathAPI problems with wildcard searches
r = XPathAPI.selectNodeList(x,/*/item
I've been having problems with the xpathapi. I've been trying to do a
wildcard search and according to all the documentation it's supported
yet even simple straight forward search isn't working. Can anyone help?
Example :
code
import mx.xpath.XPathAPI;
x = new XML(test thing='boo'items
r = XPathAPI.selectNodeList(x,/*/item);
The problem is that / and * are both node operators and math operators,
so your statement is ambiguous. The obvious answer, based on your example
XML, is to use ./items/item, but I don't know if your real XML is more
complex or not. If it is, you
-
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of ryanm
Sent: Tuesday, August 01, 2006 2:42 PM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] XPathAPI problems with wildcard searches
r = XPathAPI.selectNodeList(x,/*/item);
The problem
x = new XML(test thing='boo'items name='blah'item
foo='bar'/item foo='blah'//items/test);
r = XPathAPI.selectNodeList(x,/*/item);
If I understand correctly, that search would not find anything, because item
is not a child of test, but rather of items. If I'm reading your XPath
expression
The reason I am trying to do the wildcard search is because I have nodes
of the same name at different levels and I need them all. So giving a
specific path wouldn't give me all of the nodes I need.
That's not what your select says, the * wildcard only selectes children.
/*/item = select
6 matches
Mail list logo