AnsweredAssumed Answered

Import XML Document - Help

Question asked by fmdataweb on Feb 26, 2013
Latest reply on Apr 17, 2013 by nrgsoft

Hi,

 

I'm using FileMaker Pro v12 and the BaseElements plugin to retrieve XML data which I'm storing in a variable at present. I then need to parse out the XML into individual records and set the field values along the way. I've only worked with simple XML structures before and I'm getting stuck on this one and also not sure what is the best approach.

 

Here's a sample of the XML:

 

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

<checkRepliesResponse xmlns="http://www.w3.org/1999">

<result returned="2" remaining="0">

<replies>

<reply format="message" uid="96541" receiptId="94211794">

<origin>1212587456</origin>

<received>2013-02-18T22:35:02Z</received>

<content>message 1</content>

</reply>

<reply format="message" uid="8745" receiptId="94721243">

<origin>1212987654</origin>

<received>2013-02-25T11:37:58Z</received>

<content>message 2</content>

</reply>

</replies>

</result>

</checkRepliesResponse>

 

In this example there are 2 records that I need to create and for each record I need to get the value of these elments:

 

uid

receiptId

origin

received

content

 

I could parse the XML but that doesn't seem like the most efficient approach. Should I export it as an xml file somehow and then import it back in using XSLT?

 

If anyone has any examples of how to write a XSLT that can get both attributes and elements at the same time that would be great.

 

What would be the best practice to import the XML?

 

thanks,

Steve

Outcomes