xsl-list
[Top] [All Lists]

[xsl] Converting pseudo-tags in attribute to real tags

2007-08-22 05:50:09
Hi there,

I'm fairly new to XSLT (but not to XML processing -- I've been using
Perl's XML::Twig for ages).  So far I've been quite happy with it, but
today I've found a problem that I can't find a solution for -- I've
checked O'Reilly's XSLT and XSLT cookbook, and the FAQ.

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?

I hope somebody will be able to help!

Thanks a lot,

Thomas
-- 
   Thomas Widmann         
thomas(_dot_)widmann(_at_)harpercollins(_dot_)co(_dot_)uk
   Lead Developer                 +44 (141) 306 3295
Collins Dictionaries                  Glasgow, UK



**********************************************************
This message is intended only for the use of the individual(s) to which it
is addressed and may contain information that is privileged and confidential.

If you are not the intended recipient, you are hereby notified that
you have received this transmission in error; any review, dissemination,
distribution or copying of this transmission is strictly prohibited.

If you have received this communication in error, please notify us
immediately by reply e-mail and delete this message and all of its 
attachments.
**********************************************************


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>