What is Attribute Axis : attribute « XPath « XML Tutorial






The attribute axis is used to select the attribute nodes associated with an element node. 
If the context node is an element node, the location paths 

attribute::* or @* 

will each return all the attribute nodes associated with that element node. 

To select a specific attribute node named security, you write either 

attribute::security 

or 

@security 

@ is an abbreviation for the attribute axis.
If the context node is not an element node, the attribute axis returns an empty node-set.








4.6.attribute
4.6.1.What is Attribute Axis
4.6.2.Attributes can be accessed in similar way as elements
4.6.3.select="state/@joined"
4.6.4.If the element has an attribute
4.6.5.Check attribute existance
4.6.6.Check value of attribute
4.6.7.Attributes can be processed in the same way as elements
4.6.8.Select elements, which contain or do not contain the given attribute
4.6.9.includes or excludes elements if the specified attribute is present
4.6.10.for-each select="attribute::*"