Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 4738 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I don't know a lot about XML, but I need to export records in XML format similar to this:

<?xml version="1.0"?> <DemandForce ...>

<Business ...> <Extract .../> <Firmographics .../> <Customer ...>

<Demographics firstName=”Sam” lastName=”Beckett” middleName=”A” salutation=”Mr.” gender=”1” birthday=”1980-19-05T00:00:00” address1=”777 Millenium Way” address2=”Apt8” city=”Quantum” state=”AZ” zip=”89089” countryCode=”US” email=”[email protected]” workPhone=”4085551111” homePhone=”4085552222” cellPhone=”4085553333” otherPhone1=”4085554444” otherPhone2=”4085555555” pager=”4085556666” instantMessage=”yahoo:sambeckett” alias=”Sammy”/>

<Transaction .../>

<Transaction .../>

<Transaction .../>

<Appointment ...>...</Appointment> <Appointment ...>...</Appointment> ...

<Appointment ...>...</Appointment> </Customer>

<Customer ...>...</Customer> <Customer ...>...</Customer>

<Customer ...>...</Customer> </Business>

</DemandForce>

The only data that is in my FileMaker database is what is in quotes above. All the other data is the XML schema.

Without building all the XML schema using calculations or scripting is there a way to export the records in this format using the Export to XML?

I can pay anyone for their time if they can help me with this.

Posted

Without building all the XML schema using calculations or scripting is there a way to export the records in this format using the Export to XML?

Yes. You need to write a XSLT stylesheet to transform the default Filemaker XML grammar into yours during the export.

The only data that is in my FileMaker database is what is in quotes above.

Why don't you export a sample record or two as XML (using FMPXMLRESULT grammar and no stylesheet), zip the resulting file and attach it here?

Posted

Thank you for the reply comment.

I found this tutorial on how to create the XSLT stylesheet. I can now get the data from the parent table to export how I want. I can also get related fields to export, but it will only export the first related record. The tutorial says that you can export all related records, but I am having trouble with it.

Here is the example XSLT stylesheet from the tutorial:

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

<xsl:stylesheet version='1.0'

xmlns:xsl='http://www.w3.org/1999/XSL/Transform'

xmlns:fm="http://www.filemaker.com/fmpdsoresult"

exclude-result-prefixes="fm">

<xsl:output version='1.0' encoding='UTF-8' indent='yes'

method='xml' />

<xsl:template match="/">

<customers>

<xsl:for-each select="fm:FMPDSORESULT/fm:ROW">

<customer>

<xsl:attribute name="ID"><xsl:value-of select="./fm:ID" /></xsl:attribute>

<name><xsl:value-of select="./fm:Name" /></name>

<city><xsl:value-of select="./fm:City" /></city>

<orders>

<xsl:for-each select="./fm:ID_Orders_CustomerID.OrderID/fm:DATA">

<order>

<xsl:attribute name="ID"><xsl:value-of select="." /></xsl:attribute>

</order>

</xsl:for-each>

</orders>

</customer>

</xsl:for-each>

</customers>

</xsl:template>

</xsl:stylesheet>

The part in green font is the section for exporting related records. After looking at the example files here (converting them to .fp7) the part "ID_Orders_CustomerID.OrderID" appears to be how they get from one TO to the other.

"ID" is the field in the parent table used in the relationship

"Orders" is the second TO

"CustomerID" is the field in the child table used in the relationship

"OrderID" is the field in the child table that is to be exported

I have tried this with my database replacing "ID_Orders_CustomerID.OrderID" with my TO's and fields, but it I cannot get it to work.

Please help.

Posted

I am afraid you are confusing me. First you said:

The only data that is in my FileMaker database is what is in quotes above.

and all I see in quotes above is data describing a customer. Now you say have orders too - but I don't see where their data is supposed to go in the resulting XML document.

A stylesheet needs to fit what you have on one end and the required XML schema on the other end. At this point, neither one is clear to me.

Posted

This problem has been resolved. I found contact information for the author of the tutorial I was using and she was very nice and helpful.

If anyone else comes across this problem I would be happy to help them.

Posted

I found contact information for the author of the tutorial I was using and she was very nice and helpful.

As it happens, Beverly Voth is also a member of this forum.

I usually shrug these thing off, but I think it's worth mentioning that the replies you have received here were nice too - and they could have been helpful if you had been more forthcoming.

Posted

not sure I like etutorials STEALING my book and posting on line. Come on! You can buy if for $3.00 on Amazon...

Posted

Thank you for all the replies. I know I could have gotten it figured out with help from the forum. Unfortunately, when I start a project all I think about 24/7 is that project, which leads me to investigate all leads I can find. I hope you did not take my comment that I would help other people to mean that I was not getting help from the forum. I simply meant I know the basics of it now and could help others.

Posted

I hope you did not take my comment that I would help other people to mean that I was not getting help from the forum.

No, I was referring to the fact that you have completely ignored two requests for clarification. That wasn't very nice of you, but - as I said - usually I just shrug and move on. After all, such behavior reflects upon you, not me.

But when you waltz in 3 days later and announce you have a solution because you have found someone nice and helpful - well, that does imply something. Like "why bother with you yokels when it's clear you haven't got a clue."

In fact, I wonder why did you bother to post here at all. Right now, this thread contains neither a question nor an answer.

This topic is 4738 days old. Please don't post here. Open a new topic instead.

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.