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

RE: Nestled <xsl:choose>

Subject: RE: Nestled <xsl:choose>
From: "Chris Bayes" <Chris@xxxxxxxxxxx>
Date: Sun, 15 Jul 2001 10:29:11 +0100
RE:  Nestled <xsl:choose>
Trevor,
>>You probably want to add a default book template to catch any books that
>>don't match your templates
>>
>><xsl:template match="book">
>><b>Error Trapped Undefined Book Type</b>
>></xsl:template>
>>
>>Put this before all the other book templates so that it only matches book
>>types you don't have templates for. If you put it at the end it will match
>>all book elements.
>>
>Slightly flawed (unless you are using the old MSMXL ??).

No

>  It doesn't
>matter where you put this template,

In this case that is true. But generaly if there are 2 templates of equal
priority the processor will take the last one in the stylesheet. So it is a
good rule of thumb is to put general case ones first.

>because the default priority for a
>name pattern like 'book' is higher than for qualified patterns like
>'book[@...]'.

It's the other way round!

>  But rather than rely on default priorities, a nice
>trick I saw somewhere else (in schematron?) is to give this template a
>priority of -1.  You are then guaranteed it will not be chosen in
>preference to anything else, whatever the style of pattern.

Yup. System assigned priorities are between +0.5 and -0.5.

Ciao Chris

XML/XSL Portal
http://www.bayes.co.uk/xml


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.