xsl-list
[Top] [All Lists]

Re: [xsl] Associating javascript with XSL and XML

2010-01-05 07:26:01


Little known factoid: the html, body and head opening and closing tags
are all optional.

with restrictions on when they can be omitted, but that is for html,
they are not optional in xhtml which is what you are generating here.
(And if you want the thing to work in IE it's best to generate html, or
as second best, unprefixed xhtml)

David


<xsl:stylesheet version="1.0" 
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
        xmlns:h="http://www.w3.org/1999/xhtml";>
<xsl:template match="/">
        <h:script type="text/javascript">
                alert('hello');
        </h:script>
        <h:style type="text/css">
                a{background-color:red}
        </h:style>
<xsl:apply-templates />
</xsl:template>

--~------------------------------------------------------------------
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>
--~--