Subject: RE: [xsl] what should be the correct subject line From: TSchutzerWeissmann@xxxxxxxxxxxxxxxx Date: Mon, 12 Aug 2002 10:04:54 +0100 |
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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] what should be the corre, Vasu Chakkera | Thread | Re: [xsl] what should be the corre, abradoom |
Re: [xsl] what should be the corre, Vasu Chakkera | Date | Re: [xsl] how to merge tags/nodes v, Jarkko . Moilanen |
Month |