Subject: Re: [xsl] xsl:element will not create an output element, in any context|
From: "Abel Braaksma (online)" <abel.online@xxxxxxxxx>
Date: Thu, 31 May 2007 14:56:26 +0200 (CEST)
Something puzzles me about this thread. The OP says that (s)he has an XSLT that does not output XML. To enforce that statement (s)he runs the stylesheet in the browser, which effectively removes any possibility to see an error or problem or even the net result of the transform. But the OP also has a PHP script that does the transformation (likely with libxslt). I'd like to add the request to run the data against the original stylesheet, where the xslt is processed on the server by php and libxslt. Then, the OP can do "View Source" in any browser to see what the output looks like (do NOT rely on the rendered result as was already clearly mentioned by David). ("View Source" will not have any effect when you run the stylesheet embedded) If "View Source" shows a result without elements, remove the xsl:output instruction of all your included and imported stylesheets and place <xsl:output method="html" /> in your principal stylesheet. Trying to run the same stylesheet using <?xml-stylesheet ?> will result in another processor doing the job and the impossibility to view the net results of the transform. -- Abel PS: the best advice was already given and I second that: run your stylesheet from some XSLT test environment or from the commandline with your libxslt. David Carlisle wrote: > <xsl:element name="xhtml:UL> > > <xsl:template match="*"> > <ul> > <xsl:element name="xhtml:UL> > <xsl:apply-templates/> > </xsl:element> > </ul> > </xsl:template> > > That generates an element ul in no namespace and an element xhtml:UL > in > (presumably) the XHTML namespace. > > XHTML doesn't have elements with either of those names, for xhtml, > elements have to be in the xhtml namespace, and have to have lower > case > names.