Wrox Programmer Forums
Classic ASP XML Using ASP 3 and XML. See also the XML category for more XML discussions not relating to ASP. NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old September 5th, 2008, 06:09 AM
Registered User
Join Date: Sep 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to pramod
Default escaping of characters in xsl:attribute


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:value-of select="@sTitle" disable-output-escaping="yes"/>


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.

Pramod Bhagat
Old September 12th, 2008, 09:11 AM
Registered User
Join Date: Sep 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to pramod


I have found a work around for this and this seems to be working.
This can be placed in the function which calls for translating the xslt.

sTranslate = Replace(sTranslate,"amp;","")

This will get rid of amp; which prevents chinese characters to display.


Similar Threads
Thread Thread Starter Forum Replies Last Post
XSL problem with italian characters ciccio XSLT 4 September 6th, 2007 12:10 PM
problems with escaping characters when transformin lookingForAnswer XSLT 0 February 13th, 2007 06:29 PM
XSL Attribute ID jonty XSLT 1 March 28th, 2006 03:53 PM
Accented characters transformation in XSL ROCXY XSLT 3 January 19th, 2006 08:50 AM
onClick as xsl attribute? mlaba XSLT 1 September 10th, 2004 02:36 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.