[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Using "variable" in a select...
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|