Jump to content
Server Maintenance This Week. ×

Import XSLT for easy cases


jteich

This topic is 2836 days old. Please don't post here. Open a new topic instead.

Recommended Posts

You have way too much code - most of it will be ignored during the import.

You also have a line that shouldn't be there:

FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="FeldName" TYPE="TEXT"/>

 

The entire stylesheet could be shortened to just:
 

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/*">
    <FMPXMLRESULT xmlns="http://www.filemaker.com/fmpxmlresult">
        <METADATA>
            <xsl:for-each select="*[1]/*">
                <FIELD name="{name()}"/>
            </xsl:for-each>
        </METADATA>
        <RESULTSET>
            <xsl:for-each select="*">
                <ROW>
                    <xsl:for-each select="*">
                        <COL><DATA><xsl:value-of select="."/></DATA></COL>
                    </xsl:for-each>
                </ROW>
            </xsl:for-each>
        </RESULTSET>
    </FMPXMLRESULT>
</xsl:template>
 
</xsl:stylesheet>

(assuming version 11 or higher).

In fact, it could be shortened even further, but that's for another occasion.

 

Link to comment
Share on other sites

This topic is 2836 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.