xml data islands
I have an xsl file to format an xml file with data. In the xsl file I have
some text that I would like write in french, english, spanish, etc. Can I
solve this problem with an xml data islands? I know do it if the data island
xml file have only one language.
If the data island is like this:
<texts>
<text idm="0">
<t1>hello</t1>
<t2>bye</t2>
</text>
<text idm="1">
<t1>alo</t1>
<t2>aurrevoir</t2>
</text>
...
</texts>
how can I do it?
[588 byte] By [
Daniel] at [2007-11-9 15:28:36]

# 1 Re: xml data islands
Here are three possibilities:
1. Create your XSL stylesheet with a parameter (see xsl:param). Then pass
the stylesheet the "idm" number that corresponds to the language you want
the stylesheet to use, eg. "0" for English, and "1" for French.
2. As you already know which language you want to use, pass the stylesheet
the <text> node that you want it to work with; in other words, pass it a
document fragment rather than the entire data island. You can obtain the
fragment by using an XPath query such as:
SelectSingleNode(/texts/text[@idm='1']).
3. Why pass all the languages (the entire XML document) to the client? You
should be able to maintain the XML file in memory on the server (see the
XMLand select only the <text> node containing the language the client wants,
and then wrap that in a <texts> node and use it for the data island. If you
do that, your current stylesheet would probably work fine.
"Daniel" <dboira@btgsa.com> wrote in message
news:3e9bc19f$1@tnews.web.dev-archive.com...
>
> I have an xsl file to format an xml file with data. In the xsl file I have
> some text that I would like write in french, english, spanish, etc. Can I
> solve this problem with an xml data islands? I know do it if the data
island
> xml file have only one language.
> If the data island is like this:
> <texts>
> <text idm="0">
> <t1>hello</t1>
> <t2>bye</t2>
> </text>
> <text idm="1">
> <t1>alo</t1>
> <t2>aurrevoir</t2>
> </text>
> ..
> </texts>
>
> how can I do it?