Re: Saxon-JS 2 user input events not handled

Debbie Lockett <debbie-JkSD5nQpfvpWk0Htik3J/[email protected]>
Newsgroups gmane.text.xml.saxon.help
Message-ID <[email protected]>
Martynas, is there a good reason you are not just using the 
"-ns:##html5" command line option as recommended in the documentation? 
This is available on the Node.js command line too, for exporting 
stylesheets for use in the browser, and should mean you do not need the 
XSLT stylesheet changes.


On 27/08/2020 15:36, Martynas Jusevičius wrote:
> I ended up using
> xpath-default-namespace="http://www.w3.org/1999/xhtml" as adding a
> prefix everywhere seemed to error prone.
>
> How about result document elements, do they need to use a namespace?
> As far as I can see, currently our stylesheets do not (and some of
> them are shared between the server and the browser).
>
> I wish there was a stylesheet for automatically upgrading Saxon-CE and
> Saxon-JS 1 stylesheets to Saxon-JS 2 ;)
>
> On Thu, Aug 27, 2020 at 4:11 PM Michael Kay <[email protected]> wrote:
>> No problem. The more people share such experiences, the quicker we can respond when the next person hits the same problem!
>>
>> Michael Kay
>> Saxonica
>>
>> On 27 Aug 2020, at 12:20, Martynas Jusevičius <[email protected]> wrote:
>>
>> My bad. The DTD got me thinking about namespaces and that they're the
>> usual suspect in situations like this. This made me re-read the
>> documentation and find this:
>>
>>     Changes especially for browsers include the following:
>>
>>     The default namespace for the HTML page is now the HTML namespace
>> "http://www.w3.org/1999/xhtml". This is a change from Saxon-JS 1.x, in
>> which elements in the HTML page are treated as being in no namespace.
>> In order to minimize changes required in XSLT stylesheets to
>> accommodate this (i.e. requiring the default-namespace to be set, and
>> retaining the use of unprefixed element names in path expressions and
>> match patterns to match elements in the HTML page), the new command
>> line option -ns:##html5 should be used.
>>
>> After I've changed the pattern to match the
>> "http://www.w3.org/1999/xhtml" namespace, the events are now handled:
>>
>>     <xsl:template match="*[@id =
>> 'container-pane']/xhtml:div/xhtml:ul[@class = 'nav
>> nav-tabs']/xhtml:li/xhtml:a" mode="ixsl:onclick">
>>
>> Sorry for the noise.
>>
>> On Thu, Aug 27, 2020 at 1:00 PM Martynas Jusevičius
>> <[email protected]> wrote:
>>
>>
>> So here's attempt to reproduce: https://namedgraph.github.io/saxon-js2-test/
>>
>> The CSS will look broken, but you should see a TEST button which has
>> an onclick handler in client.xsl. It should print "TEST" into the
>> console, but nothing happens.
>>
>> Source code: https://github.com/namedgraph/saxon-js2-test/tree/gh-pages
>>
>> Now I've noticed that the HTML specifies 4.01 strict DTD -- could this
>> be an issue?
>>
>> On Wed, Aug 26, 2020 at 11:15 PM Martynas Jusevičius
>> <[email protected]> wrote:
>>
>>
>> Okay, I'll try to make a repro tomorrow.
>>
>> On Wed, Aug 26, 2020 at 11:14 PM Michael Kay <[email protected]> wrote:
>>
>>
>> Any chance of producing a cut-down repro that we can actually run to see if we can reproduce the problem?
>>
>> We may also need to see how you are invoking the transformation from the HTML page.
>>
>> Michael Kay
>> Saxonica
>>
>> On 26 Aug 2020, at 20:59, Martynas Jusevičius <[email protected]> wrote:
>>
>> Hi,
>>
>> I've upgraded a Saxon-CE stylesheet to work under Saxon-JS 2.
>>
>> The templates initiated by the initialTemplate work fine.
>>
>> However the templates handling user events don't seem to work anymore. Examples:
>>
>>    <xsl:template match="input[@id = 'uri']" mode="ixsl:onkeyup" priority="1">
>>
>>    <xsl:template match="*[@id = 'container-pane']/div/ul[@class =
>> 'nav nav-tabs']/li/a" mode="ixsl:onclick">
>>
>> I've put <xsl:message> in them but I cannot get any output in the
>> console even though I've turned up the logLevel to 10.
>>
>> Stylesheet source:
>> https://github.com/AtomGraph/LinkedDataHub/blob/rf-saxon-js2/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/client.xsl#L1294
>>
>>
>> Martynas
>>
>>
>> _______________________________________________
>> saxon-help mailing list archived at http://saxon.markmail.org/
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>>
>>
>> _______________________________________________
>> saxon-help mailing list archived at http://saxon.markmail.org/
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>>
>>
>>
>> _______________________________________________
>> saxon-help mailing list archived at http://saxon.markmail.org/
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>>
>>
>> _______________________________________________
>> saxon-help mailing list archived at http://saxon.markmail.org/
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/saxon-help

-- 
Debbie Lockett
Saxonica



_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[email protected]
https://lists.sourceforge.net/lists/listinfo/saxon-help
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.