Question Xsl / Xpath

Question Xsl / Xpath - XML/XSL - Programmation

Marsh Posté le 27-04-2008 à 14:41:14    

Bonjour,
 
Si j'ai un XML par exemple
 
<a>
     <b>
          <e>
             <c>blabla</c>
          </e>
          <d>contenu</d>
     </b>
     <b>
          <e>
             <c>ok</c>
          </e>
          <d>contenu</d>
     </b>
     <b>
          <e>
             <c>blabla</c>
          </e>
          <d>contenu</d>
     </b>
     <b>
          <e>
              <c>blabla</c>
          </e>
          <d>contenu</d>
     </b>
     <b>
          <e>
             <c>blabla</c>
          </e>
          <d>contenu</d>
     </b>
     <b>
          <e>
             <c>ok</c>
          </e>
          <d>contenu</d>
     </b>
</a>
 
 
Je récupère une list de noeud.
Quel Xpath devrais-je écrire pour récupérer tous les <b>(et leurs enfants) dont le <c> contient "ok" ?
 
Je débute en Xpath
J'ai déjà essayé entre autres
/a/b/*[e/c='ok']
/a/b/*[e/c/text()='ok']
 
 
Merci
 
 
 
 

Reply

Marsh Posté le 27-04-2008 à 14:41:14   

Reply

Marsh Posté le 27-04-2008 à 16:12:58    

un truc du style

//b[//c/text() = 'ok']


---------------
I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box by throwing away the limits imposed by overbearing genetic regulations? Isn't that a good thing?
Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed