Hi

I've got a document that contains translated phrases

<?xml version="1.0" encoding="UTF-8"?>

<TranslationVerification>
  <keyword>
    <originalPhrase src-lang="en">never</originalPhrase>
    <trans-equiv src-lang="fr">ne</trans-equiv>
    <trans-equiv src-lang="fr">rien</trans-equiv>
    <trans-equiv src-lang="fr">chat</trans-equiv>
    <trans-equiv src-lang="fr">chaud</trans-equiv>
  </keyword>
  <keyword>
    <originalPhrase src-lang="en">not</originalPhrase>
    <trans-equiv src-lang="fr">ne</trans-equiv>
    <trans-equiv src-lang="fr">rien</trans-equiv>
    <trans-equiv src-lang="fr">chat</trans-equiv>
    <trans-equiv src-lang="fr">chaud</trans-equiv>
  </keyword>
 </TranslationVerification>

(The data is obviously nonsense)

I want to find all the phrases in french that match the english word not
(Imagine that this dictionary contains other languages as well
eg <trans-equiv src-lang="ger">nicht</trans-equiv>

The XPath pattern that should get me all the text nodes for an
english -french translation of
'not' should be (I think) //originalPhrase[@src-lang='en and
text()='not']/trans-equiv[@src-lang="fr"]/text()

If I run this query on the document above I get nothing back from
selectNodes()

If I run //originalPhrase[@src-lang='en and text()='not']/text()
I get what I expect - the english not node.

If I add /* - //originalPhrase[@src-lang='en and text()='not']/*
I get nothing at all even though there are clearly nodes below this
position.

Is there a mistake in my syntax or does Jaxen not support XPath quite as I
expect it to?

Thanks

Nick






_______________________________________________________________

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: [EMAIL PROTECTED]
_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to