Calc: XSLT 2.0 filter for import

asked 2018-08-21 21:06:09 +0100

updated 2018-08-21 21:31:29 +0100

Hi there.

Need a bit of help with using XSLT 2.0 functions for Calc import, I want to implement fn:replace (which is XSLT 2.0) in one of my filters. While using pure XSLT 1.0 filters all is working fine, but when I register xsl:stylesheet version="2.0"and tick The filter needs XSLT 2.0 processor, xml file opening process returns General Input/Output error. Made some attempts with cdcatalog.xml from https://www.w3schools.com/xml/cdcatal... and with this XSLT filter (for readability I removed other namespaces, they are the taken from content.xml and work fine with XSLT 1.0):


< ?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<office:document-content xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" <office:body="">
    <office:spreadsheet>
      <table:table> 
<xsl:for-each select="catalog/cd"> <table:table-row> <table:table-cell office:value-type="string" calcext:value-type="string"> <text:p><xsl:value-of select="replace(title, 'a','')"/></text:p> </table:table-cell> </table:table-row> </xsl:for-each> </table:table> </office:spreadsheet> </office:body> </office:document-content> </xsl:template> </xsl:stylesheet>

I always get General Input/Output error when trying to apply Replace function. no matter The filter needs XSLT 2.0 processor is enabled or disabled. Changing fn:replace with fn:translate and unticking needs XSLT 2.0 makes things work as expected. Am I missing something obvious in code or in Calc settings?

LO Version: 6.0.4.2 Build ID: 9b0d9b32d5dcda91d2f1a96dc04c645c450872bf CPU threads: 2; OS: Windows 6.1; UI render: default; Locale: en-GB (lv_LV); Calc: group

edit retag flag offensive close merge delete

Comments

NB. There is no first whitespace between < and ? in actual code on the first line <?xml version="1.0" encoding="utf-8"?>, this forum's engine just does not show the line while whitespace is not there.

SM_Riga gravatar imageSM_Riga ( 2018-08-21 21:36:43 +0100 )edit