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

Re: XHTML Link stripping

Subject: Re: XHTML Link stripping
From: Emmanouil Batsis <Emmanouil.Batsis@xxxxxxxxxxx>
Date: Wed, 29 Nov 2006 15:29:45 +0200
Re:  XHTML Link stripping
You can add the following template in an identity transform (search the web for what that is)

<xsl:template match="a">
   <xsl:apply-templates />
</xsl:template>

Peter Hollas wrote:

Hi everyone,

Please could someone provide an example stylesheet of how to strip <a>
link tags out of a source XHTML document whilst retaining the
remaining node text from within the body. Preferably the output should
have normalised whitespace and a space seperating each extracted piece
of text. eg.

Source:

<html>
<head>
<title>Not wanted</title>
</head>
<body>
<a>Not wanted</a>
<div class="1">This text is wanted <a href="#">Not wanted</a> and so
is this</div>
<p>Wanted</p>
</body>
</html>


Output:


<htmltext>This text is wanted and so is this Wanted</htmltext>

I'm sure that the solution is incredibly simple, but after days of
trying I keep hitting a brick wall.

Many thanks, Peter.

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.