RE: Pattern for attribute matching

Subject: RE: Pattern for attribute matching
From: shalperin@xxxxxxxxxxxx (Shalperin)
Date: Fri, 30 Jul 1999 15:16:43 -0700
The first match finds foo elements that have a bar attribute.
The third match finds children of foo elements that have a bar attribute.

        -s

> -----Original Message-----
> From: "Ed Nixon" <ed.nixon@xxxxxxxxxxxxxxxxx> 
> Sent: Friday, July 30, 1999 5:33 PM
> To: <xsl-list@xxxxxxxxxxxxxxxx>
> Subject: RE: Pattern for attribute matching
> 
> 
> Can you explain how your first 'match' differs from your 
> third 'match'? I
> know the English language description is different but I don't see the
> practical difference between the two.
> 
> For example, are you looking for child elements of foo with 
> bar attributes?
> 
> Thanks.                 ...edN
> 
> > -----Original Message-----
> > From: owner-xsl-list@xxxxxxxxxxxxxxxx
> > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxx]On Behalf Of Paul 
> W. Abrahams
> > Sent: Friday, July 30, 1999 4:16 PM
> > To: XSL listserve
> > Subject: 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
>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread