xsl-list
[Top] [All Lists]

[xsl] Problems with apersand (&) when trying to dynamically define a character value as an attribute value.

2006-10-26 04:12:02
I am trying to convert an XML document in to wordML format. When creating a 
list in wordML there is an attribute that specifies the character to be used as 
the bullet point; I need to set this based on an attribute in the input XML, 
the value of which will be just the character code with out the &# at the 
beginning e.g. x25CF. 

The problem I am having is constructing the final output attribute value which, 
for the above example I need to be ●. If specifying a character in that 
format is not a problem; but adding the '&#' to the beginning of the input 
attribute value is proving to be very difficult. 

If I try to use XSL similar to: 

<xsl:template match="dummy">
             <lvlText>
                    <xsl:attribute name="val">
                           <xsl:text disable-output-escaping="yes" 
&amp;#</xsl:text>
                           <xsl:value-of select="@character"/>
                           <xsl:text disable-output-escaping="yes">;</xsl:text>
                    </xsl:attribute>
             </lvlText>
       </xsl:template>

The output I get is 

<lvlText val="&amp;#x25CF;" />

If I do not escape the & I get an error saying the file is not well formed.

Anyone know how I could get this to work. Any suggestions greatfuly received.

Thanks
Rob

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--