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 to XML. Need help creating XSL Style Sheet

Featured Replies

 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 by Nestor

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>

 

  • 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

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?

 

 

  • Author

No Worries,  Thank you for your help.

yes the goal is to export more than one order at a time. 

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

  • Author

Great.  Thank you.  this will get me started.

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.