|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Problems with apersand (&) when trying to dynamica
> Unfortunately I am restricted to using only xslt1. Is there any way to > define the character in XSLT1 using the code I have without having to > attach the & to the beginning? your processor may have an extension function (eg saxon:parse() would work) or the answer to your question technically is yes but you really don't want to do it <xsl:choose> <xsl:when test="@character=65">A</xsl:when> <xsl:when test="@character=66">B</xsl:when> .... a few thousand lines later.... </xsl:choose> doing it as an xsl:choose would be painful, as it would have to do a linear search each time. What would be not quite so painful is to make yourself a document <x> <char num="65">A</char> .... a few thousand lines later.... </x> then you could have <xsl:key name="char" match="char" use="@num"/> ... <xsl:variable name="c" select="@character"/> <xsl:for-each select="document('char.xml')"> <xsl:value-of select="key('char',$c)"/> </xsl:for-each> which would mean that having read the file once xslt had a hash table lookup of character numbers, but still (if you want to cover all unicode) this is still rather painful, and you may just prefer to get xslt to write out [AMP]#1234; and then just use perl or sed or any other text editor to change [AMP] to & David
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Cast Your Vote
We need your help – Vote for DataDirect XML Products!
Winners and finalists announced at SOA World Conference in November. 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
|







