Jump to content
Server Maintenance This Week. ×

Transforming FM's xml output to a different format


Thirdwaver

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

Recommended Posts

This need I have seems so common that I can't believe that a two day combing of the Internet has turned up dry. My need is fairly simple. I'm making a charting application in Flex that is using FMPro as a datasource. I retrieve the data I need via URL. Filemaker is returning results like this:
















	

	

	











	

		02/01/2007

	



	

		02/01/2007

	



	

		321A

	





{...repeats record tag over and over...}





But what I want is this:

















	

	

	













	

		02/01/2007

	



	

		02/01/2007

	



	

		321A

	

	



I'm fairly certain this is accomplished with XSL, but I'm no XSL programmer. Does someone have a cookie cutter XSL document that does this? Am I missing something?

Thanks in advance for any guidance

Sean

Link to comment
Share on other sites

Unfortunately, there's no such thing as a a cookie cutter XSL document - a stylesheet has to be tailor-made. Now the question is, how much of that Filemaker mumbo-jumbo do you really need for your charting app? It's easier to work with the minimum requirements, instead of minimum changes.

For example, if you could do with the result of:

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





02/01/2007





02/01/2007





321A







your stylesheet could be as simple as:




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



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









































Link to comment
Share on other sites

The minimal requirements are fine as is the sample you provided. The code you provided did not work, however. Was I supposed to substitute anything in your code with some specifics from my solution? The output you showed is exactly what I want but when I tried to export or use it via the web, all I get returned is:

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

Thanks again for your help! I'm all thumbs when it comes to XSL and I feel like I'm actually getting close to overcoming this roadblock with your help.

Sean

Link to comment
Share on other sites

It works as a transformation stylesheet. I am not sure where exactly in your chain you are trying to apply it. If this were a direct export from Filemaker, you could specify a XSL sheet to apply during the export (it would have to be a slightly different sheet, though - because the XML export format is different).

Here, I just took your source and my stylesheet, and fed them to a XML processing application (TestXSLT), receiving the above result.

Link to comment
Share on other sites

Well, I tried two methods:

1) I placed the source code you provided in a text file called "test.xsl" and placed it in the xslt-template-files folder. Then I called my url like this:

http://webserver.domain.com/fmi/xsl/tasks/test.xsl?-grammar=fmresultset&-db=dbasename&-lay=&layoutname&Date_Opened=2/1/2007&Date_Opened.op=gte&-find




The browser returned:




XML Parsing Error: no element found

Location: http://webserver.domain.com/fmi/xsl/tasks/test.xsl?-grammar=fmresultset&-db=dbasename&-lay=&layoutname&Date_Opened=2/1/2007&Date_Opened.op=gte&-find

Line Number 3, Column 1:

2) I tried going to Filemaker directly, locating the records in a found set then exporting them and specifying the "test.xsl" file as the stylesheet and that didn't work either (probably for the reasons you mentioned).

Any ideas?

Thanks so much!

Sean

Link to comment
Share on other sites

I am afraid I can't help you with the first method, because I don't have access to a server, so I am not able to recreate your attempt. Perhaps someone else might clear this up.

If the second option is a viable one, I will try and modify the sheet to fit that.

Link to comment
Share on other sites

Unfortunately, it's the first method that I need to use. My flex charting tool will get it's data via an xml query via the web. Automating an export (method two) would be quite a pain. Thanks for the help though! I know I'm getting close :

Sean

Link to comment
Share on other sites

Hi:

I am also trying to connect a Flex solution to data hosted by FileMaker Server Advanced (8.0), but I am having problems in generating correctly the request from Flex.

Can you please explain us what Flex code are you using to request data from FMSA8. I have tried mx:HTTPService

(mx:HTTPService id="grillaService" url="(http://192.168.1.102/fmi/xml/fmresultset.xml?-db=sincopy&-lay=Grillas_Posicion&-findall)")

but I get many errors.

Thanks in advance for your help.

Link to comment
Share on other sites

  • 5 months later...

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