Project

Profile

Help

Help on SaxonJS.transform()

Added by Robert Kirkpatrick about 2 years ago

Hello,

I can't find a detailed spec of SaxonJS.transform() signature.

I am facing a weird issue: an xsl transform which is performed but remains invisible in the browser (Chrome). I can check the result in the Chrome debug console, but the produced html is not displayed.

Looks like a sync issue or ??? depending on some transform() option ???

TIA, Robert.


Replies (5)

Please register to reply

RE: Help on SaxonJS.transform() - Added by Martin Honnen about 2 years ago

Isn't https://www.saxonica.com/saxon-js/documentation2/index.html#!api/transform detailed enough? Also, it would help if you provide minimal but complete samples of XSLT, JavaScript, (XML input) and HTML content page to allow others to reproduce the problem.

RE: Help on SaxonJS.transform() - Added by Michael Kay about 2 years ago

The best way of solving these problems is if you tell us exactly what you are doing and what effect it has - it may then be obvious what you are doing wrong, or we might need to investigate by trying to reproduce it ourselves.

Perhaps you're returning HTML as the result of the transform() call, but not actually writing this HTML into the browser's HTML document? (You can do this either from within the XSLT, using xsl:result-document, or from the calling Javascript).

RE: Help on SaxonJS.transform() - Added by Robert Kirkpatrick about 2 years ago

Thank you all.

I have prepared a minimal example which does not reproduce the issue. I need to investigate further and let you know.

Regards, Robert.

RE: Help on SaxonJS.transform() - Added by Robert Kirkpatrick about 2 years ago

You will find in attachment my elementary test case, which works fine.

My actual "business" case uses saxonJs in the same way. I was misled by a nasty bug which prevented the output of the transform to be displayed by the browser, which has nothing to do with neither saxonJs nor xslt.

In case if other users might hit it some day, here is the mistake: using an xml editor I wrote the attached hello.html with an xml comment in the style block, instead of a JS comment. This results in total ignorance of the css directives by the browser ! due to bracket clash I suppose.

My application is a SVG graphical publication which produces no visible output without appropriate css, hence my confusion.

Robert.

post.zip (162 KB) post.zip

RE: Help on SaxonJS.transform() - Added by Michael Kay about 2 years ago

Glad you were able to get to the bottom of it. I've also struggled to get SVG working in the past - diagnosing problems in the browser is always difficult, though I find the developer console in Chrome helps immensely. If the visible page doesn't look right, always check what the document tree looks like internally.

    (1-5/5)

    Please register to reply