Groups | Blog | Home
all groups > dotnet xml > august 2005 >

dotnet xml : Embedded HTML tags in XML data


Bryan
8/30/2005 3:22:02 PM
Hi.

I have queries that bring back recordsets from SQL 2000 that are being
converted to XML for display using XSLT templates.

The issue is that some of the verbose text has embedded <BR> tags. These
tags are being displayed on line. The end user does not want to see these
tags.

I have tried using the translate function (i.e.
translate(SystemClaimStatusDesc, '<br>', ' '), but I am getting errors "'<',
hexadecimal value 0x3C, is an invalid attribute character. Line 167, position
168."

I know that somehow I have to convert the < to dec, but I am having no luck.

Can anyone assist?
--
Bryan Canterbury
Data Integration Specialist
Pascal Schmitt
8/31/2005 12:00:00 AM
Hello!

[quoted text, click to view]

You might want to copy the text directly, use
<xslt:value-of select=".." disable-output-escape="yes" />


[quoted text, click to view]

Use the matching Character Entities:

translate(SystemClaimStatusDesc, '&lt;br&gt;', ' ')



--
Oleg Tkachenko [MVP]
8/31/2005 10:41:57 AM
[quoted text, click to view]

Beware that translate function works on charcter basis and such
expression won't replace "<br>" with space, instead it will replace <
characters with space and remove any b, r, and > characters.

--
Oleg Tkachenko [XML MVP, MCAD]
http://www.xmllab.net
AddThis Social Bookmark Button