XSL for XML Filter output not working as expected

Discussions about using 3rd party extension with OpenOffice.org
Post Reply
therealdtw
Posts: 1
Joined: Sat Sep 12, 2015 6:01 am

XSL for XML Filter output not working as expected

Post by therealdtw »

Hello!

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.

David

XSL file:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	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" >
	
	<xsl:strip-space elements="*" />
	<xsl:output method="html" standalone="yes" indent="yes" />
	
	
	<xsl:template match="/">
		<html>
		<body>
			<p>what - <xsl:value-of select="/office:document-content/office:body/office:spreadsheet/table:table[1]/@table:name" /></p>
		</body>
		</html>
	</xsl:template>
	
</xsl:stylesheet>
EXPECTED output

Code: Select all

<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">
  <body>
    <p>what - Incidents</p>
  </body>
</html>
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

<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">
   <body>
      <p>what - </p>
   </body>
</html>
OpenOffice 4.1.1 on Windows 7
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: XSL for XML Filter output not working as expected

Post by Villeroy »

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 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Post Reply