[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: RE: What did "template match" match?

Subject: Re: RE: What did "template match" match?
From: "Jay Bryant" <jay@xxxxxxxxxxxx>
Date: Fri, 5 Aug 2005 11:20:37 -0500
Re:  RE: What did "template match" match?
> That's assuming the different patterns match different names. Doesn't work
> for, say
>
> match="chapter/title | section/title"
>
> Michael Kay
> http://www.saxonica.com/

Which is sometimes the case in my work.

<xsl:value-of select="concat(name(..), '/', name())/>

works for that.

Of course, if you need to walk up very far (or to an unknown number of
ancestors), you'll need a recursive template or function. When I was trying
to get cross-references to work in my document production system, Jeni
Tennison very kindly provided a function. Then, when my understanding grew
enough, I was able to write my own. However, I found that, most of the time,
it's better to just always specify the target for a cross-reference and not
try to write code that guesses. It turned out to not be worth the overhead.

All that aside, I'd use separate templates to better enable both reading and
maintaining the stylesheet. If that throws off alphabetization in your IDE
(if you use one), add a comment to remind yourself where to look.

Jay Bryant
Bryant Communication Services

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.