Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

conditional XML based on URL

Status
Not open for further replies.

marsupilami007

IS-IT--Management
May 6, 2009
1
PT
Hi,

At I installed an SWF (top/left corner) that is controled by an XML. Since this is a bilingue website >> pt/en, when you press the flags the URL change to "pt" or "en" and the content is translated. What I need is that the XML controlled SWF show also translated content according with the URL having "pt" or "en". So I need something like:

<xsl:if test="[the language code in the URL]!='pt'">
...
</xsl:if>
<xsl:if test="[the language code in the URL]!='en'">
...
</xsl:if>

Can you help me on this?

best regards
Paulo
 
One way to pass specific setting to xsl is to use a top-level parameter. Like this (default to 'pt').
[tt] <xsl:param name="lang" select="'pt'" />[/tt]
And then when process xml against a xsl document, supply a specific value to the param "lang". (I have no idea of what environment the page is operating, client-side or server-side... - I have not visited to cited page.)

Then the xsl:if will look like this.
[tt] <xsl:if test="$lang='pt'">
<!-- do things -->
</xsl:if>
<xsl:if test="$lang='en'">
<!-- do other things -->
</xsl:if>
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top