Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

XML export with XLST results in one long row of data

Featured Replies

Hey Guys
,

I've been going crazy trying to get this work, but just don't know what I'm doing wrong...

This is the xml exported from FM Pro v14

<?xml version="1.0" encoding="utf-8"?>
<FMPXMLRESULT xmlns="http://www.filemaker.com/fmpxmlresult">
  <ERRORCODE>0</ERRORCODE>
  <PRODUCT BUILD="10-26-2015" NAME="FileMaker" VERSION="ProAdvanced 14.0.4" />
  <DATABASE DATEFORMAT="D/m/yyyy" LAYOUT="" NAME="TEST_v02.fmp12" RECORDS="2749" TIMEFORMAT="h:mm:ss a" />
  <METADATA>
    <FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="Shot" TYPE="TEXT" />
    <FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="ShotInCut" TYPE="TEXT" />
    <FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="LustreSrcINFrame" TYPE="NUMBER" />
    <FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="LustreSrcOut" TYPE="NUMBER" />
    <FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="LustreStart" TYPE="TEXT" />
    <FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="LustreEnd" TYPE="NUMBER" />
  </METADATA>
  <RESULTSET FOUND="4">
    <ROW MODID="0" RECORDID="22355">
      <COL>
        <DATA>abc0198</DATA>
      </COL>
      <COL>
        <DATA>abc0198_cpa_v090_ww_v002</DATA>
      </COL>
      <COL>
        <DATA>1016</DATA>
      </COL>
      <COL>
        <DATA>1076</DATA>
      </COL>
      <COL>
        <DATA>98471</DATA>
      </COL>
      <COL>
        <DATA>98531</DATA>
      </COL>
    </ROW>
    <ROW MODID="0" RECORDID="22357">
      <COL>
        <DATA>abc0198</DATA>
      </COL>
      <COL>
        <DATA>abc0198_cpa_v090_ww_v002</DATA>
      </COL>
      <COL>
        <DATA>1016</DATA>
      </COL>
      <COL>
        <DATA>1052</DATA>
      </COL>
      <COL>
        <DATA>98569</DATA>
      </COL>
      <COL>
        <DATA>98605</DATA>
      </COL>
    </ROW>
    <ROW MODID="0" RECORDID="22359">
      <COL>
        <DATA>abc0198</DATA>
      </COL>
      <COL>
        <DATA>abc0198_cpa_v090_ww_v002</DATA>
      </COL>
      <COL>
        <DATA>1016</DATA>
      </COL>
      <COL>
        <DATA>1057</DATA>
      </COL>
      <COL>
        <DATA>98630</DATA>
      </COL>
      <COL>
        <DATA>98671</DATA>
      </COL>
    </ROW>
    <ROW MODID="0" RECORDID="22608">
      <COL>
        <DATA>xyz0570</DATA>
      </COL>
      <COL>
        <DATA>xyz0570_cpa_v0008</DATA>
      </COL>
      <COL>
        <DATA>0</DATA>
      </COL>
      <COL>
        <DATA>26</DATA>
      </COL>
      <COL>
        <DATA>111424</DATA>
      </COL>
      <COL>
        <DATA>111450</DATA>
      </COL>
    </ROW>
  </RESULTSET>
</FMPXMLRESULT>

This is the XLST I Made:

<?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">
    <xsl:for-each select="RESULTSET/ROW">
      <clipitem>
        <name>
          <xsl:value-of select="COL[2]/DATA" />
        </name>
        <in>
          <xsl:value-of select="COL[3]/DATA" />
        </in>
        <out>
          <xsl:value-of select="COL[4]/DATA" />
        </out>
        <start>
          <xsl:value-of select="COL[5]/DATA" />
        </start>
        <end>
          <xsl:value-of select="COL[6]/DATA" />
        </end>
        <file>
          <name>
            <xsl:value-of select="COL[2]/DATA" />
          </name>
          <pathurl>"filepath"</pathurl>
          <timecode>
            <rate>
              <timebase>24</timebase>
            </rate>
            <string>00:00:00:00</string>
            <frame>0</frame>
            <displayformat>NDF</displayformat>
            <source>source</source>
            <reel>
              <name>
                <xsl:value-of select="COL[1]/DATA" />
              </name>
            </reel>
          </timecode>
        </file>
      </clipitem>
    </xsl:for-each>
  </xsl:template>
</xsl:stylesheet>

This is my result:

<?xml version="1.0" encoding="UTF-8"?>0abc0198abc0198_cpa_v090_ww_v002101610769847198531abc0198abc0198_cpa_v090_ww_v002101610529856998605abc0198abc0198_cpa_v090_ww_v002101610579863098671xyz0570xyz0570_cpa_v0008026111424111450

This is what the result should look like:

      <clipitem>
        <name>
          abc0198_cpa_v090_ww_v002
        </name>
        <in>
          1016
        </in>
        <out>
          1076
        </out>
        <start>
          98471
        </start>
        <end>
          98531
        </end>
        <file>
          <name>
            abc0198_cpa_v090_ww_v002
          </name>
          <pathurl>"filepath"</pathurl>
          <timecode>
            <rate>
              <timebase>24</timebase>
            </rate>
            <string>00:00:00:00</string>
            <frame>0</frame>
            <displayformat>NDF</displayformat>
            <source>source</source>
            <reel>
              <name>
                abc0198
              </name>
            </reel>
          </timecode>
        </file>
      </clipitem>
      <clipitem>
        <name>
          abc0198_cpa_v090_ww_v002
        </name>
        <in>
          1016
        </in>
        <out>
          1052
        </out>
        <start>
          98569
        </start>
        <end>
          98605
        </end>
        <file>
          <name>
            abc0198_cpa_v090_ww_v002
          </name>
          <pathurl>"filepath"</pathurl>
          <timecode>
            <rate>
              <timebase>24</timebase>
            </rate>
            <string>00:00:00:00</string>
            <frame>0</frame>
            <displayformat>NDF</displayformat>
            <source>source</source>
            <reel>
              <name>
                abc0198
              </name>
            </reel>
          </timecode>
        </file>
      </clipitem>
      <clipitem>
        <name>
          abc0198_cpa_v090_ww_v002
        </name>
        <in>
          1016
        </in>
        <out>
          1057
        </out>
        <start>
          98630
        </start>
        <end>
          98671
        </end>
        <file>
          <name>
            abc0198_cpa_v090_ww_v002
          </name>
          <pathurl>"filepath"</pathurl>
          <timecode>
            <rate>
              <timebase>24</timebase>
            </rate>
            <string>00:00:00:00</string>
            <frame>0</frame>
            <displayformat>NDF</displayformat>
            <source>source</source>
            <reel>
              <name>
                abc0198
              </name>
            </reel>
          </timecode>
        </file>
      </clipitem>
      <clipitem>
        <name>
          xyz0570_cpa_v0008
        </name>
        <in>
          1016
        </in>
        <out>
          1057
        </out>
        <start>
          98630
        </start>
        <end>
          98671
        </end>
        <file>
          <name>
            xyz0570_cpa_v0008
          </name>
          <pathurl>"filepath"</pathurl>
          <timecode>
            <rate>
              <timebase>24</timebase>
            </rate>
            <string>00:00:00:00</string>
            <frame>0</frame>
            <displayformat>NDF</displayformat>
            <source>source</source>
            <reel>
              <name>
                xyz0570
              </name>
            </reel>
          </timecode>
        </file>
      </clipitem>

 

Edited by justakid

The problem is that you are ignoring the namespace in which Filemaker places the exported elements - see:
http://fmforums.com/topic/98384-issue-with-creating-a-xsl-for-xml-having-namespace/?do=findComment&comment=447288

Note also that the output you are trying to produce is not a well-formed XML document (read: not an XML document at all), since it has no single root element. XSLT will allow it - but I doubt you will be able to do anything useful with it.

 

  • Author

Thanks for pointing me in the right direction comment. I didn't realise it would be this complicated.

1 hour ago, justakid said:

I didn't realise it would be this complicated.

Trust me, this is not complicated.

  • Author
2 hours ago, comment said:

Trust me, this is not complicated.

Sorry...relative to my knowledge :)

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.