June 25, 201510 yr SalesOrder_MagentoSales.xsd SalesOrder_MagentoSales.xsdHi and thanks in advance if you are reading my issue. I have data in filemaker that i need to export to XML so my ERP system can pull it in and create a Sales order. I have the XML Schema and also have a sample XML of what it should look like. The missing piece is i don't have a XSL style sheet and not sure where to start or how to create one. I been looking a many sites and many post, but feel I'm getting more confused than anything else. Can somebody point me in the right direction or possibly help me create the XSL Style sheet? I'm a visual person and have tried looking for videos or instructions, but not luck yet. The ERP system we're using is Microsoft AX 2012 R2 and will be using an AIF port to pull the XML to create the order. Any help would be appreciate it.. Attached is the XML Schema and the XML sample and the FM database with the data. Thank you SalesOrder_MagentoSales.xsd B2B_MagentoOrder.xml ExternalOrders.zip Edited June 25, 201510 yr by Nestor
June 25, 201510 yr Try this as your starting point: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ord="http://schemas.microsoft.com/dynamics/2008/01/documents/SalesOrder" exclude-result-prefixes="ord"> <xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"/> <xsl:template match="/"> <FMPXMLRESULT xmlns="http://www.filemaker.com/fmpxmlresult"> <METADATA> <FIELD NAME="ItemId" TYPE="TEXT"/> <FIELD NAME="Price" TYPE="NUMBER"/> <FIELD NAME="Qty" TYPE="NUMBER"/> </METADATA> <RESULTSET> <xsl:for-each select="//ord:SalesLine"> <ROW> <COL><DATA><xsl:value-of select="ord:ItemId"/></DATA></COL> <COL><DATA><xsl:value-of select="ord:SalesPrice"/></DATA></COL> <COL><DATA><xsl:value-of select="ord:SalesQty"/></DATA></COL> </ROW> </xsl:for-each> </RESULTSET> </FMPXMLRESULT> </xsl:template> </xsl:stylesheet>
June 25, 201510 yr Author So I took the sample above and added the rest of fields, and tried exporting out of FIlemaker but I get no data. I'm sure I'm missing a bunch of the basics on this. any ideas what all I'm missing. thank you template.xsl xml test.xml XML.txt
June 25, 201510 yr Oh no. I am afraid I totally misread your post: I thought you wanted to import the data into Filemaker. Of course it's not going to work for exporting, sorry about that. Will you ever export more than one order in the same XML document?
June 25, 201510 yr Author No Worries, Thank you for your help. yes the goal is to export more than one order at a time.
June 25, 201510 yr In such case, I would suggest you export from the Orders table, and include fields from the line items table in the field export order. Have a look at the attached example. Note that a field's position if the field export order is used to identify it for the purposes of getting data from it. If you change it, you must also adjust the field's ordinal number (in square brackets) when referring to it in the stylesheet. Compressed file.zip
Create an account or sign in to comment