[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Converting pseudo-tags in attribute to real tags

Subject: Re: Converting pseudo-tags in attribute to real tags
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Wed, 22 Aug 2007 10:08:05 -0300
Re:  Converting pseudo-tags in attribute to real tags
At 2007-08-22 13:48 +0100, Thomas Widmann wrote:
My problem is that I have an attribute that looks like this:

<sentence text="this is &lt;b>bold&lt;/b> text"/>

If I do the following:

<xsl:template match="sentence">
        <i>
                <xsl:value-of select="@text"/>
        </i>
</xsl:template>

Then the result obviously is:

<i>this is &lt;b>bold&lt;/b> text</i>

However, I really want the pseudotags within the attribute to become
real tags:

<i>this is <b>bold</b> text</i>

How do I do this?

If the processor you are using supports the optional attribute disable-output-escaping, then you can do the following:


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

Your situation is the most popular use-case for this optional attribute: when you have escaped markup as text and you need it to go out as bona fide markup.

I hope this helps.

. . . . . . . . . . . . . . Ken

--
Upcoming public training: XSLT/XSL-FO Sep 10, UBL/code lists Oct 1
World-wide corporate, govt. & user group XML, XSL and UBL training
RSS feeds:     publicly-available developer resources and training
G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Cancer Awareness Jul'07  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.