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

RE: outputting an ampersand in an attribute

Subject: RE: outputting an ampersand in an attribute
From: "Michael Sokolov" <sokolov@xxxxxxxxxxxx>
Date: Wed, 5 Aug 2009 19:20:35 -0400
RE:  outputting an ampersand in an attribute
OK trying again....

Just a guess, but perhaps:

<xsl:character-map name="charmap">
  <xsl:output-character string="&amp;amp;" character="&amp;"/>
</xsl:character-map>

?

> -----Original Message-----
> From: Michael Sokolov [mailto:sokolov@xxxxxxxxxxxx]
> Sent: Wednesday, August 05, 2009 7:19 PM
> To: 'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'
> Subject: RE:  outputting an ampersand in an attribute
>
> Just a guess, but perhaps:
>
>
> > -----Original Message-----
> > From: tom a [mailto:tasmito@xxxxxxxxx]
> > Sent: Wednesday, August 05, 2009 5:00 PM
> > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> > Subject:  outputting an ampersand in an attribute
> >
> > I am generating svg documents and would like to output an element
> > like:
> >
> > <glyph unicode="&#xE003;" horiz-adv-x="833"
> > d="M124,348L124,249L709,249L709,348L124,348 Z"/>
> >
> > I need to generate the value of @unicode programmatically.
> > The difficulty, of course, is outputting the ampersand in @unicode.
> >
> > I started off by trying to disable output escaping:
> >
> > <xsl:variable name="char" as="xs:string">
> >   <xsl:value-of disable-output-escaping="yes"
> >       select="concat(codepoints-to-string(38), position(), ';')"/>
> >  </xsl:variable>
> > <xsl:attribute name="unicode" select="$char"/>
> >
> > But this came out as &amp;
> > (followed by an integer and ; per the concat())
> >
> > I then tried to use character maps:
> >
> > <xsl:character-map name="charmap">
> >    <xsl:output-character string="&amp;" character="&"/>
> > </xsl:character-map>
> >
> > But the processor refuses to accept the lone ampersand in
> @character.
> > It generates the following message:
> >
> > "The entity name must immediately follow the '&' in the entity
> > reference."
> >
> > But since the entity name is generated at runtime, I have a problem.
> >
> > Any thoughts are greatly appreciated...
> >
> > Tom

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.