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

RE: what should be the correct subject line

Subject: RE: what should be the correct subject line
From: TSchutzerWeissmann@xxxxxxxxxxxxxxxx
Date: Mon, 12 Aug 2002 10:04:54 +0100
should xml have p tags
Hi Thiabek

[big snip...]
> Here so many unwanted <p> and </p> .why? and how to remove them with
> the condition that if some text is not in side of any tag but body it
> should be outputted.

one way of working out what's wrong is to make it obvious what templates are
firing by having them output 
something unique to them.
So, if you change the template that matches <p> to this:

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

you'll notice that all the unwanted <p> tags turn to unwanted <p-simple>
tags. They're there because
you asked for them! The other template you have that could match <p> tags is
this one:

<xsl:template match="font/p | center/p | div/p | p/p">
<xsl:apply-templates/>
</xsl:template>     

isn't firing for a very simple reason: there are no <p> tags in your source
xml that have font, center, div
or p tags as their parent.

> 
> And if i want to test for <br /> that if it is just after a 
> <a> or <li>
> or <br /> then do not put <br /> in output.

use match="a/br | li/br | br/br", eg.

<xsl:template match="a/br | li/br | br/br">
	Look, no br tag!
	<xsl:apply-templates/>
</xsl:template>

The precedence rules for templates are more specific ones have higher
precedence, and if that doesn't 
decide it, then the one that comes later in the stylesheet takes precedence.

have fun,
Tom

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.