[JDOM] Problème de requête XPath
Bonjour,
Je réalise une requete XPath avec les API de JDOM.
Mon problèmes et le suivant :
Lorsque je réalise une requête sur un attribut : ex :
/application/tag[@att != 'val1']
Code:
1 2 3 4 5 6
|
<application >
<tag att="val1"/> <!- tag1 -->
<tag att="val2"/> <!- tag2 -->
<tag /> <!- tag3 -->
</application> |
Je retrouve le tag2 mais pas le tag3 (rien de défini).
Je recherche une solution qui ne touche pas aux requêtes xquery mais juste au code Java .
Objectif : retour des tag 2 et 3
Code:
1 2 3
|
XPath xpath = XPath.newInstance("/application/tag[@att != 'val1']");
Object obj = xpath.selectSingleNode(monDocJDom); |
Je travaille avec JDOM 1.1 et jaxen 1.1.1.
Merci d'avance.