Search code examples
xsltxqueryxslt-2.0marklogicxslt-3.0

Seek opinion whether I should use XSLT 2.0 or straight away workingin on XSLT 3.0 for that task


Currently we have XML documents stored in MarkLogic. I will need to convert those from XML to HTML. (Inside the XML, there is a huge set of custom elements. Moreover the content of the XML is beyond my control. They were imported from 3rd party vendor. New XML elements could be introduced every now and then...) It is a huge operational headache to maintain such transformation.

I want to seek opinion whether I should use XSLT 2.0 or straight away working on XSLT 3.0 for that task.

Since MarkLogic does not support XSLT 3.0, I guess I will need to find a XML transformation service with other server solution. (I could develop the xslt with Oxygen XML Editor with SAXON.) But any idea which server or open source solution supports xslt 3.0?

XSLT 3.0 support in Marklogic xml transformation

It seems the key benefit of using XSLT 3.0 is its streaming conversion feature. Does it mean when loading a big html page with xslt 3.0 could be more responsible and user friendly? What if I pre-process and convert all XML to html. Will that be even faster? I guess if I could pre-process XML to html, will it mean it is OK to use XSLT 2.0?


Solution

  • XML files destined to be converted into HTML are unlikely to be so large that streamed processing is necessary. The threshold is probably around 200Mb. In the Saxon implementation, which is currently the only streaming implementation, streamed processing does not make anything faster, it just makes it use less memory.

    There are of course many XSLT 3.0 features apart from streaming, from minor usability conveniences like text value templates, to major functional enhancements like support for maps, arrays, and JSON. Whether you want to restrict your choice of XSLT processors by taking advantage of such features is something only you can decide - and is actually not considered a valid question for StackOverflow.