In learning to import XML items to Filemaker 13 I've run into a problem using "xsl:for-each" to obtain multiple rows of data for import. The XML I've been using is the W3 Schools Music Example.
The XSL I'm using to convert this XML is as follows:
<?xml version='1.0' encoding='UTF-8'?>
<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>
<FIELD NAME="Title" TYPE="TEXT"/>
<FIELD NAME="Artist" TYPE="TEXT"/>
<FIELD NAME="Country" TYPE="TEXT"/>
<FIELD NAME="Company" TYPE="TEXT"/>
<FIELD NAME="Price" TYPE="NUMBER"/>
<FIELD NAME="Year" TYPE="NUMBER"/>
</METADATA>
<RESULTSET>
<xsl:for-each select="catalog/cd">
<ROW>
<COL>
<DATA><xsl:value-of select="catalog/cd/title"/></DATA>
</COL>
<COL>
<DATA><xsl:value-of select="catalog/cd/artist"/></DATA>
</COL>
<COL>
<DATA><xsl:value-of select="catalog/cd/country"/></DATA>
</COL>
<COL>
<DATA><xsl:value-of select="catalog/cd/company"/></DATA>
</COL>
<COL>
<DATA><xsl:value-of select="catalog/cd/price"/></DATA>
</COL>
<COL>
<DATA><xsl:value-of select="catalog/cd/year"/></DATA>
</COL>
</ROW>
</xsl:for-each>
</RESULTSET>
</FMPXMLRESULT>
</xsl:template>
</xsl:stylesheet>
If I remove the "xsl:for-each" lines, I will reliably get the first record from the XML imported into Filemaker. With the "xsl:for-each" lines in place as shown, I will get 26 blank records. There are 26 items in the XML, which is good, but I'm not getting any data.
As an aside, if the xsl select string is modified to read "catalog/cd/title[4]", which I believe should return the fourth record in the XML, I again get a blank record.
What am I missing here?