jteich Posted July 19, 2016 Share Posted July 19, 2016 http://jensteich.de/fmfaq/export/xslt-for-simple-cases/ <!-- xslt stylesheet importing xml data into FileMaker for easy cases like: <root> <record> <field1>....</field1> <field2>....</field2> <field3>....</field3> <... any number of fields ... </record> ... any number of records 'root', 'record', 'fieldx' can be any names. ~jens Link to comment Share on other sites More sharing options...
comment Posted July 19, 2016 Share Posted July 19, 2016 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now