Jump to content

Ok, I am an Idiot - I don't 'get' it!


firefly_777

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

Recommended Posts

  • Newbies

Here's what we've done in the past:

<- CDML Parser <-> FM Unlimited 5 <-> FM Server 5

<- | FM WSC | <---> | FMUlimited | <---> | FM Server |

Apache in Linux, using FM Webserver Connector to parse the CDML. Worked just fine, although three computers in the chain was a bit overkill (more points of failure).

Now, I have learned how to do the following:

<- PHP / FX.php -> FM Server Advanced

<- | FX.php | <-- XML --> | FM Server |

This is cool, because now we have only two machines in the transaction, a DB server, and a web server. How it should be! Awesome! And PHP gives me tons more flexibility than CDML - I can place logic on either side of the transaction.

FX.php is fine, now that I have learned how to utilize it.

My question is this - in SIMPLE terms, how does this XSLT thing work?... I just don't get it. Even though I like FX.php and am happy using it, I would like to understand how this other thing works too! In simple, idiot terms.

So FM Server spits out XML. I get that (FX.php transforms that XML into array variables). Is XSLT just a language like CDML - tags intersparsed w/ HTML? If so, does XSLT require a parser, like Web Server Connector, to convert those tags into values from FileMaker? Is the XSLT parser available as an Apache module, like WSC was?

Or is the XSLT + XML something that some third party thing (like PHP) needs to convert into regular XHTML as output? I've heard about specifying the XSL style sheet in the request URL - what parses the resulting XML + XSL? The browser? Can all modern browsers do that? :

Somebody please break this down for me!

Thanks in advance!

Link to comment
Share on other sites

Most purists would not call XSLT a language but just say that it is. In essense an XSLT file is a set of instructions to take a source XML file and transform it into something else, another format of file:

- an HTML file

- another grammar of XML

- a PDF

- an MS Word file

- an MS Excel file

- an SVG graphic

- ...

There are plenty of sample XSLTs at www.filemaker.com/xml

An example: I have my movie library in an FM7 file. Since I'm lazy I don't want to type in all the data about a movie (name, release data, actors, directors, description, ...). So I wrote an import routine that takes the title of a movie, queries the Amazon web services and retrieves all movies matching the title I sent it. Amazon sends me an XML file in their own grammar. FM understands only one grammar for importing XML so I wrote an XSLT to transform Amazon's grammar into FM's grammar.

Link to comment
Share on other sites

  • Newbies

An example: I have my movie library in an FM7 file. Since I'm lazy I don't want to type in all the data about a movie (name, release data, actors, directors, description, ...). So I wrote an import routine that takes the title of a movie, queries the Amazon web services and retrieves all movies matching the title I sent it. Amazon sends me an XML file in their own grammar. FM understands only one grammar for importing XML so I wrote an XSLT to transform Amazon's grammar into FM's grammar.

Ok, that makes sense - XSLT can define 'rules' for translating one app's XML syntax to another. Hence importing things like Amazon Web Services, iTunes lists, and such, into an XML syntax FileMaker understands. After reading up on XSL a little bit, I kinda understand that at least, I think.

But I'm not interested in importing (yet).

My concern - how does this relate to Web Publishing? I was led to believe that XSLT is supposed to be a replacement for CDML, as far as web publishing with FileMaker is concerned. I understand how CDML works - you create an HTML file, you put CDML tags in it, and then the web server, via a CDML Parser module, queries FileMaker and replaces the CDML tags with the appropriate FileMaker query results.

so this:

<h1>[FMP-Field: somefield]</h1>




Becomes this:




<h1>This was in FileMaker</h1>

after the CDML Parser (FileMaker Web Server Connector) gets through with it and sends it off to the browser.

Does XSLT, or does it not, work like this? That is my question.

FX.php, OTOH, simply passes a URL to FileMaker, FileMaker responds with the results encoded in XML, and FX.php sucks up the XML and parses it into an array variable. So I take it XSLT works with this same FileMaker XML output somehow?

If the XSLT doen't work like CDML, is it supposed to then translate how the resulting FileMaker XML is displayed into something else? And since browsers don't support XML / XSL display natively very well (AFAIK), then I suppose a third party program is supposed to translate the XML / XSL into HTML / CSS for the browser to read? Ack - what good is that? [color:"red"] [color:"blue"]

Link to comment
Share on other sites

Use the FileMaker Site Assistant to help this make sense. It will create the xsl templates for you, which you can then modify.

I have read through the Custom Web Publishing Guide 2 times now. It is beginning to make a little sense to me, but I still could not create my own from scratch.

I do have 3 solutions now. I am able to modify existing xsl, and duplicate existing xsl templates to meet my needs.

If you want to see what I have done, take a look at http://fpas.neenah.k12.wi.us

If you want to look at my xsl templates, I would be happy to send you copies as well.

Great thing is, I now have just 1 XServe that replaced 3 computer before. Everything (FileMaker Pro Server 7, FileMaker Pro Advanced Server, and Apache are all on the one box.

[email protected]

Link to comment
Share on other sites

  • 2 weeks later...

I would recommend two good sources to start with:

FMS7A Custom Web Publishing Guide . Everything is explained there how custom web publishing works with server-side xml --> xslt --> html transformation.

In essence, the scheme described there for CWP is:

(1) Query (sent from Browser) --> (2) Custom Web Publishing Engine (CWPE) --> (3) FileMaker Server 7 Advanced --> (4) XML result tree --> (5) transformation with XSLT done by CWPE --> (6) HTML or anything else --> (7) Apache/IIS --> (8) Browser

As already mentioned, steps (2)-(7) are done server-side with FMS7A and can be done on one server box, but can also be distributed to 2 or 3 servers, e.g. (3,4) and (2,5-7), or even (3,4),(2,5,6),(7).

The book of Michael Kay, XSLT : Programmer's Reference, 2nd ed., Wiley Publishing, ISBN 0-7645-4381 -4, is THE REFERENCE for getting an understanding of XLST and XPath. XPath is needed to address the elements of the XML result tree.

Martin

Link to comment
Share on other sites

If you are familiar with HTML, you probably know what a style sheet is.

Well, in the simplest of terms (and I will probably get blasted for this) think of XSLT as a style sheet for an XML file. The down side is, unless you are sharing an XML file between like (XML aware) programs, you have to use XSLT, either before or during the exchange.

The UP side is, once the data is in XML, the XSLT can transform that XML into virtually anything - even native format - readable and usable by any software.

I have understood the whole concept of XML/XSL since I started reading about it back before it was even a suggested standard. Because of the wide possibilities - and very specific requirements of XSL coding, it has been hard for me to get my teeth around this part of it. It really is a whole programming code like COBOL or FORTRAN or JCS.

IMO, in the next couple of years we will see some 'drag-n-drop' GUI software that will allow us to specify what we want it to do and what we want it to look like and the software will create the XSLT for us - or maybe even analyze an XML file and be able to determine what the XSLT should be (a universal translator?).

Link to comment
Share on other sites

There seem to exist already such products that can connect XML results with the desired final output, e.g. mapforce and stylevision from ALTOVA, although they are quite expensive.

I work with their xmlspy editor, and it really increases productivity of XSLT coding, because XSLT tags and their attributes are popped up during typing.

Martin

Link to comment
Share on other sites

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