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: Shirley Gasch <sgasch@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 9 Mar 2006 15:18:16 -0500
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. 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.

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

<?xml version="1.0" encoding="ISO-8859-1"?>
<?xslt-cwp-query param="-grammar=fmresultset&-process"?>
<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
	xmlns:fmrs="http://www.filemaker.com/xml/fmresultset";
	exclude-result-prefixes="xsl fmrs">

<xsl:output method="html" encoding="ISO-8859-1"/>

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

<head>
<title>ESMO Configuration
Modification Request Home Page</title>
<body bgcolor="#FFFFFF"
link="#000099" alink="#3DC7FF" vlink="#003366"
background="../images/stma_bkg.gif">
<meta name="description"
content="ESMO Configuration Modification Request
Home Page"/><meta name="rno"
content="Angelita.C.Kelly.1"/><meta
name="orgcode" content="423"/><meta
name="content-owner"
content="Guy.R.Cordier.1"/><meta name="robots"
content="noindex, nofollow"/><meta
name="MSSmartTagsPreventParsing"
content="TRUE"/><basefont size="3"
face="Helvetica,Arial,geneva,sansserif"/>
</head>
<frameset cols="100%" frameborder="1">
<noframes><body bgcolor="#FFFFFF"
link="#000099" alink="#3DC7FF" vlink="#003366"
background="../images/stma_bkg.gif">
<h1 align="center"><img
src="../images/hotnasa.gif" alt="NASA Logo"
width="100" height="59" align="bottom"
longdesc="NASA Logo"/></h1>


<h1 align="center">ESMO Configuration Modification Request</h1>

		<p align="center"><xsl:text
disable-output-escaping="yes">&amp;nbsp;</xsl:text></p>



		</body>
		</noframes>
  		<frameset cols="16%,64%" frameborder="1">
     		<frame src="waivernav.xsl"
name="a" marginwidth="0" marginheight="0"
frameborder="1" title="Navigation Area"/>
     		<frame src="waiverhome.xsl"
name="b" marginwidth="0" marginheight="0"
frameborder="1" title="ESMO Configuration
Modification Request Home Page"/>
  		</frameset>
		</frameset>
		</html>

	</xsl:template>
</xsl:stylesheet>

Here is an abbreviated version of the
waivernav.xsl page - with the onclick issue: (it
has two forms in in - for the first two buttons
on the page)

<?xml version="1.0" encoding="ISO-8859-1"?>
<?xslt-cwp-query param="-grammar=fmresultset&-process"?>
<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
	xmlns:fmrs="http://www.filemaker.com/xml/fmresultset";
	exclude-result-prefixes="xsl fmrs">

<xsl:output method="html" encoding="ISO-8859-1"/>

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

			<head>
				<base target="right"/>
				<title>Navigational Menu</title>
				<meta
name="GENERATOR" content="Claris Home Page 3.0"/>
				<x-claris-window
top="52" bottom="1043" left="283" right="1369">
					<x-claris-tagview mode="full">

	<meta name="description" content="ESMO
Configuration Modification Request Navigational
Menu"/><meta name="robots" content="noindex,
nofollow"/><meta name="MSSmartTagsPreventParsing"
content="TRUE"/><basefont size="3"
face="Helvetica,Arial,geneva,sansserif"/>

	</x-claris-tagview></x-claris-window></head>
			<body bgcolor="#FFFFFF"
link="#000099" alink="#3DC7FF" vlink="#006600"
background="../images/cbws.gif">
				<Center>
					<table
border="0" width="100%" summary="A layout table
to select area to navigate to.">
					<tr>

<td align="center">

	<form method="post"
name="CreateCMR"><xsl:attribute
name="action">waivernew.xsl</xsl:attribute>

	<p><input type="button" name="CreateLg"
value="Create  CMR"><xsl:attribute
name="onclick">window.top.b.location.href='WaiverNew.xsl?-db=WebWaivers&amp;-
lay=Normal</xsl:attribute></input></p>




<p><input type="hidden" name="-db" value="WebWaivers"/>


<input type="hidden" name="-lay" value="Normal"/>

	<input type="hidden" name="-token.error"
value="new_error.xsl"/>

	<input type="Submit" name="-view"
value="Create New CMR"/>


</p> </form></td>

					</tr>
					<tr>
						<td align="center">

				<form
method="post" name="SearchforCMR"><xsl:attribute
name="action">waiversearch.xsl</xsl:attribute>

					<p><input
type="hidden" name="-db" value="WebWaivers"/>

	<input type="hidden" name="-lay"
value="Normal"/>

	<input type="hidden" name="-token.error"
value="search_error.xsl"/>

	<input type="Submit" name="-view"
value="Search"/>


</p></form></td>




						</table>
				</Center>


</body> </html>

	</xsl:template>
</xsl:stylesheet>


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.

Thanks.

Shirley Gasch

On 3/8/06, Shirley Gasch <sgasch@xxxxxxxxxxxxxxxxxxxxx> wrote:
 Thanks for replying Michael. I still don't know
 what to do to achieve the result that I want.
 What can add to the XSLT that I have below (in
 the form) to make sure that the resultant page
 comes up in the right-hand frame???

You don't have XSLT in a form. The XSLT creates the form that will be used. This might sound like I'm being picky, but I'm really not. The concepts are different and treating them the same will cause issues.

Look at the guidelines for this list (mailed to you when you joined)
and it suggests providing the source for the transformation as well as
the expected output (and perhaps the current output that is wrong that
you are getting now).   This is necessary since often we end up giving
wrong advice because we're forced to guess part of the process.

In other words, for a source you have ???, I'm not really sure.  Is it
an XML file?  Are you calling the Filemaker process directly on some
data?

But lets look at what you want...

Assuming it's static and your output type is html in the style sheet, to get

<TD ALIGN=center id=srch abbr="Search for a CMR">
            <P><INPUT TYPE=button NAME=SearchSyLg VALUE="Search  CMRs
"
onclick="window.top.b.location.href='FMPro?-db=WebWaivers.fp5&-lay=Normal&-f
ormat=WaiverSearch.htm&-view';return
true;"></P>
         </TD>

in the result html just have it in the XSLT at an appropriate place in
the templates.  You'll have to escape those & (by using & amp ;
without the spaces).

Of course, since you're cleaning it up you could target xhtml as an
output format (not sure if the following would be valid xhtml), so

<td align="center" id="srch" abbr="Search for a CMR">
            <p><input type="button" name="SearchSyLg" value="Search  CMRs
"
onclick="window.top.b.location.href='FMPro?-db=WebWaivers.fp5&amp;-lay=Norma
l&-format=WaiverSearch.htm&amp;-view';return
true;"></p>
         </td>

Of course, if you're typing this out the long way, you can do
<xsl:element name="form">
<xsl:attribute name="'method'"> select="'post'">
 <xsl:attribute name="'name'">SearchforCMR</xsl:attribute>
<xsl:attribute name="action">waiversearch.xsl</xsl:attribute>

....

and so on.

Here, like the other cases, you are creating an element that will be
in your output xml and defining attributes.  It doesn't have any magic
knowledge of this is an "action" attribute or that the element is a
form attribute.  It just knows you told it to create an element in the
output called form with a list of attributes.

Of course, if these forms aren't static but should be generated from
the XML, you'll actually have to show us the XML in order for us to
guess what should be happening.

A rough and poor analogy to your question: I need to get to New York,
New York.  What do to my train to make it behave like New York?

We responded with the question: Where are you starting from? A train
is just a way to get to point A to point B.  If you want something
that behaves like New York, go to New York.

A stylesheet just takes some input and produces an output, the same
way a train just goes from point A to point B.  Tell us where you're
coming from, where you mistakenly end, the route you attempted, and
the end destination you want and we might be able to help you pick the
right train.  (Just to carry this analogy further.  Really, give us
the source xml, the stylesheet, the actual output, the desired output.
 And of course trim it up a little so just the relevant bits for the
problem at hand for each step are shown)


Jon Gorman

-- Shirley Gasch Phone: (301) 794-2164 Computer Sciences Corporation Fax: (301) 794-8355 7700 Hubble Drive, Rm N384 Lanham/Seabrook, Md. 20706 email: sgasch@xxxxxxx

Current Thread