You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xalan.apache.org by ArkBasel <ma...@gmail.com> on 2007/07/01 19:02:15 UTC
Problem in XPath with attributes
Hi,
(using latest version of xerces and xalan)
I converted a Xerces document to Xalan without any problems. I also
individually checked whether the converted Xalan document has all the
nodes and attributes and it has.
Then I wanted to do a XPath search with Xalan's select nodes. I am
able to search the tags for example "//name/address" fine but if I
search for attributes "//name[@ids='fname']" or "//name[@ids*]" for
some reason non of the XPath expressions with attributes work and
returns only NULL. Is my XPath expression is bad or am I missing
anything?
<name ids='fname'>
<address>
</address>
</name>
Thanks
-AB
RE: Problem in XPath with attributes
Posted by "Coker, Jonathan M" <jo...@boeing.com>.
Try using double quotes in your first example: @ids="fname". That has
worked for me.
Regards
-----Original Message-----
From: ArkBasel [mailto:mail2account@gmail.com]
Sent: Sunday, July 01, 2007 12:02 PM
To: xalan-c-users@xml.apache.org
Subject: Problem in XPath with attributes
Hi,
(using latest version of xerces and xalan)
I converted a Xerces document to Xalan without any problems. I also
individually checked whether the converted Xalan document has all the
nodes and attributes and it has.
Then I wanted to do a XPath search with Xalan's select nodes. I am able
to search the tags for example "//name/address" fine but if I search
for attributes "//name[@ids='fname']" or "//name[@ids*]" for some
reason non of the XPath expressions with attributes work and returns
only NULL. Is my XPath expression is bad or am I missing anything?
<name ids='fname'>
<address>
</address>
</name>
Thanks
-AB