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

Re: i18n approach

Subject: Re: i18n approach
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Tue, 6 Feb 2001 09:51:11 +0000
i18n approach document
Hi Dimitre,

>> In order to use a single XSLT stylesheet on a particular set of
>> source XML files, they need to have something in common.
>
> The most common feature is that they are written in XML.

Well, OK.  You can do things like have a stylesheet that always copies
whatever source XML you pass it, or always just gets rid of it, or
turns it into a browsable tree like the inbuilt stylesheet on IE does.

On the i18n side, you can easily put together a generic stylesheet
that filters for a particular language:

<xsl:param name="lang" select="'en'" />

<xsl:template match="@*|node()">
   <xsl:if test="lang($lang)">
      <xsl:copy>
         <xsl:apply-templates select="@*|node()" />
      </xsl:copy>
   </xsl:if>
</xsl:template>

Or I guess you could create a generic stylesheet that accessed and
copied a source XML file in a particular language:

<xsl:param name="lang" select="'en'" />

<xsl:template match="/">
   <xsl:copy-of select="document(concat('source_', $lang, '.xml'))" />
</xsl:template>

> I think Jeni is being shy here -- I know a whole class of very
> different XML files that have a very useful single stylesheet to
> process them -- the XML files are an instance of any possible
> stylesheet, the stylesheet is her XSLDoc application...

The XSLTDoc application actually uses knowledge about the *XSLT*
vocabulary to build up its views, and couldn't do half the things it
does if it didn't.

But yes, I concede that generic viewers and browsers are a set of
applications that are possible without an intimate knowledge of a
particular XML vocabulary (though I think that they can be much
enhanced if they know a bit about general things like XInclude, XLink,
XML schemas and other special vocabularies). I don't think that
Andreas was after a generic viewer, though.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/



 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.