xsl-list
[Top] [All Lists]

Re: [xsl] Embedded bold,italic,anchors etc.

2008-06-11 05:13:57
Although you didn't show us what you are doing, I suspect you are probably doing a xsl:value-of within a template - whereas you should be doing an xsl:apply-templates to handle the embedded elements.

The value-of will return the concatentated values of all descendent text nodes. The apply-templates will continue applying templates to all child nodes. Hence if you have a template matching on "bold" e.g.

<xsl:template match="bold"> <!-- assuming your source file uses bold for bolding -->
  <b><xsl:apply-templates /></b>  <!-- convert to equivalent html bold -->
</xsl:template>

It would be triggered and give you what you want. Similarly for italic, anchors, etc. Note that I did an apply-templates here to allow bolded text to recursively contain italic and/or anchors.

Cheers...Hugh
CyberSpace Industries 2000 Inc.
Multimedia Promotion
XML Training and Consulting
http://cyberspace-industries-2000.com



----- Original Message ----- From: "Craig Riley" <craig(_at_)thelifeofriley(_dot_)org>
To: <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Sent: Wednesday, June 11, 2008 7:33 AM
Subject: [xsl] Embedded bold,italic,anchors etc.


Hi,

I'm fairly new to XSLT so please be nice! :)

I have created an XSLT style sheet that does everything I need it to
except for handling embedded text. The XML documents I am transforming
contain the usual italic, bold, superscript, plus hyper links that
need converting into html.

Of course I need them to retain there place in the copy of course.
I've searched online and inside books but can't find a solution to
this problem.

Please help!


Cheers

Craig




----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.




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



--------------------------------------------------------------------------------



No virus found in this incoming message.
Checked by AVG.
Version: 8.0.100 / Virus Database: 270.2.0/1495 - Release Date: 6/10/2008 5:11 PM


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