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

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

Recommended Posts

Posted

(From Topic #173828) Thank you for your response, what follows is a copy of my FMXMLRESULT along with the customer's requested XML format. You'll notice that they are not complicated and I'm somewhat embarassed that I couldn't figure it out on my own. I'm new to both FileMaker and XML.

FMXMLRESULT.txt

customer.txt

Posted

Yes, it's not very complicated. Because your field names match their element names exactly, there would be a more intelligent generic xsl possible. But this is the simple hard-coded version, which is longer, but easier to understand and modify if needed later:

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

xmlns:fm="http://www.filemaker.com/fmpxmlresult" exclude-result-prefixes="fm">

Posted

OUSTANDING!! Thank you so much. It works like a charm. A couple of follow-up questions: 1)Is there anyway to remove <?xml version="1.0" encoding="UTF-8" ?> from the top or is that the nature of XML? 2)The "fm" portion of "fm:COL[1]/fm:DATA"/>, is that a placeholder that you created or something that you pulled from the FMXMLRESULT?

Can you recommend any books or websites that I can read to find out more about how to create XSL specifically for FileMaker? I have looked but can't seem to find any really good resoures.

I will look over your XSL and see if I can find the "pattern" to create the additional XML's that I need to create.

Thanks again for your help.

Posted

1) The xml declaration is required for real xml. If they don't use it they are weenies ;)-)

2) The "fm" prefix is required to get elements from the FMXMLRESULT "namespace". FileMaker declares this namespace for in its "root" element. It therefore applies to all elements below.

This is an important concept in xml. Everyone is allowed to define a prefix and namespace (which are supposed to be unique, but so far no one is checking). This keeps elements from overlapping.

The classic example is a furniture manufacturer. He wants to use an element

Of course that's about the only instance I can think of offhand. But other elements, such as , etc., could possibly overlap with some other person's xml. Separate namespace declarations and prefixes keep them apart.

The: exclude-result-prefixes="fm" attribute removes the "fm:" prefixes from the resulting xml.

As far as a pattern, I'm not doing anything fancy. I just hard-coded the element names directly in the xsl. Then I used the number of the fm:COL[1] to get the data. If you change the export order it will mix up the data. But it's pretty easy to count the export order, in the METADATA element, from a raw FileMaker xml export file. For larger exports, I copy the field rows from the Metadata section out, and use my text editor's line numbering so I can see what they are.

Posted

Thank you for the response. From the information you provided, I'll begin creating the other XML's today and see what happens. Thank you again.

Posted

I ran this XSLT from my FileMaker database and received errors. I tried to walk through them but they kept coming back. Errors like "Expected end of tag..." Any ideas?

Posted

Here's another one that numbers the fields.

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

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

exclude-result-prefixes="fm" version="1.0">

.

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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