Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

can I use the cdml that was converted


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

Recommended Posts

Posted

I converted some cdml files with filemakers convert cdml to xsl. On my web-page I have a textarea to type words into and beside that another textarea field then a submit and clear button below. A person goes to the site, enters some words in the first textarea, then selects submit. When submit is selected I want to have the info which was entered placed in my database and perfom a script. Then my database makes calculations etc. on this and places the ending results in another global field in my db. I then want to bring my results back to my page and place them in the second textarea.

Should I be able to use the converted cdml file with the forms as is?

Am I going to have to add a record to bring the info to the db in order to do my calculations and to push my results back to my web page?

Thanks,

Doug

Posted

Actually this is the only page when I used cdml other than an error page. I attached the file as well. May be easier to read. I will attach the cdml version in the next message.

&lt?xml version="1.0" encoding="ISO-8859-1"?&gt

&lt?xslt-cwp-query param="-grammar=fmresultset"?&gt

&ltxsl:stylesheet version="1.0"

xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

xmlns:fmrs="http://www.filemaker.com/xml/fmresultset"

xmlns:fmxslt="xalan://com.fmi.xslt.ExtensionFunctions"

exclude-result-prefixes="xsl fmrs fmxslt"&gt

&ltxsl:output method="html" encoding="ISO-8859-1"/&gt

&ltxsl:template match="/fmrs:fmresultset"&gt

&lt!-- CDML CONVERTER WARNING: A CGI query on this page was missing the -lay parameter. A -lay parameter has been added with the value 'AllFieldsLayout'. --&gt

&ltxsl:variable name="default-record" select="/fmrs:fmresultset/fmrs:resultset/fmrs:record[1]"/&gt

&lt!-- CDML CONVERTER WARNING: The tag "DOCTYPE" has been removed. --&gt

&lthtml&gt

&lthead&gt

&ltmeta http-equiv="content-type" content="text/html;charset=iso-8859-1"/&gt

&lttitle&gtPhonotactic Probability Calculator Page&lt/title&gt

&ltlink rel="stylesheet" href="http://www.parsons.lsi.ku.edu/biphones/biphones.css" type="text/css"/&gt

&lt/head&gt

&ltbody&gt

&lttable width="640" border="0" cellspacing="2" cellpadding="2" align="center"&gt

&lttr align="center" valign="top"&gt

&lttd colspan="2"&gt &lth1&gtCALCULATE PHONOTACTIC PROBABILITY&lt/h1&gt

&lthr color="#0000FF" noshade="noshade"/&gt&lt/td&gt

&lt/tr&gt

&lttr&gt

&lttd width="33%" align="left" valign="top"&gt

&ltform method="post" name="CalcForm" id="CalcForm"&gt&ltxsl:attribute name="action"&gt/fmi/xsl/biphones/calc.xsl&lt/xsl:attribute&gt

&ltinput type="hidden" name="-token" value="{$default-record/@record-id}"/&gt

&ltinput type="hidden" name="-db" value="biphones.fp7"/&gt

&ltinput type="hidden" name="-lay" value="CGI"/&gt

&ltinput type="hidden" name="-token.error" value="biphones-error.xsl"/&gt

&ltinput type="hidden" name="-recid" value="{$default-record/@record-id}"/&gt

&ltinput type="hidden" name="-script" value="CalculateWords"/&gt

&ltinput type="hidden" name="-edit" value="Run Script"/&gt

&ltlabel for="inputcalc"&gtType or copy and paste your data here. &ltbr/&gt

&lttextarea name="AllWords" cols="25" rows="15" id="inputcalc"&gt&ltxsl:value-of select="$default-record/fmrs:field[@name = 'AllWords']/fmrs:data[1]"/&gt&lt/textarea&gt

&lt/label&gt

&ltp&gt&ltinput type="submit" name="-edit" value="Calc your Entry"/&gt&lt/p&gt

&lt/form&gt

&ltform method="post" name="ClearButton"&gt&ltxsl:attribute name="action"&gt/fmi/xsl/biphones/calc.xsl&lt/xsl:attribute&gt

&ltinput type="hidden" name="-db" value="biphones.fp7"/&gt

&ltinput type="hidden" name="-token" value="{$default-record/@record-id}"/&gt

&ltinput type="hidden" name="-lay" value="CGI"/&gt

&ltinput type="hidden" name="-token.error" value="biphones-error.xsl"/&gt

&ltinput type="hidden" name="-recid" value="{$default-record/@record-id}"/&gt

&ltinput type="hidden" name="-script" value="ClearForm"/&gt

&ltinput type="hidden" name="-edit" value="Run Script"/&gt

&ltinput type="submit" name="-edit" value="Clear your Entry"/&gt

&lt/form&gt

&lt/td&gt

&lttd width="67%" align="left" valign="top"&gt

&ltform method="post" name="CalcForm" id="CalcForm"&gt&ltxsl:attribute name="action"&gt/fmi/xsl/biphones/calc.xsl&lt/xsl:attribute&gt

&ltinput type="hidden" name="-token" value="{$default-record/@record-id}"/&gt

&ltinput type="hidden" name="-lay" value="CGI"/&gt

&ltinput type="hidden" name="-db" value="biphones.fp7"/&gt

&ltinput type="hidden" name="-token.error" value="biphones-error.xsl"/&gt

&ltinput type="hidden" name="-content" value="{$default-record/fmrs:field[@name = 'Output']/fmrs:data[1]}"/&gt

&ltinput type="hidden" name="-text" value="/biphones/biphones.fp7"/&gt

&ltinput type="hidden" name="-edit"/&gt

&ltlabel for="outputcalc"&gtThe results of your calculation are displayed here. You may copy and

paste results to another program for further analysis.&ltbr/&gt

&lttextarea name="outputtextfield" cols="64" rows="18" wrap="virtual" id="outputcalc"&gt&ltxsl:value-of select="$default-record/fmrs:field[@name = 'Output']/fmrs:data[1]"/&gt&lt/textarea&gt

&lt/label&gt

&lt/form&gt

&lt/td&gt

&lt/tr&gt

&lt/table&gt

&lt/body&gt

&lt/html&gt

&lt/xsl:template&gt

&lt/xsl:stylesheet&gt

Posted

By the way, thanks again Martin. Your help is very much appreciated as always!

Here is the cdml version, it is attached as well:

&lt!DOCTYPE htm PUBLIC "-//w3c//DTD htm 4.0 transitional//EN"

"http://www.w3.org/tr/REC-htm40/loose.dtd" /&gt

&lthtml&gt

&lthead&gt

&ltmeta http-equiv="content-type" content="text/html;charset=iso-8859-1"&gt

&lttitle&gtPhonotactic Probability Calculator Page&lt/title&gt

&ltlink rel="stylesheet" href="http://www.parsons.lsi.ku.edu/biphones/biphones.css" type="text/css" /&gt

&lt/head&gt

&ltbody&gt

&lttable width="640" border="0" cellspacing="2" cellpadding="2" align="center"&gt

&lttr align="center" valign="top"&gt

&lttd colspan="2"&gt &lth1&gt CALCULATE PHONOTACTIC PROBABILITY&lt/h1&gt

&lthr color="#0000FF" noshade&gt&lt/td&gt

&lt/tr&gt

&lttr&gt

&lttd width="33%" align="left" valign="top"&gt

&ltform action="FMPro" method="post" name="CalcForm" id="CalcForm"&gt

&ltinput type="hidden" name="-Token" value="[FMP-CurrentRecID]"&gt

&ltinput type="hidden" name="-db" value="biphones.fp5"&gt

&ltinput type="hidden" name="-lay" value="CGI"&gt

&ltinput type="hidden" name="-format" value="/biphones/calc.html"&gt

&ltinput type="hidden" name="-error" value="/biphones/error.html"&gt

&ltinput type="hidden" name="-recid" value="[FMP-currentrecid]"&gt

&ltinput type="hidden" name="-script" value="CalculateWords"&gt

&ltinput type="hidden" name="-edit" value="Run Script"&gt

&ltlabel for "inputcalc"&gtType or copy and paste your data here. Press [Enter]

after each line. &ltbr /&gt

&lttextarea name="AllWords" cols="26" rows="15" id="inputcalc"&gt[FMP-Field: AllWords]&lt/textarea&gt

&lt/label&gt

&ltp&gt&ltinput type="submit" name="-Edit" value="Calc your Entry"&gt

&lt/p&gt

&lt/form&gt

&ltform action="FMPro" method="post" name="ClearButton"&gt

&ltinput type="hidden" name="-db" value="biphones.fp5"&gt

&ltinput type="hidden" name="-Token" value="[FMP-CurrentRecID]"&gt

&ltinput type="hidden" name="-lay" value="CGI"&gt

&ltinput type="hidden" name="-error" value="/biphones/error.html"&gt

&ltinput type="hidden" name="-format" value="/biphones/calc.html"&gt

&ltinput type="hidden" name="-recid" value="[FMP-currentrecid]"&gt

&ltinput type="hidden" name="-script" value="ClearForm"&gt

&ltinput type="hidden" name="-edit" value="Run Script"&gt

&ltinput type="submit" name="-edit" value="Clear your Entry"&gt

&lt/form&gt

&lt/td&gt

&lttd width="67%" align="left" valign="top"&gt

&ltform action="FMPro" method="post" name="CalcForm" id="CalcForm"&gt

&ltinput type="hidden" name="-Token" value="[FMP-CurrentRecID]"&gt

&ltinput type="hidden" name="-DB" value="biphones.fp5"&gt

&ltinput type="hidden" name="-error" value="/biphones/error.html"&gt

&ltinput type="hidden" name="-Format" value="/biphones/calc.html"&gt

&ltinput type="hidden" name="-content" value="[FMP-Field: Output]"&gt

&ltinput type="hidden" name="-text" value="/biphones/biphones.fp5"&gt

&ltinput type="hidden" name="-edit"&gt

&ltlabel for="outputcalc"&gtThe results of your calculation are displayed here. You may copy and

paste results to another program for further analysis.&ltbr /&gt

&lttextarea name="outputtextfield" cols="64" rows="18" wrap="virtual" id="outputcalc"&gt[FMP-Field: Output]&lt/textarea&gt

&lt/label&gt

&lt/form&gt

&lt/td&gt

&lt/tr&gt

&lt/table&gt

&lt/body&gt

&lt/html&gt

Posted

Here is how this is suppose to work: my database has single letter and 2 letter combinations. For a single letter I may have a value between a-z, A-Z, etc. for 2 letter combos I might have values of ab, ac, ad etc.. Also for each single and 2 letter combo there are 17 values, so this will work for words with a length up to 17 characters. Depending on which position the letter is in the word, is the value that is needed. So if an individual enters "cat" and selects the "calc your entry" button, "c" is in position 1 therefore I need the first value in my database in the record where "c" is located, "a" is in position 2 therefore I need the second value in my database in the record where "a" is located and "t" is in position 3 therefore I need the third value in my database in the record where "t" is located. Then I do the same for the 2 letter combinations. So in this case "ca" then "at". I place the values found in a different global text field in my database. After all said and done I want to bring the information from the 2nd global field back to my web site and place it in the 2nd textarea.

There are 2070 combinations in my database because I use some special characters as well.

They can then enter more words and do it all again or whatever.

Thanks,

Doug

Posted

Oops, you forgot the ; after the & lt or & gt, that's why your code looks a little strange.

I don't see for the moment a problem (well, it's late here in Europe), but I will take your page tomorrow and just try if it would work with an example db on our server (and do some cleanup with an XML editor).

One question: In order to get a value for record-id, you have to get first a record out of the database. This you do by setting a variable default-record in the XSLT to the first record of your result set.

Now, to get this record/these records , you have to call this form page with a query. Could there be a problem with the query, so that you don't get a record? Then your XML result tree would contain a 401 error, but because you don't test for the error in this page, nothing shows up.

For debugging add a line

<textarea rows="10" cols="80"><xsl:copy-of select="."/></textarea> directly after the body tag. This shows the XML result tree.

Another problem could be with calc.xsl.

Posted

Thanks Martin, here is what I get after placing that piece of cody after the body:

This comes up when starting from my index.xsl page which is listed below:

&lt:fmresultset xmlns="http://www.filemaker.com/xml/fmresultset" version="1.0"&gt

&lt:error code="958"/&gt Which is Missing Parameter (*)

&lt:product build="08/12/2004" name="FileMaker Web Publishing Engine" version="7.0v3"/&gt

&lt:datasource database="" date-format="" layout="" table="" time-format="" timestamp-format="" total-count="0"/&gt

&lt:metadata/&gt

&lt:resultset count="0" fetch-size="0"/&gt

&lt:/fmresultset&gt

This comes up if I start at calc.xsl instead of index.xsl:

&lt:fmresultset xmlns="http://www.filemaker.com/xml/fmresultset" version="1.0"&gt

&lt:error code="101"/&gt Which is Record is Missing

&lt:product build="08/12/2004" name="FileMaker Web Publishing Engine" version="7.0v3"/&gt

&lt:datasource database="" date-format="" layout="" table="" time-format="" timestamp-format="" total-count="0"/&gt

&lt:metadata/&gt

&lt:resultset count="0" fetch-size="0"/&gt

&lt:/fmresultset&gt

Here is my index.xsl page that could initially call calc.xsl:

&lt:?xml version="1.0" encoding="ISO-8859-1"?&gt

&lt:?xslt-cwp-query param="-grammar=fmresultset"?&gt

&lt: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"&gt

&lt:xsl:output method="html" encoding="ISO-8859-1"/&gt

&lt:xsl:template match="/fmrs:fmresultset"&gt

&lt:html&gt

&lt:head&gt

&lt:meta http-equiv="content-type" content="text/htm;charset=iso-8859-1"/&gt

&lt:title&gtPhonotactic Probability Home Page&lt:/title&gt

&lt:link rel="stylesheet" href="biphones.css" type="text/css"/&gt

&lt:/head&gt

&lt:body&gt

&lt:center&gt

&lt:h1&gtPHONOTACTIC PROBABILITY&lt:/h1&gt

&lt:hr width="640" color="#0000FF" noshade="noshade"/&gt

&lt:p&gt&lt:xsl:text disable-output-escaping="yes"&gt

Posted

Now, I am a little bit confused: which code is calc.xsl, and what's the file name of the page with the submit forms?

Then: did you copy the files cdml2xsl_includes.xsl and cmdl2xsl_utilities.xsl to the biphones directory?

I think the problem is really the query, when you call the submit forms page from index.xsl.

So you should do a find on a record in index.xsl, e.g. change the link to:

<a href="http://xxx.xxx.xxx.xx/fmi/xsl/biphones/calc.xsl?-grammar=fmresultset&-db=biphones.fp7&amp;-lay=CGI&-max=1&-findany" alt="Link to the BiPhones Homepage.">Begin Calculation</a>

Posted

Hi Martin, thanks once again,

Sorry about that, I am wanting to use the link you gave me in a simple index.xsl page to call calc.xsl. Inside of calc.xsl are the forms with the submit button. But instead of submit it is called "Calc your entry". The "Calc your entry" button is what I am wanting to execute in order to bring the text entered on the web site to my database and run a script and then push one value back to my web page. The text I bring into my database is placed in a global text field called "AllWords" and the ending result after my script is ran is also placed in global text field "Output" in my database. It is that ending result in the field "output" I want to bring back to the web page. I attached index.xsl, calc.xsl and the database biphones.fp7

I placed the href in the index.xsl page as you suggested and I get this error:

The entity name must immediately follow the & in the entity reference.

(XML-0067)

File index.xsl

Line 36

Column 78

Which is right after fmresultset&

Any suggestions?

Where would I find these 2 files?

cdml2xsl_includes.xsl and cmdl2xsl_utilities.xsl

-----------

On a separate note I am trying a similar link. I am wanting a person to select a link that already contains the search criteria. I want it to find the criteria and display the results of Contact, Institution and Email address on the next page which is peoplefound.xsl. So I tried the following:

It gives me the same error as my link above. On this page I have 7 links just as above but each one searching for a different institution.

Actually, I am trying to use a narrow downed version your multiple.xsl and multiple2.xsl files which demonstrated searching and adding a record. You had posted these files for an individual earlier this year.

Instead of multiple.xsl and multiple2.xsl my files are called: index.xsl (which will have about 7 links if I can get 1 figured out) and peoplefound.xsl (to display the found names) respectively.

But as I said I get the same error but right after "echo&"

So it probably is the same silly error but not sure. I can not figure this out.

I have also attached this index.xsl, peoplefound.xsl and the echo.fo7 database.

I also attached the multiple.xsl, multiple2.xsl and the database that goes with it.

I seem to have trouble attaching these files. I am trying to attach a xxxxxx.sit file.

The file size is only 36 KB.

If the file does not get attached you are more than welcome to email me directly at: [email protected]

If you would have the time and wouldn't mind looking at them I woud appreciate it very much.

Thanks for all your assistance,

Doug Hull

Posted

Another bug report to send in to FMI.

In the CWP Guide, it's stated that global fields and -edit in the query don't need -recid as parameter. This did not work, and I always got a 958 error (parameter missing in query). The -recid is needed.

The good news, however, is, that a simple -find does the job and sets the global field, so one does not need -recid.

In the attachment you find a working biphones solution (without DB). Some comments on it:

- In the FMSA Web Publishing Administration console, you have to enable the Database sessions in the XSLT settings. Otherwise your global fields will not be retained during a web session.

- everything changed to UTF-8 encoding

- the link in index.xsl just contains a plain -grammar=fmresultset&-process part.

- error.xsl is not necessary (that's why I was mislead with cdml2xsl_utilities.xsl and cdml2xsl_includes.xsl - these files are produced by the CDML2XSLT conversion tool and include routines for the former -error=something.html query parameter in CDML). Deleted it.

- for global fields in queries, .global must be appended to the field name (but not in the XML result tree)

- For clearing the global field, the ClearForm script is not needed. Just the empty global field can be passed.

- Because the -find has no search parameters, all records are returned. However, the display is restricted with -max=1 to the first one.

Besides now learning how globals work in XSLT, i learned a new HTML tag: LABEL !

Thanks, Martin

biphones.zip

Posted

Thanks Martin for all your help,

I now have database sessions in the fmsa web pub admin console set to enable.

As far as biphones, after entering my text and selecting "Calc your entry", I definitely can see that it does what I am after by looking in the xml result tree. The "Output" variable in my database contains the correct results. But I am not able to place the database value of "Output" back on my web page.

As far as the echo site, it does do the find and display the info.

If you have any more ideas, I would appreciate your assistance,

Doug

Posted

Hmmm!

After enabling database sessions I selected "restart publishing engine" and I also restarted filemaker server admin.

Then I even tried shutting everything down, even my computer and I started all back up and still have the same problem.

If you have anymore suggestetions please let me know.

Thanks again for your help,

Doug

Posted

Ok, probably it's this: The Apache performance cache of the web site must be turned off, if the Apache web server has to serve dynamic (database-driven) pages. Otherwise you would get back always a cached page, in this case calc.xsl with terms that were entered the first time.

Open the Mac OS X Server Admin Tool, after connection to the server select web service, goto settings, Tab Sites, double-click the site in question, Tab options, turn off performance cache. Save.

Posted

I think I am there. I will let you know for sure later.

Thank you so much for all of your time and help and for all the help you give others on this forum,

Doug

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