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

Re: Stripping or converting HTML tags

Subject: Re: Stripping or converting HTML tags
From: Emmanouil Batsis <Emmanouil.Batsis@xxxxxxxxxxx>
Date: Tue, 19 Oct 2004 18:05:44 +0300
htmltidy html template tags
Hi Aaron,

Aaron Johnson wrote:

Hello...

I have a html document which is being transformed into XML and then being
re-formatted as XHTML via XSL.



The best route to all that IMHO, would be some variant of HTMLTidy.


So far I have this, but all it does is make the table disappear completely.

<xsl:template match="xhtml:table | xhtml:TABLE | xhtml:td | xhtml:TD |
xhtml:th | xhtml:TH | xhtml:tr | xhtml:TR">



BTW, elements in uppercase are not valid XHTML.


<xsl:choose>
<xsl:when test="*">
<xsl:value-of select="@p"/>



Here you are testing whether child elements exist and if they do, output the value of the context element's p attribute?


I think you need something like

<><xsl:template match="xhtml:table | xhtml:TABLE | xhtml:td | xhtml:TD |
xhtml:th | xhtml:TH | xhtml:tr | xhtml:TR">
<xsl:apply-templates />
</xsl:template>

This will 'skip' those elements and compared with an identity transform will do what you need.

hth,

Manos

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.