English | česky | Nederlands | Français | Español | По русски | >> Deutsch << ZVON > Tutorials > XPath Tutorial
>> Beispiel 5 << | Vorheriges | Nächstes

Attribute werden mittels eines @ Präfixes spezifiziert.
 
//@id
Wähle alle "id" Attribute aus

     <AAA>
          <BBB id = "b1"/>
          <BBB id = "b2"/>
          <BBB name = "bbb"/>
          <BBB/>
     </AAA>
Öffne das Beispiel in XLab. | Baumansicht (JPG)
 
//BBB[@id]
Wähle jene BBB Elemente aus, die ein Attribut "id" haben

     <AAA>
          <BBB id = "b1"/>
          <BBB id = "b2"/>
          <BBB name = "bbb"/>
          <BBB/>
     </AAA>
Öffne das Beispiel in XLab. | Baumansicht (JPG)
 
//BBB[@name]
Wähle jene BBB Elemente aus, die das Attribut "name" enthalten

     <AAA>
          <BBB id = "b1"/>
          <BBB id = "b2"/>
          <BBB name = "bbb"/>
          <BBB/>
     </AAA>
Öffne das Beispiel in XLab. | Baumansicht (JPG)
 
//BBB[@*]
Wähle jene BBB Elemente aus, die ein beliebiges Attribut haben

     <AAA>
          <BBB id = "b1"/>
          <BBB id = "b2"/>
          <BBB name = "bbb"/>
          <BBB/>
     </AAA>
Öffne das Beispiel in XLab. | Baumansicht (JPG)
 
//BBB[not(@*)]
Wähle jene BBB Elemente aus, die kein Attribut haben

     <AAA>
          <BBB id = "b1"/>
          <BBB id = "b2"/>
          <BBB name = "bbb"/>
          <BBB/>
     </AAA>
Öffne das Beispiel in XLab. | Baumansicht (JPG)



_____________________________________________
Reference Search | Sitemap | XML Glossary       ZVON | Systinet