View Single Post
  #1 (permalink)  
Old September 5th, 2008, 06:09 AM
pramod pramod is offline
Registered User
 
Join Date: Sep 2008
Location: , , United Kingdom.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to pramod
Default escaping of characters in xsl:attribute

Hello!

I have a problem with escaping of characters when using xsl:attribute, this is an example of my xsl

<a href="/{../../@sFolder}/{../@sFolder}/{@sFolder}/" class="breadcrumb">

<xsl:attribute name="title" >

<xsl:value-of select="@sTitle" disable-output-escaping="yes"/>

</xsl:attribute>

<xsl:value-of select="@sTitle" disable-output-escaping="yes"/>

</a>

my xml document looks like this, with the value of document title already encoded. (if I dont escape the title I just get questionmarks for some characters like #260; and #321; when i print in outside an xsl:attribute)

<level4 nStructureID="661" nParentID="658" nRootID="1" nStructOrder="661" nStructLevel="4" nTemplateID="6" nSiteID="1" nContentID="667" sTitle="New Congenbill #26032;#30340;#24247;#37329;#25552;#21333;" sFolder="newcongenbill" nLanguageID="1" dtLiveDate="20080528" dtArchiveDate="20090528" dtDocDate="" dtDeleteDate="20100528" dtClosingDate="" />

this will produce the following html:

<a href="/shippingebrief/chineselanguageebrief/newcongenbill/" class="breadcrumb" title="New Congenbill &amp;#26032;&amp;#30340;&amp;#24247;&amp;#37329;&a mp;#25552;&amp;#21333;">New Congenbill #26032;#30340;#24247;#37329;#25552;#21333;</a>
but what I want is:

<a href="/shippingebrief/chineselanguageebrief/newcongenbill/" class="breadcrumb" title="New Congenbill #26032;#30340;#24247;#37329;#25552;#21333;">New Congenbill #26032;#30340;#24247;#37329;#25552;#21333;</a>

There is an extra text amp; appended to the tooltip.

When i print the text in the browser then it works fine but in the tooltip its creating a problem.

I am using ASP.

Is this a bug or the expected behaviour and if so, is there some workaround?

Thanks for your reply.

Thanks,
Pramod Bhagat
Reply With Quote