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

Problems with apersand (&) when trying to dynamically

Subject: Problems with apersand (&) when trying to dynamically define a character value as an attribute value.
From: "Robert Eaton" <reaton@xxxxxxxxxxxxxxx>
Date: Thu, 26 Oct 2006 12:12:34 +0100
apersand
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 &#x25CF;. 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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Cast Your Vote

We need your help – Vote for DataDirect XML Products!

  • Best SOA or XML site

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!

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-2007 All Rights Reserved.