[XPath] Problème d'expression avec current()
Bonjour,
Voila j'ai un petit problème d'expression Xpath qui va surement vous titillez comme moi:
Mon expression Xpath qui ne marche pas:
Code:
1 2 3 4
|
/HRG/Pos/Item
[not(. = document('toto.xml')/ExtractList/Extract/Firma/descendant-or-
self::node()/Bez[@Ein = current()/../../Eintrag]/@fldType)] |
mon xml de base:
Code:
1 2 3 4 5 6 7 8 9 10 11 12
|
<HRG>
<choix/>
<wahl/>
<Eintrag>7</Eintrag>
<Pos>
<Item>FirmaBemerkung</Item>
<Item>FirmaLoeschung</Item>
<Item>SitzVerlegung</Item>
<Item>DivBezeichnung</Item>
</Pos>
</HRG> |
toto.xml:
Code:
1 2 3 4 5 6 7 8 9 10 11 12
| <ExtractList>
<Extract>
<Firma>
<Bez Ein="1" fldType="Hauptfassung">Nimbo Trading AG</Bez>
<Bez Ein="2" fldType="FirmaBemerkung">Nimbo Holding AG</Bez>
<Bez Ein="2" fldType="Uebersetzung">(Nimbo Holding Ltd)</Bez>
<Bez Ein="5" fldType="FirmaLoeschung">A 1 Gemini Medien AG</Bez>
<Bez Ein="7" fldType="FirmaLoeschung">Sternberg AG</Bez>
<Bez Ein="10" fldType="Hauptfassung">Sterntaler AG</Bez>
</Firma>
</Extract>
</ExtractList> |
Donc j'aimerais avec cette expression séléctionner tout <Item> qui n'ont pas de correspondance dans Bez avec un @Ein qui correspond à l'élément Eintrag du premier xml. Dans ce cas la FirmaLoeschung ne doit pas ressortir.
Mon problème vient surement du current() car il doit matché dans toto.xml au lieu de mon xml de base comme je le voudrais. Car si je met a la place un chiffre sa marche nickel!
Avez-vous une idée pour éviter se problème? Ou ce n'est pas trop possible?
Merci
Thierry