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.

Export from FM with XSL and XSL for import on my own site

Featured Replies

I have such a headache ........

 

OK, so I want to export records from my database which I will upload as an XML file to my own website. I then will have users download the file and import into a runtime I provide them.

 

Sssooo .... I want the XML export formatted (basically) as :

<?xml version="1.0" encoding="UTF-8"?>
<ImageLoader>
  <Users>
    <User>
      <MerchantId>ANZE9ULNDLIJJ</MerchantId>
      <Status>No</Status>
      <PaidTillDate>1/28/2013</PaidTillDate>
    </User>
  </Users>
</ImageLoader>

I'm using this xsl to export :

<!-- Added so no one wants to delete the post
File: custom_delim.xsl

Transforms data in FMPXMLRESULT grammar into a text file with the
specified characters as field and record delimiters.

Note that it is possible to choose field and record delimiters
that would result in an exported file that FileMaker Pro can no
longer import.

Copyright © 2002 FileMaker, Inc.
All rights reserved.

Redistribution and use in source and binary forms, with or
without modification, are permitted provided that the following
conditions are met:

* Redistributions of source code must retain the above copyright
  notice, this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright
  notice, this list of conditions and the following disclaimer in
  the documentation and/or other materials provided with the
  distribution.

* Neither the name of the FileMaker, Inc. nor the names of its
  contributors may be used to endorse or promote products derived
  from this software without specific prior written
  permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    
===============================================================
-->
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:fmp="http://www.filemaker.com/fmpxmlresult"
  exclude-result-prefixes="fmp">
<xsl:output method = "xml" indent = "yes" encoding = "UTF-8" omit-xml-declaration = "no" version="1.0" />
<xsl:template match="fmp:FMPXMLRESULT">
<ImageLoader>
  <Users>
  <xsl:for-each select="fmp:RESULTSET/fmp:ROW">
    <User>
      <MerchantId><xsl:value-of select="fmp:COL[1]/fmp:DATA" /></MerchantId>
      <Status><xsl:value-of select="fmp:COL[2]/fmp:DATA" /></Status>
      <PaidTillDate><xsl:value-of select="fmp:COL[3]/fmp:DATA" /></PaidTillDate>
    </User><xsl:value-of select="$newrecord"/>
  </xsl:for-each>
  </Users>
</ImageLoader>
</xsl:template>
    <!--  
Variable "newrcord" inserts a carraige return
    -->
<xsl:variable name="newrecord">
<xsl:text>
</xsl:text>
</xsl:variable>
</xsl:stylesheet>

No major issues I'm aware of but I'm open to criticism/advice on the exported xml or the xsl.

 

Then trying to use this for importing :

<!-- Added so no one wants to delete the post
File: custom_delim.xsl

Transforms data in FMPXMLRESULT grammar into a text file with the
specified characters as field and record delimiters.

Note that it is possible to choose field and record delimiters
that would result in an exported file that FileMaker Pro can no
longer import.

Copyright © 2002 FileMaker, Inc.
All rights reserved.

Redistribution and use in source and binary forms, with or
without modification, are permitted provided that the following
conditions are met:

* Redistributions of source code must retain the above copyright
  notice, this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright
  notice, this list of conditions and the following disclaimer in
  the documentation and/or other materials provided with the
  distribution.

* Neither the name of the FileMaker, Inc. nor the names of its
  contributors may be used to endorse or promote products derived
  from this software without specific prior written
  permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    
===============================================================
-->
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"/>
    <xsl:template match="/">
        <FMPXMLRESULT xmlns="http://www.filemaker.com/fmpxmlresult">
            <ERRORCODE>0</ERRORCODE>
            <PRODUCT BUILD="" NAME="" VERSION=""/>
            <DATABASE DATEFORMAT="M/d/yyyy" LAYOUT="" NAME="" RECORDS="1" TIMEFORMAT="h:mm:ss a"/>
            <METADATA>
                <FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="MerchantId" TYPE="TEXT"/>
                <FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="Status" TYPE="TEXT"/>
                <FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="PaidTillDate" TYPE="TEXT"/>
            </METADATA>
            <RESULTSET>
                <xsl:attribute name="FOUND">1</xsl:attribute>
                <xsl:for-each select="fmp:ImageLoader/fmp:Users/fmp:User">
                    <ROW>
                        <xsl:attribute name="MODID">0</xsl:attribute>
                        <xsl:attribute name="RECORDID">1</xsl:attribute>
                        <COL>
                            <DATA>
                                <xsl:value-of select="MerchantId"/>
                            </DATA>
                        </COL>                    
                        <COL>
                            <DATA>
                                <xsl:value-of select="Status"/>
                            </DATA>
                        </COL>
                        <COL>
                            <DATA>
                                <xsl:value-of select="PaidTillDate"/>
                            </DATA>
                        </COL>
                    </ROW>
                </xsl:for-each>
            </RESULTSET>
        </FMPXMLRESULT>
    </xsl:template>
</xsl:stylesheet>

 

1. As to the exporting ............. How do I add ... or do I even need to ... style to my export stylesheet ?

 

2. I want to store the xsl on my site and use it from there to import.

 

Test links :

http://www.sellersolutionsplus.com/SSP_Users/ImageLoader/SSP_Paid.xsl
http://www.sellersolutionsplus.com/SSP_Users/ImageLoader/SSPImageLoaderUsers.xml

 

Issue ..... I'm getting an empty import set. (No records)

 

I'm sure this is something obvious but I'm not seeing the problem ............

 

Thanks and Happy New Year to everyone

 

 

 

Need to delete the line

 

<xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"/>

 

in the xsl to use as an import

works when that is done

  • Author

Thanks for the reply John ....

 

Need to delete the line

<xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"/>

Not sure how I missed this but done ....

 

Not working though and a different error now :

 

Unable to resolve prefix 'fmp'.

pattern =

'fmp:ImageLoader/fmp:Users/fmp:User'(C:UsersBobApp..... ???????

15, 63)

Remaining tokens: ()

 

1. I hate how I can't read the full error description here !!

 

2. I've been fooling with this for a while now ................. $%^#^@#$% !!

 

Time for dinner .............. I'm sure it's obvious but I'm not seeing it.

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.