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

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

Recommended Posts

Posted (edited)

Hi,

I tried exporting data out from filemaker pro in xml format using FMPXMLRESULT grammar. I designed a xslt document to convert the xml information to be shown in html format. The result needs to be displayed in a table. However it displays the text and ignores the html. I have exported three fields from a table in xml format. In the result, the field data from all the records is displayed but the html is completely ignored. Has anyone experienced it before and can offer some help. I would try to attach my xml and xsl document if you would like to look into it.

Thanks,

--Sanjai

Edited by Guest
added a subject
Posted

Yes, you should probably upload some files. At least upload a raw FMPXMLRESULT Export xml file (ie., don't use an xsl), and also upload your xsl text file. Zip them into the same folder.

It is probably just the way you've added the tags to the xsl. You may also want to specify "html" as the output. An output tag looks like:

(the encoding could also be something else, but "utf-8" is the standard for xml)

Posted

Hi Fenton,

Sorry for the delay. It seemed that I had solved the problem but not the way I wanted to solve. Please see the attached files: helpfilesimple.xml and helpfilesimple.xsl

While exporting the data from FileMaker Pro 7, I had selected the FMPXMLRESULT grammar. The third line in the attached xml file is:

If I remove the namespace portion from the xml file and keep only then my xsl gives the right output. But I don't want any change to be done in the xml file once the data is exported. Could you please have a look on the xsl file to see how I can get the results. You can see the expected results by removing the namespace declaration as I said above.

My second question is do you think that the namespace url is incorrect because if on IE I give the url "http://www.filemaker.com/fmpxmlresult" it gives me page not found. If I try "http://www.filemaker.com/xml/FMPXMLRESULT" then it displays some page.

My third question is do we have any choice to use the fmpresultset grammar? However while exporting I get only two choices FMPXMLRESULT AND FMPXMLLAYOUT.

Thanks for your time and help.

--Sanjai

Web.zip

Posted (edited)

A couple things were wrong, both having to do with namespaces. Which, unfortunately I can't explain very well; but I'll try.

First, this line, in the xml file:

<?xml:stylesheet type="text/xml" href="helpfilesimple.xsl"?>

needs to be:

<?xml-stylesheet type="text/xml" href="helpfilesimple.xsl"?>

No colon, a dash. Colons mean a namespace, and apparently this isn't that kind of thing. The declarations inside the <??> are not xml specific tags, so they don't do namespaces. (Anyone?).

There something similar, but the converse going on in the xsl file. The FileMaker data belongs to the FMPRESULTSET namespace, as specified by this line in the xml:

In the xsl you've explicitly defined the namespace for the xsl tags, with this line:

but you didn't include the FileMaker namespace. It should be in there also:

xmlns:fmp="http://www.filemaker.com/fmpxmlresult">

Notice I gave it its own prefix: "fmp", which I'll then add to each FileMaker specific element, followed by a colon, such as:

Then it gets the data.

Lastly, the URLs specified in the namespace are not really URLs, in the sense that they're on the web somewhere. They don't have to exist at all. They should be unique however, in order to identify a particular namespace.

Help_files.zip

Edited by Guest
Changed files to Unix line endings
Posted

Thanks Fenton,

After reading your message, I can see how namespaces work. However, I tried opening the xml file which you have sent. Though it has the reference of xsl, still it is not rendering the output. It is displayed the xml document itself in the IE v6. Is there any other changes I have to make to see the output? I am on windows so I tried opening the Help_files folder inside the zipped file you had attached.

Could you please let me know if I can use any other way to give the reference of xsl in the xml file. We are using <?xml-stylesheet-type="text/xsl" href=helpfilesimple.xsl?>

Is there any other way to link?

Posted

I'm not sure what's going on. It works fine for me, but I'm on Mac, Safari 1.3.1. I changed the line endings on the uploaded files to Unix. I'm not sure whether they were DOS or Macintosh before (it's hard for me to tell the difference unless I look carefully, as I usually have BBEdit set to automatically translate them).

Posted

Hi Fenton,

I am trying since yesterday but the xml is not rendering the output. I am using the attached two files. Please have a look and see if I am doing something wrong.

Thanks for your time.

--Sanjai

Help_files.zip

Posted

It works fine for me. But as I said, I'm on a Mac. It must be some IE-specific behavior. Did you try it with any other xml application?

Posted

Yes, my old xml files are working fine. Let me check on someone else's machine. Fenton, I had one question if there is any other way we can associate the xsl stylesheet to the xml? In the exercise above, we gave the link in the xml file to use a particular xsl file. Is there any other way to do it?

Posted

Here's the files again, with a slightly different encoding; utf-8 (no bom). Explorer on a Mac likes it better. That is the right way to link an xsl file to an xml file, if that's what you want to do. I don't really know what exactly you're doing with this.

If you were using this to export from FileMaker you wouldn't necessarily link it that way (at least I haven't). You'd specify the xsl explicitly in the Export XML dialog. Then you'd end up with a plain HTML file, already done.

Help_files_prev.zip

Posted

I tried with the new files and it is not giving the output. It is showing the xml code on the browser. Let me investigate for some more time and I will let you know if I can solve it.

I would specify the xsl explicitly in the ExportXML dialog. I just wanted to know for my own curiosity how it works in other web based languages where we don't use FileMaker Pro. Do they dynamically generate the xml with the hard coded xsl link like what we did or is there any other application which could be executed on the web server and associate the xml file to the required xsl. This is not related to this specific post. The problem which I had was with the namespaces and you helped me in understanding how it works.

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