Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 13th, 2004, 12:14 PM
Authorized User
 
Join Date: Sep 2004
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default Stripping specific tags from input XML

My stylesheet is running through some XML that contains tags like this:

<title>This is <b>My</b> Title, from <i>The History of Eric</i></title>

What I need to return is this:

<header>
This is My Title, from The History of Eric

(yes, no closing tag for header; it's not real XML that's being output.)

How would I go about stripping out the <b> and <i> tags?

 
Old December 13th, 2004, 12:54 PM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Assuming you are positioned on the node containing title:
Code:
<xsl:value-of select="title"/>
--

Joe (Microsoft MVP - XML)
 
Old December 13th, 2004, 12:55 PM
Authorized User
 
Join Date: Nov 2004
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to jkmyoung
Default

Try using <xsl:apply-templates/>, it'll basically output the text.
eg.
<xsl:template match="title"/>
<xsl:apply-templates/>
</xsl:template>


 
Old December 13th, 2004, 01:04 PM
Authorized User
 
Join Date: Sep 2004
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple input xml / get data from other xml file elayaraja.s XSLT 3 July 25th, 2008 06:59 AM
regarding deleting tags in an xml abhi.prince4u XML 0 July 14th, 2007 12:16 AM
xml and xsl templates as input to xslt gives xml rameshnarayan XSLT 5 August 3rd, 2005 01:58 AM
Renaming with XML tags? johrik XSLT 1 February 12th, 2004 03:49 PM
Dynamically Add input tags Jstmehr4u3 Javascript How-To 2 July 29th, 2003 04:03 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.