xsl-list
[Top] [All Lists]

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

2007-05-31 05:31:44
           <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.

If you are generatig html rather than XHTML then the <ul> would be OK
but the <xhml:UL> would be an unknown element and so ignored.
So whether you are generating XHTML or HTML, the output of this is not
going to render as a list. HTML browsers don't give errors on invalid
html elemenst they just carry on ignore the unknown elements.

There is nothing magical about XSLT output, If you serve a document that
you hand write that looks like

<ul>
  <xhtml:UL>hhhh

to firefox you will get the same behaviour.

I repeat the advice I gave before, first decide what (X)HTML you want to
generate, and test that in the browser, only then start to look how you
can generate that markup using XSLT.

I get the text nodes output (eg. rootmenudir1file1file2) with no ul
tags surrounding. 

you wouldn't expect to see tags as firefox  doesn't lineraise the
result tree as an XML file, it renders it as html, and as this is invalid
html the most likely result is that you just see the character data.

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. 
________________________________________________________________________

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--