|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Pattern for attribute matching
If I want to construct a template that matches a `foo' element with a
`bar' attribute, the appropriate `match' attribute is:
match="foo[@bar]"
Moreover, if I want to match any `bar' attribute at all, the appropriate
`match' attribute is
match="@bar"
But suppose I want to match a `bar' attribute that's attached to a `foo'
element. My first guess would be
match="foo/@bar"
But that doesn't seem entirely right because attributes are not children
of element nodes, but rather associated with element nodes. So if that
isn't correct, what would be correct?
This question relates to a larger unresolved (apparently) issue in
XPath: whether attribute nodes are really part of the document tree
described by XPath, or related in some other way. Sec. 5 (Data Model)
says:
``XPath operates on a XML document as a tree. This section descripe
how XPath models an XML document as a tree.''
But in Sec. 5.3 (Attribute Nodes) it says:
``Each element node has an associated set of attribute nodes.''
So where does reality lie?
Paul Abrahams
abrahams@xxxxxxx
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








