by Eric van der Vlist is published by O'Reilly & Associates (ISBN: 0596004214)


Name

attribute — Pattern matching an attribute

Synopsis

"attribute" 
nameClass "{" 
pattern "}"

Restrictions

pattern

May be included in

(pattern), attribute, datatypeName param exceptPattern, element, list, mixed, pattern&pattern, pattern*, pattern+, pattern,pattern, pattern?, pattern|pattern

XML syntax equivalent

attribute

Description

The attribute pattern matches an attribute. The name of the attribute is defined using a nameClass, which may be either a single name or a name class. Note that, unlike the XML syntax, the content of an attribute doesn't default to text and must always be explicitly defined.

Restrictions

  • After simplification, attribute patterns can contain only patterns relevant for text nodes.

  • Attributes can't be duplicated, either directly or by overlapping name classes.

  • Attributes that have an infinite name class (anyName or nsName) must be enclosed in a oneOrMore pattern (or zeroOrMore before simplification).

Example

attribute available { text }
attribute xml:lang { xsd:language }
attribute * - (local:* | lib:* | hr:*) { text }

This text is released under the Free Software Foundation GFDL.