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

Re: Embedded bold,italic,anchors etc.

Subject: Re: Embedded bold,italic,anchors etc.
From: "CyberSpace Industries 2000 Inc." <csi2000@xxxxxxxxxxxxxxx>
Date: Wed, 11 Jun 2008 08:13:25 -0400
Re:  Embedded bold
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@xxxxxxxxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Wednesday, June 11, 2008 7:33 AM
Subject: 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.



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



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


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.