RE: [xsl] encoding shift_jis into an attribute

Subject: RE: [xsl] encoding shift_jis into an attribute
From: "Matthew Simoneau" <Matthew.Simoneau@xxxxxxxxxxxxx>
Date: Thu, 3 Jun 2004 13:23:08 -0400
I found a solution to my problem.  Since I received so much help from
this newsgroup, I wanted to share my solution.  I'm building up the
surrounding text via xsl:text with disable-output-escaping="yes" so the
markup passes through.  Then I use xsl:value-of to get the numeric
character reference escaped text in the middle of the attribute.  It's a
little hacky, but it works.  You can see the details below.  Hopefully I
won't have any problems integrating this into my large stylesheet.

Thanks again for your help, everyone!

Matthew Simoneau
The MathWorks, Inc.

<?xml version="1.0" encoding="utf-8"?>

<!DOCTYPE xsl:stylesheet>
  <xsl:output method="html"/>

<xsl:template match="test">

<xsl:text disable-output-escaping="yes">&lt;a
<xsl:value-of select="label"/>
<xsl:text disable-output-escaping="yes">')"&gt;foo&lt;a&gt;</xsl:text>



Current Thread