Subject: Re: [xsl] xsl:element will not create an output element, in any context From: N David Brown <orieldave@xxxxxxxxxxxxxx> Date: Thu, 31 May 2007 12:17:09 +0000 |
<xsl:template match="*"> <xsl:element name="xhtml:UL> <xsl:apply-templates/> </xsl:element> </xsl:template>
<xsl:template match="*"> <ul> <xsl:element name="xhtml:UL> <xsl:apply-templates/> </xsl:element> </ul> </xsl:template>
It seems that, no matter what the context of an 'xsl:element' element,
no element is output for me.
what do you mean by "no output" you are passing the result tree generated by the stylesheet straight to firefox's rendering engine. As that result tree just consistes of <test> elements which are not valid html, html's error handling will apply which ignores the element and processes its content.
So the end result will be that the output just appears as the character data, as if ther were no markup, because there is no html markup.
<xsl:element name="test"> <xsl:apply-templates/> </xsl:element>
can be more simply written as
<test> <xsl:apply-templates/> <test>
but I suspect you really want something like
<div class="{name()}> <xsl:apply-templates/> <div>
Note that a browser is a hostile place to debug stylesheets as browsers are designed to go to extrodinary lengths never to report errors, and because they typically display the result tree as html ratherthan showing you the result elements, you have to simultaneously check that your stylesheet is generating teh html you expect and thatthe html you expect is having the presenattion that you wanted.
It's much simpler to first decide what html you need to get teh display in teh browser, then get a stylesheet that produces html files of that form using a command line or editor based xslt system, and only whan its all working put them together to run in a client side transform. Or some would argue never do that at all, having generated the html, just serve the html directly.
David
________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.
This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. ________________________________________________________________________
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] xsl:element will not crea, David Carlisle | Thread | Re: [xsl] xsl:element will not crea, David Carlisle |
Re: [xsl] xsl:element will not crea, David Carlisle | Date | Re: [xsl] xsl:element will not crea, N David Brown |
Month |