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

Using "variable" in a select...

Subject: Using "variable" in a select...
From: Michel.Baily@xxxxxxxxxxxxxxxxx
Date: Thu, 18 Sep 2003 16:02:39 +0200
katrienwiel

Dear All,

Im currently working on an XSL-FO project needing multiple languages
documents.

I've an XML document containing the data to be written :

<Attest year="2002" documentDate="21/08/2003">
? ?<Taker>
? ? ? <Name>
? ? ? ? ?Adam Dure
? ? ? </Name>
? ? ? <Address>
? ? ? ? ? <Street>
? ? ? ? ? ? Katrienwiel 6
? ? ? ? ? </Street>
? ? ? ? ? ...
? ? ? ? ? ...
? ? ? </Address>
? ? ? ...
? ? ? ...
? ?</Taker>
? ?...
? ?...
</Attest>

I've an XSL document used to transform XML into PDF using FOP.

To allow easiest maintenance, I've placed all the document static texts
into an other XML file like the one below :

<?xml version='1.0' encoding="UTF-8" ?>
<Texts>
? ? ? ? <Loan>
? ? ? ? ? ? ? ? <LoanNr lang="nl">Hypotecaire leningen Nr</LoanNr>
? ? ? ? ? ? ? ? <LoanNr lang="fr">Prêt hypotécaire ?Nr</LoanNr>
? ? ? ? ? ? ? ? <Year lang="nl">Dienst jaar</Year>
? ? ? ? ? ? ? ? <Year lang="fr">Année</Year>
? ? ? ? ? ? ? ? ...
? ? ? ? ? ? ? ? ...
? ? ? ? </Loan>
</Texts>

To acces the texts, I use such construction :

<xsl:template match="Loan">
? ?...
? ?<xsl:value-of select="document('fiscalAttestsTxt.xml')/Texts/Loan/LoanNr
[@lang='nl']"/>
? ?...
</xsl:template>

My question :
In place of using a litteral value for the lang(uage) attribute, I would
like to use a value extracted from ?my original xml file.
For example, I could add ?lang attribute to the Attest tag.
...
<Attest year="2002" documentDate="21/08/2003" lang="fr">
? ?<Taker>
? ? ? <Name>
? ? ? ? ?Adam Dure
? ? ? </Name>
? ? ? ...
? ? ? ...
? ?</Taker>
? ?...
? ?...
</Attest>

How can I reference this lang attribute as parameter ?in my select criteria
?
Remark : This value will change from Attest to Attest...

Thanks in advance

Michel



 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.