Eduardo
Eduardo

Reputation: 5933

What does the xpath expression "@*" mean?

Microsoft's XSLT template on Visual Studio has something like:

<xsl:template match="@* | node()">

What is @*?

Upvotes: 4

Views: 2208

Answers (3)

Wayne
Wayne

Reputation: 60414

@* is short for attribute::* and selects all attributes of the context node (or, in an XSLT match pattern, it's more appropriate to say that it matches all attributes). From the XPath spec:

There is also an abbreviation for attributes: attribute:: can be abbreviated to @. For example, a location path para[@type="warning"] is short for child::para[attribute::type="warning"] and so selects para children with a type attribute with value equal to warning.

Upvotes: 8

Oded
Oded

Reputation: 499002

From MSDN - XPath Examples:

@* | All attributes of the current element context.

Upvotes: 1

Daniel Haley
Daniel Haley

Reputation: 52858

That means match any attribute.

http://www.w3.org/TR/1999/REC-xpath-19991116/#path-abbrev

Upvotes: 2

Related Questions