3 Replies Latest reply on Jul 29, 2013 11:41 AM by TonyWhite

    Automatically Import Magento XML Data Into FileMaker 11 Natively

    smower

      Hello,

       

       

       

      Has anyone been able to natively script an import into FileMaker from Magento with FileMaker's import via xml data source via http command? I read about the Magento api and wanted to test the import of product data. Their url is something like this:

       

       

       

      http://www.yourdomain.com/api/rest/products

       

       

       

      which returns xml like this:

       

      <?xml version="1.0"?>

       

      <magento_api>

       

      <data_item>

       

      <entity_id>1</entity_id>

       

      <type_id>simple</type_id>

       

      <sku>6405</sku>

       

      <description>This is a shed</description>

       

      <short_description>Lifetime sheds model 6405 features an 8 x 10 foot design. The 6405 is the most popular Lifetime storage shed.</short_description>

       

      <meta_keyword>6405, lifetime shed, lifetime storage shed, lifetime outdoor shed, polyethylene plastic, lifetime products</meta_keyword>

       

      <name>Lifetime Sheds 6405 - Outdoor Storage Shed 8 x 10 Feet</name>

       

      <meta_title>Lifetime Outdoor Sheds 6405 Plastic Storage Shed</meta_title>

       

      <meta_description>Lifetime shed model 6405 for sale featuring an 8x10 dimension and free shipping. Order Lifetime storage sheds model 6405 here and get a low price guarantee.</meta_description>

       

      <regular_price_with_tax>1117.12</regular_price_with_tax>

       

      <regular_price_without_tax>1048.94</regular_price_without_tax>

       

      <final_price_with_tax>1117.12</final_price_with_tax>

       

      <final_price_without_tax>1048.94</final_price_without_tax>

       

      <is_saleable>1</is_saleable>

       

      <image_url>http://www.yourdomain.com/media/catalog/product/cache/0/image/9df78eab33525d08d6e5fb8d27136e95/6/4/6405_lifetime_shed_main_picture.jpg</image_url>

       

      </data_item>

       

      </magento_api>

       

       

       

      This returns xml data about products from the magento site. I wrote a style sheet to import this data like this:

       

       

       

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

       

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

       

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

       

      <xsl:template match="/">

       

      <FMPXMLRESULT xmlns="http://www.filemaker.com/fmpxmlresult">

       

      <ERRORCODE>0</ERRORCODE>

       

      <PRODUCT BUILD="01-25-2011" NAME="FileMaker" VERSION="ProAdvanced 11.0v3"/>

       

      <DATABASE DATEFORMAT="M/d/yyyy" LAYOUT="" NAME="" RECORDS="" TIMEFORMAT="h:mm:ss a"/>

       

      <METADATA>

       

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

       

      <FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="Cost" TYPE="NUMBER"/>

       

      </METADATA>

       

      <RESULTSET>

       

      <xsl:attribute name="FOUND">

       

      <xsl:value-of select="count(magento_api/data_item/sku)"/>

       

      </xsl:attribute>

       

      <xsl:for-each select="magento_api/data_item">

       

      <ROW>

       

      <xsl:attribute name="MODID">0</xsl:attribute>

       

      <xsl:attribute name="RECORDID">0</xsl:attribute>

       

      <COL>

       

      <DATA>

       

      <xsl:value-of select="sku"/>

       

      </DATA>

       

      </COL>

       

      <COL>

       

      <DATA>

       

      <xsl:value-of select="regular_price_with_tax"/>

       

      </DATA>

       

      </COL>

       

      </ROW>

       

      </xsl:for-each>

       

      </RESULTSET>

       

      </FMPXMLRESULT>

       

      </xsl:template>

       

      </xsl:stylesheet>

       

      I ran this stylesheet on the data and it made an xml document that FileMaker could import from the harddrive.

       

      However, when I run an automatic script to import it where I specify the http request and reference the stylesheet file, I get the error: 'XML/XSL information is not enough to proceed with the import/export.

       

      Does anyone know how I can get this to work NATIVELY? I am using FileMaker Pro Advanced 11.

       

      Thanks in advance!

       

      Shawn