« Return to Thread: [ANN] Saxon-CE 1.0 (XSLT 2.0 on the browser)

Re: [ANN] Saxon-CE 1.0 (XSLT 2.0 on the browser)

by Roger Costello :: Rate this Message:

| View in Thread

> There are 3 extensions at play here:

So, for adding dynamic behavior to web pages the web developer community is being invited to use a proprietary, non-free, plug-in instead of a standard, free, native, massively well supported JavaScript?

That doesn't seem reasonable.

/Roger

-----Original Message-----
From: Philip Fearon [mailto:pgfearo@...]
Sent: Thursday, June 14, 2012 7:27 PM
To: Mailing list for the SAXON XSLT and XQuery processor
Subject: Re: [saxon] [ANN] Saxon-CE 1.0 (XSLT 2.0 on the browser)

On Thu, Jun 14, 2012 at 6:59 PM, Costello, Roger L. <costello@...> wrote:

> Today, using some JavaScript I can implement enhanced browser behavior such as an HTML form field that can be displayed or hidden, based on the user clicking a button.
>
I haven't tested this code, but something like the following template
should toggle the visibility of the 'country' input element in a form
when
the 'switch' button is clicked by changing the input element's
'display' style property

<xsl:template match="button[@id eq 'switch'] mode="ixsl:onclick">
   <xsl:for-each select="../input[@id eq 'country']'" as="element()"/>
   <xsl:variable name="style" select="if (@style:display eq 'block')
                                                          then
'hidden' else 'block'  "/>
       <ixsl:set-attribute name="style:display" select="$style"/>
    </xsl:for-each>
</xsl:template>

There are 3 extensions at play here:

1. the ixsl:onclick mode is for any DOM element 'onclick' event in
this case - any template mode names in the ixsl namespace are for DOM
or JavaScript object events
2. The style prefix (for namespace:
http://saxonica.com/ns/html-style-property) allows CSS properties of
elements to be referenced as psuedo attributes.
3 ixsl:set-attribute sets the attribute (pseudo attribute in this
case) of the element that is the context item (set by xsl:for-each
here)

Phil Fearon

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@...
https://lists.sourceforge.net/lists/listinfo/saxon-help 

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@...
https://lists.sourceforge.net/lists/listinfo/saxon-help 

 « Return to Thread: [ANN] Saxon-CE 1.0 (XSLT 2.0 on the browser)