[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|