Jump to content

xml web site example


rivet

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

Recommended Posts

  • 2 months later...

Well, plain old XML would not produce a very interesting result, asthetically. You'd have to use an XSL stylesheet to transform the XML into a nice looking HTML/CSS/JavaScript page, or you'd have to use some middleware like PHP or ASP to load the XML and then create a meaningful display with the data contained in the XML.

XML is just a format for transporting data - just like a .tab (tab separated) or .csv (comma separated values) file. Only, XML is tag separated. So the real power comes when you use a technology to read in the data from the XML and then create a meaningful display of it.

You may want to check out "FileMaker Pro 6 Developer's Guid to XML/XSL" by Beverly Voth, which has some examples of using XSL to format the XML that FileMaker generates. I don't care much for this book, but it does have a few useful examples. Also, you could try and contact Justin Grewe (who has posted on this forum several times). He seems to have written a few XSL sheets that convert FileMaker's XML into web pages.

XML is frequently used to make FileMaker data available to other applications, many of which create websites. For example, Chris Hansen has written code that allows PHP to get data from FileMaker (the FX.php class, available at www.iviking.org). This allows you to create a web site using PHP, where PHP pulls the dynamic data from FileMaker using XML. I believe he also maintains a short list of websites that use PHP and FileMaker.

Link to comment
Share on other sites

If you are interested in xml/xsl with filemaker, contact me, I have aquired knowledge on this. But it all depends on what kinds of features you are looking for and how concerned you are with security. If you want just a basic website using xml data from filemaker, sure, an xsl stylesheet is your best and quickest option. But if you are like me and need security and lots of features, go with the either php or asp that will enable you to do more.

Justin Grewe

Link to comment
Share on other sites

I need some help... I am new to using XML/XSLT so please be kind smile.gif

I want to import from the web a dataset of latest earthquajes from the USGS. The respond is an xml document which can be found here:

http://earthquake.usgs.gov/recenteqsww/eqs1day-M2.5.xml

I understand that I need to create an XSLT to be able to import the data into FMPro. can someone put me in the right direction how to build the XLST? any demos that could help me out?

Thank you so much!

Otto Krauth

Link to comment
Share on other sites

Hi Otto,

I've attached an example that almost works. It seemed the most basic thing to do was to import each item as a record. This imports the data and creates 16 records. That's good, since there are 16 items. However, it only returns data for the first 3 fields. There is some problem starting at line 70


<xsl:attribute name="MODID">0</xsl:attribute>

<xsl:attribute name="RECORDID">0</xsl:attribute>

<COL><DATA><xsl:value-of select="title"/></DATA></COL>

<COL><DATA><xsl:value-of select="description"/></DATA></COL>

<COL><DATA><xsl:value-of select="link"/></DATA></COL>

<COL><DATA><xsl:value-of select="icbmlatitude"/></DATA></COL>   PROBLEM HERE

<COL><DATA><xsl:value-of select="icbmlongitude"/></DATA></COL>

<COL><DATA><xsl:value-of select="dcsubject"/></DATA></COL>

To make this work the field names should match what's in the xml. So icbmlatitude should be icbm:latitude. But if I put the colons in, it results in an error message during the import:

"Unable to resolve prefix 'icbm'. pattern = 'icbm:latitude'

If it was named something without a colon in the xml, then it would work. Maybe someone who is better at xml can get you the rest of the way there? Mario? Fenton?

Once that's resolved we could make it a little more complex and import the title, date, and other "header" information.

Good luck,

Dan

earthquake.zip

Link to comment
Share on other sites

The xml parser is parsing the colon and so you need to tell it not to parse it. I have had trouble doing this but you can try in the xsl: output, cdata-section-elements = whatever node you need to not parse. I have tried this in the past without any success. I would just rename you fields in filemaker to be web compatible.

Justin Grewe

Link to comment
Share on other sites

Yes indeedy, you can rename them. You don't have to name your FileMaker fields the same as the data in the source XML file (though you would normally keep pretty close), you just have to keep them in the same sequence.

So you can NOT use the namespace colons ("dc:Publisher," "icbm:latititute") in the FileMaker fields, and rename the "item" field names to something that separates them from the others in the 1st block ("ItemTitle," "ItemDescription").

You have to use the colons in the X-Path expressions, because they denote a namespace, which are declared at the top:

"xmlns:icbm="http://postneo.com/icbm/" "xmlns:dc="http://purl.org/dc/elements/1.1/"

FileMaker, however, doesn't seem to like those extraneous namespaces, and its processor doesn't automatically remove them, even when no elements in the xml result reference them.

Fortunately, you can remove them, by using the attribute in the stylesheet element:

exclude-result-prefixes="icbm dc"

It only works if no elements need them, which we fixed by not using the darn things in our field names.

BTW, notice the case differences, which must be used to get the data: dc:Publisher, icbm:latititute, dc:Subject.

And I just learned most of this in the process :-)

earthquake.zip

Link to comment
Share on other sites

  • 3 months later...

I'm new at xml/xlst. I'm proficient at CDML. I'm not understanding where the xslt file goes....(web folder) and how this all ties to getther. The samples that FileMaker provides only work on windows. Viewing XML web sites only work on windows? I need some Help. I have a client that wants to update to 7. 7 does not use CDML. I have been reading the FileMaker Dev 5.5 book on xml. Is there a step by step sample file on how to set up a simple web page on the Mac OSX??

Thank you for your time.

Todd Dignan

Link to comment
Share on other sites

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