Re: [xsl] xsl:element will not create an output element, in any context

Subject: Re: [xsl] xsl:element will not create an output element, in any context
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 31 May 2007 13:06:18 +0100
> 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">

can be more simply written as


but I suspect you really want something like

   <div class="{name()}>

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.


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