xsl-list
[Top] [All Lists]

RE: [xsl] Using attributes with XPath

2006-08-24 09:07:51

1. The axis concepts concerning XML elements (parent::*, child::*,
etc.) is not the same between an element and its attributes. Thus for
a beginner in XSLT, my comment about attributes stands. 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.

2. Here the meaning is something like 

<xsl:template match="@type[....]"/>

The phrase "template/@match" has to do with the XSLT elements in
question, not the XPATH syntax. And I did of course, write that there
are exceptions, etc.

Further, XSLT 1.0 does not allow you to write a predicate for 
an attribute template/@match 

Again, that's incorrect. You can certainly write
match="list/@type". 

3. My message was written in the context of using SAXON 6.55. There
are different errors for using different versions of the same
processor. I don't know what processor this person is using. So, that
is why the error messages are the important point. I can write
something for SAXON 6 without error, but if I do it for SAXON 8, I
can receive errors (like using params, XPATH statements, or using
examples given in XSLT Programmer's Reference edition 1 with SAXON 8,
etc.)

You really think beginners are going to wade through all the
techno-talk when working with a workflow they probably didn't even
setup in the first place?

Pardon my short hand.

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

At least I have always gotten errors when I 
have tried to do it. 

Then you've misinterpreted the error messages.
--- Michael Kay <mike(_at_)saxonica(_dot_)com> wrote:

Mike Ferrando wrote:

Attributes do not have parents. Elements can have parents, 
but attributes never have parents, children, etc.

This is incorrect. Attributes do have parents. It's just that they
aren't
children of their parent.


Further, XSLT 1.0 does not allow you to write a predicate for 
an attribute template/@match 

Again, that's incorrect. You can certainly write
match="list/@type". 

At least I have always gotten errors when I 
have tried to do it. 

Then you've misinterpreted the error messages.

This sort of "black art" programming ("Don't do X because I tried
it once
and it didn't work") really needs to be discouraged. Either get to
the root
of the problem and discover precisely why the failure occurred, so
you can
tell people precisely what to avoid, or leave it in your private
to-do list
for later investigation. Don't spread rumours based on anecdotal
evidence
that hasn't been investigated.

Michael Kay
http://www.saxonica.com/



--~------------------------------------------------------------------
XSL-List info and archive: 
http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--




__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--