Re: [xsl] Using attributes with XPath

Subject: Re: [xsl] Using attributes with XPath
From: Mike Ferrando <mikeferrando@xxxxxxxxx>
Date: Thu, 24 Aug 2006 06:45:53 -0700 (PDT)
Maybe it doesn't matter anymore when all the smoke has cleared.

I use 1.0. I know that you can do lots of stuff in 2.0.

I don't agree with the confusing concepts between elements and
attributes, esp. with people that are just learning XSLT. 

I don't agree with writing absolute paths for xsl:template/@match

Again, the context is the processor version for some of my

These ideas may seem personal, but I really object to the pull type
stylesheet writing. I don't think it is a good model, esp. for
teaching beginners.

Finally, it does seem odd to me that so many people write into this
list with error messages, or unexpected output from their
stylesheets, but when I suggest reacting to error messages (which are
often very explicit) I get slammed for "black box programming". The
beginner is using a black box setup and will probably continue to do
so until a later time when their XSLT experience enables them to
confidently create a configuration of their choice to meet their
workflow needs.

Mike Ferrando
Library Technician
Library of Congress
Washington, DC

--- David Carlisle <davidc@xxxxxxxxx> wrote:

> Mike I'm not sure what you mean by this:
> > 2. Here the meaning is something like 
> > 
> > <xsl:template match="@type[....]"/>
> the OP's original code of
> <xsl:template match="@type[parent::list]"/>
> was correct although most people would write it as
> <xsl:template match="list/@type"/>
> > Certainly, it
> > is more than obvious that an attribute must have some
> relationship
> > with the element it stands with, it cannot be floating in space.
> although XSLT2 does in fact allow you to generate attribute nodes
> that
> do just that.
> <xsl:variable name="a" as="attribute()">
> <xsl:attribute name="x">y</xsl;attribute>
> </xsl:variable>
> then $a is an attribute node with no parent (and can't be
> serialised
> unless it is copied into the content of an element being
> constructed)
> David

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

Current Thread