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)
David,
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
values.

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

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.

Thanks,
Mike Ferrando
Library Technician
Library of Congress
Washington, DC
202-707-4454

--- 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 
http://mail.yahoo.com 

Current Thread