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

Re: XSL and localization

Subject: Re: XSL and localization
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 6 Oct 2004 15:03:54 +0100
xsl localization
> Is this possible and how ?

Unfortunately it is processor dependent. 

If 

document(concat('locale/',/*/@lang,'/test_locale.xml'))

doesn't exist then strictly speaking it's an error but the xslt spec
allows the system to recover in which case it simply returns an empty
node set in which case you can test for that with
<xsl:if
test="not(document(concat('locale/',/*/@lang,'/test_locale.xml'))">
do something else

however your system may stop with an error instead. Saxon for example
has a top level switch to control recoverable errors

-w0 silently ignore error and do recovery action
 
what you want here

-w1 (the default) make a warning but do the recovery action
   
or maybe you want the warning

-w2 stop with a fatal error and produce no result tree

you don't want that.


If you want to be sure to avoid processor dependency or you need to use
a processor that makes this a fatal error, make an xml file that
reflects the list of available file names (there are tools to do this
automatically, but just simply editing a directory listing also works)
then consult that with document() before trying to use document() to get
the locale file.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

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.