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

RE: String evaluation problem

Subject: RE: String evaluation problem
From: "Nathan Young \(natyoung\)" <natyoung@xxxxxxxxx>
Date: Wed, 19 Oct 2005 10:15:21 -0700
string evaluation
It's hard to tell from the info you give, but this may be another use
case for a design pattern that's come up a few times recently.

If what you need to do is create a map of values that gets substituted
in, you can load values from an external document (or the current XSL)
using the document function.

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:variable name="dictionary" select="document('values.xml')"/>

<xsl:template ...
  <xsl variable name="key-name"
select="concat(substring('continue(1)',1,8),substring('continue(1))"/>
  <xsl:value-of select="$dictionary//$key-name"/>

... <snip>


Where the file values.xml might contain

<root>
   <continue1>general explanations</continue1>
   <continue2>... etc.</continue2>
</root>


Is that helpful?

--->N


> -----Original Message-----
> From: Fadi Qutaishat [mailto:fadi_taher2000@xxxxxxxxx]
> Sent: Wednesday, October 19, 2005 4:07 AM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re:  String evaluation problem
>
> Hi Andrew,
>
> I know that is the direct way is to have
> <test>&continue1;</test> to reference the entity but
> the logic that I've got generates continue(n)formate
> and it can't be changed and that's whay I have tried
> out the things using the indirect way substrings
> function.
>
> Many thanks,
>
> Fadi
>
>
>
>
>
> __________________________________
> Yahoo! Mail - PC Magazine Editors' Choice 2005
> http://mail.yahoo.com

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.