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

How a node value of an external xml file?

Subject: How a node value of an external xml file?
From: "Iris Allemeersch" <allemeerschi@xxxxxxxxxxx>
Date: Fri, 11 Oct 2002 10:48:00 +0000
xsl external param
I have 3 files Address.xml (mainfile with address data), Address.xsl (transformation of the mainfile) and translations.xml (file I want to use to do translations).
Problem is that I want to get translated data from my external file (translations.xml) in my xsl. I want to do this by passing the founded parameters (txtNode & txtLang), but that didn't work.
(cfr. <xsl:value-of select="$resource/$txtNode/$txtLang"/>)
When I pass my values without parameters it works! (cfr. <xsl:value-of select="$resource/AddressTitle/EN"/>)


How can I pass my parameters to get the correct node value of my file Translations.xml ???

Thanx in advance.


== Address.xsl ==
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:output method="xml"/>
<xsl:variable name="resource" select="document('Translations.xml')"/>
....
<xsl:template name="Address">
<Line bold="true" dhigh="false" justify="left">
<xsl:call-template name="Resource"><xsl:with-param name="txtNode">AddressTitle</xsl:with-param></xsl:call-template>
</Line>
</xsl:template>


	<xsl:template name="Resource">
		<xsl:param name="txtNode"/>
		<xsl:param name="txtLang">EN</xsl:param>
		<xsl:value-of select="$resource/$txtNode/$txtLang"/>
	</xsl:template>
	....
</xsl:stylesheet>

== Translations.xml ==
<?xml version="1.0" encoding="UTF-8"?>
<Resource>
	<AddressTitle>
		<EN>Customer: </EN>
		<NL>Klant: </NL>
		<FR>Client: </FR>
	</AddressTitle>
</Resource>

_________________________________________________________________
Join the world?s largest e-mail service with MSN Hotmail. http://www.hotmail.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.