Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / XML / August 2005

Tip: Looking for answers? Try searching our database.

Embedded HTML tags in XML data

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bryan - 30 Aug 2005 23:22 GMT
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?
Signature

Bryan Canterbury
Data Integration Specialist
Healthx, INC.

Pascal Schmitt - 31 Aug 2005 00:21 GMT
Hello!

> 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.

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

> 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."

Use the matching Character Entities:

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

Signature

Pascal

Oleg Tkachenko [MVP] - 31 Aug 2005 08:50 GMT
> Use the matching Character Entities:
>
>   translate(SystemClaimStatusDesc, '&lt;br&gt;', ' ')

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.

Signature

Oleg Tkachenko [XML MVP, MCAD]
http://www.xmllab.net
http://blog.tkachenko.com


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.