Edwin,

        I do this kind of stuff all the time and it works.
As a matter of fact I exclusively use subelement selections
instead of attributes because I read somewhere, who knows
where, that it is faster (can anyone confirm this?).

Soo...can you post your java method, maybe I can try
running it over here?

It should work!

-jason

-----Original Message-----
From: Bulter, Edwin [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 01, 2002 4:19 AM
To: '[EMAIL PROTECTED]'
Subject: [dom4j-user] XPATH expression problem: Am I trying to use an
unimplemented feature?


I am using the xpath-syntax for filtering an XML-document and pass the
result through.
To filter the nodes I use the method "public List selectNodes(String
xpathExpression)" on my document.

Example : 
<AAA>
        <BBB A="1">
                <C>a</C>
        </BBB>
        <BBB A="2">
                <C>b</C>
        </BBB>
        <BBB A="3">
                <C>c</C>
        </BBB>
</AAA>  

Selecting an element on attribute-values works fine, i.e.: 
expression: 
         /AAA/BBB[@A='2']
result: 
        <BBB A="2">
                <C>b</C>
        </BBB>

Selecting an element on the element-text of an inner-element is a problem,
i.e.: 
expression:
         /AAA/BBB[C='b']
result:
        <BBB A="1">
                <C>a</C>
        </BBB>
        <BBB A="2">
                <C>b</C>
        </BBB>
        <BBB A="3">
                <C>c</C>
        </BBB>

In this last case I would expect only the second BBB-element as the result.

I used xpath-expressions like this before in XSL-documents which worked
fine.
Why doesn't it with DOM4J?

Regards,

Edwin

**********Internet Email Confidentiality Footer********** 
Privileged/Confidential Information may be contained in this message.  If
you are not the addressee indicated in this message (or responsible for
delivery of the message to such person), you may not copy or deliver this
message to anyone. In such case, you should destroy this message and kindly
notify the sender by reply email. Please advise immediately if you or your
employer do not consent to Internet email for messages of this kind.
Opinions, conclusions and other information in this message that do not
relate to the official business of my firm shall be understood as neither
given nor endorsed by it.


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to