This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: i18n approach
- To: Dimitre Novatchev <dnovatchev at yahoo dot com>
- Subject: Re: [xsl] i18n approach
- From: Jeni Tennison <mail at jenitennison dot com>
- Date: Tue, 6 Feb 2001 09:51:11 +0000
- CC: xsl-list at lists dot mulberrytech dot com
- Organization: Jeni Tennison Consulting Ltd
- References: <20010205195545.27296.qmail@web6305.mail.yahoo.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
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