Jessica Chambers
Jessica Chambers

Reputation: 1316

Filemaker xml export: how to make each row start on a new line?

I'm am a newbie when it comes to xml/xls, but I need to export some records from filemaker as an .xml file. I can manage it that far, but when I open the file, each <ROW> tag is on the same line as the last, which makes it very complicated for me.

Filemaker gives the option of making a stylesheet with a httpd request, but I really don't understand what it expects... If anyone can point me in the right direction, I'll be very thankful.

Upvotes: 0

Views: 138

Answers (3)

Nicolai Kant
Nicolai Kant

Reputation: 1391

A variation on @michael.hor257k answer, using xsl:copy-of instead of xsl:copy

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xalan="http://xml.apache.org/xalan" version="1.0" exclude-result-prefixes="xalan">
    <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" xalan:indent-amount="2" />
    <xsl:template match="/">
        <xsl:copy-of select="." />
    </xsl:template>
</xsl:stylesheet>

Upvotes: 1

Nicolai Kant
Nicolai Kant

Reputation: 1391

Beverly Voth wrote a book on the subject, but FileMaker forums are probably the best place to find information you need.

Majority of xml will not have carriage returns between nodes as they do not matter for the data structure. What you are looking for is "pretty" xml. Some of the editors will display xml as pretty or will give you this an option, e.g Notepad++ xml plugin has it.

If you just need to work out the xml structure and do not have any tools apart from a simple text editor, just batch replace "

Filemaker gives the option of making a stylesheet with a httpd request, but I really don't understand what it expects...

FileMaker does not make XSLT stylesheets, you have to provide one or link to the one available on the web.

Upvotes: 0

michael.hor257k
michael.hor257k

Reputation: 117103

Assuming you just want a "pretty-printed" XML file as the result, use this as your XSLT stylesheet:

<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xalan="http://xml.apache.org/xalan" 
exclude-result-prefixes="xalan">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" xalan:indent-amount="2"/>

<!-- identity transform -->
<xsl:template match="@*|node()">
    <xsl:copy>
        <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
</xsl:template>

</xsl:stylesheet>

Upvotes: 2

Related Questions