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

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

Recommended Posts

  • Newbies
Posted

All the examples I'm finding online and in my books seem to assume that I want to take xml, process it with an xslt, and create html output. (Even this XML forum is under the 'Publising FM Online' heading). Of course, xml isn't just for creating html output. What I'm having trouble with (beyond some really basic stuff) is taking xml, processing it with an xslt, and creating a new form of xml as my output.

To be more specific, I need to export output from FM (using FMPDSORESULT style), and use an xslt to turn it into an xml file that can be read by another program.

Can anyone point me in the right direction? Thanks!

Posted

Well, instead of HTML tags ... you use XML tags.

Instead of <xsl:output method="html" encoding="UTF-8"/> as a top-level element in your XSLT, you use <xsl:output method="xml" encoding="UTF-8"/>

Have a look at http://www.filemaker.com/products/technologies/xslt_library.html , you will find also examples for XML exporting. And have a look at the excellent book of Beverly Voth, FileMaker Pro 6 : Developer's Guide to XML/XSL, Wordware Publishing.

Posted

It is true that there is a difference between using XSL for strictly conversion, from (or to) FileMaker to (or from) another format or arrangement, and using it online. But there is also quite a bit of overlap in the techniques. I imagine xml/xsl is in the "Online" forum because that is the mainstream use. Most of us read "All Posts," so it doesn't matter much where it is.

There are a few posts here on using XSL for conversion. It's been a little while however. Since each is unique, you might want to post a sample of what the final result should look like (just a couple "records" worth, and only a few fields). And perhaps a small plain xml export from your FileMaker file. (I mostly use the fmpxmlresult format myself however. You might want to upload a small sample of your FileMaker file, zipped.)

Beverly Voth has written a book with an emphasis on just how to do this, both dso and xml.

http://www.amazon.com/exec/obidos/tg/detail/-/155622043X/102-5818944-6732958?v=glance

Is is also possible that you might want to import from the external files sometime? If so you'd want to use fmpxmlresult, which seems a little more abstract at first, but is much the same to work with.

Exporting with an xml result is different from an html result, but there are many things the same.

  • Newbies
Posted

Thank you for the good replies. I just placed an order for the book. Is there a way to write an XSLT sheet that calls to a specific field in FMP? The examples I've seen seem to loop through every field. Also, an example of fields ending up in a element and an attribute would be helpful. Thanks again.

Posted

If it is possible one would want to write the xsl to loop through every field being exported, using a general test. This is seldom easy (or reasonable) when trying to match someone else's xml however. You limit which fields are exported from FileMaker, so you should not have to pick and choose in the xsl (in this case). It is more tedious to target each field specifically. But that is often what you have to do. Because of things like you say, the result has attributes which get the field contents sometimes.

Once you've got an xml element you can add an attribute with the attribute element (duh :-). You must add the attribute before you add the element's contents.

<their element name>

Posted

Hi, Matthew! You can download ALL the examples from the book: "http://www.moonbow.com/xml/". As Martin and Fenton have said, you can _output_ as HTML, XML or TEXT.

If you use the FMPDSORESULT, you can reference the fields by name:

'<xsl:value-of select="fm:FirstName" />

If you use the FMPXMLRESULT, you can reference the fields by the column order of the export:

'<xsl:value-of select="fm:COL[3]"/fm:DATA" />

Many of us use the FMPXMLRESULT a bit more, because it's the only grammar that can be used for _import_ into FileMaker Pro.

One of my examples show how to take the FMPDSORESULT and convert it into FMPXMLRESULT. Maybe the examples will help!

This topic is 7121 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.