rivet Posted November 21, 2003 Posted November 21, 2003 does anyone have a sample of a FMP webiste using XML and not CDML?
Mariano Peterson Posted February 2, 2004 Posted February 2, 2004 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.
Justin Grewe Posted February 3, 2004 Posted February 3, 2004 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
okrauth Posted February 3, 2004 Posted February 3, 2004 I need some help... I am new to using XML/XSLT so please be kind 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
DanBrill Posted February 3, 2004 Posted February 3, 2004 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
Justin Grewe Posted February 3, 2004 Posted February 3, 2004 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
DanBrill Posted February 3, 2004 Posted February 3, 2004 The trouble seems to be with the names in the source xml, no in FM. I'd rename them if I could, but they're a product of the US Government. Go figure.
Fenton Posted February 4, 2004 Posted February 4, 2004 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
okrauth Posted February 4, 2004 Posted February 4, 2004 Thanks guys... I am bit lost here... so how would my XSLT file look like? I've only been trying out the XML demo that comes with FMP6 otto
Fenton Posted February 4, 2004 Posted February 4, 2004 Here's a FileMaker file with an import script to pull the data straight from the web site. It also has a Unicode XSLT file (rather than a Mac one, which probably was a mess on Windows; if this one's a mess, you may want to get a Unicode-aware text editor). earthquake.zip
Fenton Posted February 4, 2004 Posted February 4, 2004 okrauth. Download the files. The XSLT file is in there (twice). It's just a text file ending with .xslt
DanBrill Posted February 4, 2004 Posted February 4, 2004 Thanks Fenton. Think of how much you learn more about xlst because of me. Dan
Fenton Posted February 4, 2004 Posted February 4, 2004 It's true. And you did much of the work setting up the page. XSL can be a bit tedious.
Newbies rich_78 Posted May 22, 2004 Newbies Posted May 22, 2004 does anyone agree they should have kept it in?
Todd Dignan Posted May 28, 2004 Posted May 28, 2004 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
Recommended Posts
This topic is 7485 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 accountSign in
Already have an account? Sign in here.
Sign In Now