AnsweredAssumed Answered

XML Newbie with a complex file to work with

Question asked by keithstehlik on Aug 28, 2017
Latest reply on Aug 30, 2017 by beverly

Hi all

I just got tasked with importing xml files into filemaker. Each file will is equal to one record in Filemaker that will need to be updated. The xml files will be updated every time something is changed on their end.

I am a total newbie at this but do know I have to create a XSLT Stylesheet to transform it. I created a new file to learn the basics on this with just 4 fields in it, Customer, JobDiscription, JobNumb and Printer. The first problem is several of the field seem to have multiple instances in the XML and I am not sure how to get the one I want.

This is a sample of the xml document with the 4 item I want to print highlighted in yellow. Both customer and printer are in different repetitions of CustomerInfo.

 

Here is the start of the code I have. Can someone help me out a little?

 

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

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

<xsl:template match="/">

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

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

<METADATA>

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

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

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

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

</METADATA>

<RESULTSET>

<ROW>

<COL>

<DATA><xsl:value-of select="customerInfo/contact/company/@OrganizationName"/></DATA>

</COL>

<COL>

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

</COL>

<COL>

<DATA>1225</DATA>

</COL>

<COL>

<DATA>sospc</DATA>

</COL>

</ROW>

</RESULTSET>

</FMPXMLRESULT>

</xsl:template>

</xsl:stylesheet>

 

Thanks

Keith

Outcomes