XSL for XML Filter output not working as expected

Discussions about using 3rd party extension with OpenOffice.org

XSL for XML Filter output not working as expected

Postby therealdtw » Sat Sep 12, 2015 6:17 am


I have been creating an XSL file to use as a filter to translate a table from a Calc document an xml document that is easier (and smaller) to consume in another application. The problem being my XPath queries don't seem to be working in OO. They work fine using JEdit and oXygen XML editors and XSLT engines using the contents of the content.xml file that is zipped in the .odf file. To try and figure out what was going on I wrote a very small XSL file to see if I could get that to work, and it does not. Is what I am trying to do even possible in OpenOffice Calc?

Any an all help will be greatly appreciated. Thank you for your time.


XSL file:

Code: Select all   Expand viewCollapse view
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" >
   <xsl:strip-space elements="*" />
   <xsl:output method="html" standalone="yes" indent="yes" />
   <xsl:template match="/">
         <p>what - <xsl:value-of select="/office:document-content/office:body/office:spreadsheet/table:table[1]/@table:name" /></p>

Code: Select all   Expand viewCollapse view
<html xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0">
    <p>what - Incidents</p>

Actual output from testing the "XML Filter Settings" screen from testing the XSLT/XML output filter in Calc (Notice the word "Incidents" is missing)
Code: Select all   Expand viewCollapse view
<html xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0">
      <p>what - </p>
OpenOffice 4.1.1 on Windows 7
Posts: 1
Joined: Sat Sep 12, 2015 6:01 am

Re: XSL for XML Filter output not working as expected

Postby Villeroy » Sat Sep 12, 2015 12:56 pm

I'm afraid, on this user forum you won't get qualified advice apart from application hopping. Did you try LibreOffice?
Oh, and since you try to generate html: there is a very well done XHTML export filter for all document types text, sheet, drawing and presentations which is not included in the Windows installer by default. If menu:File>Export... does not offer XHTML re-run the Windows installer to add this filter.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, OpenOffice 4.x & LibreOffice 6.x
User avatar
Posts: 26377
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Return to Extensions

Who is online

Users browsing this forum: No registered users and 2 guests