June 3, 201510 yr I have a xml export via XSLT working successfully to generate the correct XML file. I've noticed the XML file has no indenting which makes it hard to read - I was wondering if there's an easy way to include the indenting in the result xml file as part of the XSL file? Here's what the XML looks like now: <rss version="0.91"><channel><title>Latest News</title><link>http://localhost/</link><description>Recent news articles</description><language>en-us</language><item><title>Slashdot</title><link>http://slashdot.org/</link><description>News for Nerds, stuff that matters</description></item></channel></rss> I would like it to look like this: <rss version="0.91"> <channel> <title>Latest News</title> <link>http://localhost/</link> <description>Recent news articles</description> <language>en-us</language> <item> <title>Slashdot</title> <link>http://slashdot.org/</link> <description>News for Nerds, stuff that matters</description> </item> </channel></rss> Here's what the XLS file looks like: <xsl:stylesheet xmlns:fmp="http://www.filemaker.com/fmpxmlresult" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.1" exclude-result-prefixes='fmp' > <xsl:output method="xml" doctype-public="rss" doctype-system="http://www.scripting.com/dtd/rss-0_91.dtd" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:template match="fmp:FMPXMLRESULT"> <rss version="0.91"> <channel> <title>Latest News</title> <link>http://localhost/</link> <description>Recent news articles</description> <language>en-us</language> <xsl:for-each select="fmp:RESULTSET/fmp:ROW"> <item> <title><xsl:value-of select="fmp:COL[1]/fmp:DATA" /></title> <link><xsl:value-of select="fmp:COL[2]/fmp:DATA" /></link> <description><xsl:value-of select="fmp:COL[3]/fmp:DATA" /></description> </item> </xsl:for-each> </channel></rss> </xsl:template> </xsl:stylesheet>
June 3, 201510 yr I've noticed the XML file has no indenting Yes, that is (yet another) quirk of the Xalan processor. You need to add the following attribute: xalan:indent-amount="2" to the <xsl:output> element and: xmlns:xalan="http://xml.apache.org/xalan" to the <xsl:stylesheet> element. Then change: exclude-result-prefixes='fmp' to: exclude-result-prefixes='fmp xalan' Edited June 3, 201510 yr by comment
January 21, 20178 yr I always pipe output through cat data.fmpxmlresult.xml | tidy -i -xml -wrap 0 -utf8 for indenting If you export just a couple of hundred records white space does not really matter, but when you exceed a couple of thousands pr day, size actually makes a difference. Edited January 21, 20178 yr by ggt667
February 15, 20178 yr If you are doing transfers across http, make sure you enable gzip in nginx or similar. If you are able to, i e Edited February 15, 20178 yr by ggt667
Create an account or sign in to comment