Re: [xsl] Getting Frames to work properly (was How do I convert the use of onclick in HTML to work in XSLT?)

Subject: Re: [xsl] Getting Frames to work properly (was How do I convert the use of onclick in HTML to work in XSLT?)
From: "Jon Gorman" <jonathan.gorman@xxxxxxxxx>
Date: Thu, 9 Mar 2006 15:29:28 -0600
On 3/9/06, Shirley Gasch <sgasch@xxxxxxxxxxxxxxxxxxxxx> wrote:
> I am using the updated output from a CDML
> Converter provided by Filemaker Pro. It takes
> CDML (Claris Design Markup Language) and produces
> XSLT output which is what is used by Filemaker
> Pro 7 and 8.

Hmmm, I've seen some questions about the Filemaker program that makes
me wonder exactly how they're using XSLT.  Perhaps there is someone
who's used the system more that can help.  I'll try to help below.
Right now though it looks like you're dealing with far too many layers
though.  You need to seperate them out so you can figure out what is
not working.  Look into stand-alone processors like Saxon or xsltproc.

When I don't put the buttons in a
> form, nothing happens when they are selected.
> When they are in a form, the correct pages are
> brought up and everything works well. When I
> attempted to go back to frames, that is where I
> attempted to put the onclick feature back in .  I
> put in the html that you suggested, but the page
> was not brought up. It was brought up by the
> second button (in the form), but was not in a
> frame.

You need to check the final output against the desired output


>
> Here is an abbreviated version of the default.xsl page:

Hate to nitpick, but there is no such thing as a  "xsl page".  Here's
the process:

XML -XSLT -> HTML.
           ^
           |
          stylesheet.

The XSLT processor takes in the stylesheet and the XML output and
produces a HTML page.  After seeing the whole stylesheet, we might not
need to just because you use it to just produce one chunk of text.

Bad analogy time.  For example, imagine a mathematical function that
when applied to two numbers always returned three.  We'll use # to
represent it.  1 # 3 = 3, 4959959 # 2131231 = 3 and so on.  You might
as well just do

<xsl:template match="/"> foo</xsl:template>

It doesn't matter what the input is, this always creates a text file
with the word foo.  Given this case, it seems a bit bizarre to use the
stylesheets.

I'm not sure why you are bothering with xsl:attribute in the manner
you are.  If everything is going to be as the text appears, just do
 <form method="post"
name="CreateCMR" action="waivernew.xsl">


<xsl:template match="/fmrs:fmresultset">

This template will produce the output that is inside it for each
fmrs:fmresultset that is a child of the document root.  There's
probably only one of these, but it could read match="/"  or
match="fmrs:fmresultset".

I don't notice any value-ofs or apply-templates.  This is an oddity.
Since I don't know the filemaker system I don't know why you are doing
this.

Lets go with a very quick and dirty example of a case where we might
have some html pages that we recast as xml sources with an xsl
stylesheet.

I have an extremely simple notecard collection.  One html page = one
notecard.

Some examples:

<html>
<head><title>On Serving Man</title></head>
<body><p>It's a cookbook!!!!</p></body>
</html>

<html>
<head><title>On Sewing Man</title></head>
<body><p>It is on sewing, probably should have a comma in the title.
</p></body>
</html>

I decide that to better capture the semantic meaning to have this xml

<notecard>
<title>On Serving Man</title>
<note>It's a cookbook!!!!</note>
</notecard>

Now to create the stylesheet.  A key point here: It can be applied to
ANY the notecard xml docs to produce the HTML page.

<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:output method="html"/>
<xsl:template match="/">
<html>
<head><title><xsl:value-of select="title"/></title></head>
<body>
<xsl:apply-templates />
</body>
</html>
</xsl:template>

<xsl:template match="title" />

<xsl:template match="p">
<p><xsl:apply-templates /></p>
</xsl:template>

</xsl:stylesheet>

So if I call an xslt processor using the above stylesheet for the
first xml sample, it produces
<html>
<head><title>On Serving Man</title></head>
<body>
<p>It's a cookbook!!!!!</p>
</body>
</html>

XSL is used to transform, and once it has done that, it's done.
Without knowning your source xml or the final results, it's hard to
guess what is going on.

> Hope this helps to explains where I am coming
> from  and where I want to be (as well as where I
> mistakenly end up). Sorry to not explain better
> in the beginning. Although I am beginning to
> learn some XSLT, I find it a bit daunting since I
> need to translate 19 web sites and get them up
> and running in XSLT.

My advice is to actually try to learn XSLT, not just create 19
stylesheets and randomly play with them until they work.  For
starters, you might just need one or two stylesheets.

So how do you learn XSLT?  There's a couple good books out there, as
well as some not so good books.  I learned from an alright book.  But
I learned more by reading briefly through the XSLT 1.0 spec, and then
going through some tutorials online and through easy examples in this
lists FAQ and working with creating simple examples.  Also, I used a
simple transformation process until I understood enough how the
processor worked to use it in a more complex environment (browsers
count as a complex environment, and the process you are describing
sound even more complex).

I'd also recommend doing some googling to find other people who use
some of these parts with FileMaker.

Jon Gorman

Current Thread