xsl-list
[Top] [All Lists]

Re: [xsl] Associating javascript with XSL and XML

2010-01-05 06:35:40
On Tue, 2010-01-05 at 13:13 +0100, Martin Honnen wrote:

Is there any difference between those two stylesheets?
What exactly is it that you want to achieve?


Lack of proofreading on my part:

<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:template match="item">
        <h:a href="{link}"><xsl:value-of select="desc"/></h:a>
</xsl:template>
</xsl:stylesheet>

What I'm trying to do is start up javascript and be able to manipulate
the DOM in the browser without having to rely on anything related to
HTML. I don't have any aversion to HTML, it just feels like I'm adding
extraneous elements.


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