« Programmation XML/XPath » : différence entre les versions

Contenu supprimé Contenu ajouté
Ligne 56 :
 
== Tests de nœuds ==
Soit l'[[../Espace de nom/|espace de nom]] <code>ns</code> :
Soit l'espace de nom <code>gs</code>, <code>//gs:enquiry</code> will find all the <code>enquiry</code> elements in that namespace, and <code>//gs:*</code> will find all elements, regardless of local name, in that namespace.
* <code>//ns:*</code> sélectionne tout les éléments du namespace.
 
* <code>//ns:nom</code> récupère tous les éléments du namespace nommés "nom".
Other node test formats are:
;comment() :finds an XML comment node, e.g. <code><nowiki><!-- Comment --></nowiki></code>
;text() :finds a node of type text, e.g. the <code>hello</code> in <code><k>hello<m> all</m></k></code>
;processing-instruction() :finds XML [[processing instruction]]s such as <code><?php echo $a; ?></code>. In this case, <code>processing-instruction('php')</code> would match.
;node() :finds any node at all.
 
{|class="wikitable"
! Tests !! Notes
|-
;| comment() :|| finds an XML comment node, e.g. <code><nowiki><!-- Comment --></nowiki></code>
|-
;| text() :|| finds a node of type text, e.g. the <code>hello</code> in <code><k>hello<m> all</m></k></code>
|-
;| processing-instruction() :|| finds XML [[processing instruction]]s such as <code><?php echo $a; ?></code>. In this case, <code>processing-instruction('php')</code> would match.
|-
;| node() :|| finds any node at all.
|}
 
== Prédicats ==