ddhull Posted May 31, 2005 Posted May 31, 2005 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
ddhull Posted May 31, 2005 Author Posted May 31, 2005 I also meant to say when I select submit, I get no errors but no results either. Thanks again, Doug
Martin Brändle Posted May 31, 2005 Posted May 31, 2005 Can you post the two XSLT files, e.g. the one with the form submission and the result page?
ddhull Posted June 1, 2005 Author Posted June 1, 2005 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. <?xml version="1.0" encoding="ISO-8859-1"?> <?xslt-cwp-query param="-grammar=fmresultset"?> <xsl: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"> <xsl:output method="html" encoding="ISO-8859-1"/> <xsl:template match="/fmrs:fmresultset"> <!-- CDML CONVERTER WARNING: A CGI query on this page was missing the -lay parameter. A -lay parameter has been added with the value 'AllFieldsLayout'. --> <xsl:variable name="default-record" select="/fmrs:fmresultset/fmrs:resultset/fmrs:record[1]"/> <!-- CDML CONVERTER WARNING: The tag "DOCTYPE" has been removed. --> <html> <head> <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"/> <title>Phonotactic Probability Calculator Page</title> <link rel="stylesheet" href="http://www.parsons.lsi.ku.edu/biphones/biphones.css" type="text/css"/> </head> <body> <table width="640" border="0" cellspacing="2" cellpadding="2" align="center"> <tr align="center" valign="top"> <td colspan="2"> <h1>CALCULATE PHONOTACTIC PROBABILITY</h1> <hr color="#0000FF" noshade="noshade"/></td> </tr> <tr> <td width="33%" align="left" valign="top"> <form method="post" name="CalcForm" id="CalcForm"><xsl:attribute name="action">/fmi/xsl/biphones/calc.xsl</xsl:attribute> <input type="hidden" name="-token" value="{$default-record/@record-id}"/> <input type="hidden" name="-db" value="biphones.fp7"/> <input type="hidden" name="-lay" value="CGI"/> <input type="hidden" name="-token.error" value="biphones-error.xsl"/> <input type="hidden" name="-recid" value="{$default-record/@record-id}"/> <input type="hidden" name="-script" value="CalculateWords"/> <input type="hidden" name="-edit" value="Run Script"/> <label for="inputcalc">Type or copy and paste your data here. <br/> <textarea name="AllWords" cols="25" rows="15" id="inputcalc"><xsl:value-of select="$default-record/fmrs:field[@name = 'AllWords']/fmrs:data[1]"/></textarea> </label> <p><input type="submit" name="-edit" value="Calc your Entry"/></p> </form> <form method="post" name="ClearButton"><xsl:attribute name="action">/fmi/xsl/biphones/calc.xsl</xsl:attribute> <input type="hidden" name="-db" value="biphones.fp7"/> <input type="hidden" name="-token" value="{$default-record/@record-id}"/> <input type="hidden" name="-lay" value="CGI"/> <input type="hidden" name="-token.error" value="biphones-error.xsl"/> <input type="hidden" name="-recid" value="{$default-record/@record-id}"/> <input type="hidden" name="-script" value="ClearForm"/> <input type="hidden" name="-edit" value="Run Script"/> <input type="submit" name="-edit" value="Clear your Entry"/> </form> </td> <td width="67%" align="left" valign="top"> <form method="post" name="CalcForm" id="CalcForm"><xsl:attribute name="action">/fmi/xsl/biphones/calc.xsl</xsl:attribute> <input type="hidden" name="-token" value="{$default-record/@record-id}"/> <input type="hidden" name="-lay" value="CGI"/> <input type="hidden" name="-db" value="biphones.fp7"/> <input type="hidden" name="-token.error" value="biphones-error.xsl"/> <input type="hidden" name="-content" value="{$default-record/fmrs:field[@name = 'Output']/fmrs:data[1]}"/> <input type="hidden" name="-text" value="/biphones/biphones.fp7"/> <input type="hidden" name="-edit"/> <label for="outputcalc">The results of your calculation are displayed here. You may copy and paste results to another program for further analysis.<br/> <textarea name="outputtextfield" cols="64" rows="18" wrap="virtual" id="outputcalc"><xsl:value-of select="$default-record/fmrs:field[@name = 'Output']/fmrs:data[1]"/></textarea> </label> </form> </td> </tr> </table> </body> </html> </xsl:template> </xsl:stylesheet>
ddhull Posted June 1, 2005 Author Posted June 1, 2005 By the way, thanks again Martin. Your help is very much appreciated as always! Here is the cdml version, it is attached as well: <!DOCTYPE htm PUBLIC "-//w3c//DTD htm 4.0 transitional//EN" "http://www.w3.org/tr/REC-htm40/loose.dtd" /> <html> <head> <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> <title>Phonotactic Probability Calculator Page</title> <link rel="stylesheet" href="http://www.parsons.lsi.ku.edu/biphones/biphones.css" type="text/css" /> </head> <body> <table width="640" border="0" cellspacing="2" cellpadding="2" align="center"> <tr align="center" valign="top"> <td colspan="2"> <h1> CALCULATE PHONOTACTIC PROBABILITY</h1> <hr color="#0000FF" noshade></td> </tr> <tr> <td width="33%" align="left" valign="top"> <form action="FMPro" method="post" name="CalcForm" id="CalcForm"> <input type="hidden" name="-Token" value="[FMP-CurrentRecID]"> <input type="hidden" name="-db" value="biphones.fp5"> <input type="hidden" name="-lay" value="CGI"> <input type="hidden" name="-format" value="/biphones/calc.html"> <input type="hidden" name="-error" value="/biphones/error.html"> <input type="hidden" name="-recid" value="[FMP-currentrecid]"> <input type="hidden" name="-script" value="CalculateWords"> <input type="hidden" name="-edit" value="Run Script"> <label for "inputcalc">Type or copy and paste your data here. Press [Enter] after each line. <br /> <textarea name="AllWords" cols="26" rows="15" id="inputcalc">[FMP-Field: AllWords]</textarea> </label> <p><input type="submit" name="-Edit" value="Calc your Entry"> </p> </form> <form action="FMPro" method="post" name="ClearButton"> <input type="hidden" name="-db" value="biphones.fp5"> <input type="hidden" name="-Token" value="[FMP-CurrentRecID]"> <input type="hidden" name="-lay" value="CGI"> <input type="hidden" name="-error" value="/biphones/error.html"> <input type="hidden" name="-format" value="/biphones/calc.html"> <input type="hidden" name="-recid" value="[FMP-currentrecid]"> <input type="hidden" name="-script" value="ClearForm"> <input type="hidden" name="-edit" value="Run Script"> <input type="submit" name="-edit" value="Clear your Entry"> </form> </td> <td width="67%" align="left" valign="top"> <form action="FMPro" method="post" name="CalcForm" id="CalcForm"> <input type="hidden" name="-Token" value="[FMP-CurrentRecID]"> <input type="hidden" name="-DB" value="biphones.fp5"> <input type="hidden" name="-error" value="/biphones/error.html"> <input type="hidden" name="-Format" value="/biphones/calc.html"> <input type="hidden" name="-content" value="[FMP-Field: Output]"> <input type="hidden" name="-text" value="/biphones/biphones.fp5"> <input type="hidden" name="-edit"> <label for="outputcalc">The results of your calculation are displayed here. You may copy and paste results to another program for further analysis.<br /> <textarea name="outputtextfield" cols="64" rows="18" wrap="virtual" id="outputcalc">[FMP-Field: Output]</textarea> </label> </form> </td> </tr> </table> </body> </html>
ddhull Posted June 1, 2005 Author Posted June 1, 2005 Sorry I did not get the files attached. Let me know if you want them. Doug
ddhull Posted June 1, 2005 Author Posted June 1, 2005 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
Martin Brändle Posted June 1, 2005 Posted June 1, 2005 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.
ddhull Posted June 2, 2005 Author Posted June 2, 2005 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: <:fmresultset xmlns="http://www.filemaker.com/xml/fmresultset" version="1.0"> <:error code="958"/> Which is Missing Parameter (*) <:product build="08/12/2004" name="FileMaker Web Publishing Engine" version="7.0v3"/> <:datasource database="" date-format="" layout="" table="" time-format="" timestamp-format="" total-count="0"/> <:metadata/> <:resultset count="0" fetch-size="0"/> <:/fmresultset> This comes up if I start at calc.xsl instead of index.xsl: <:fmresultset xmlns="http://www.filemaker.com/xml/fmresultset" version="1.0"> <:error code="101"/> Which is Record is Missing <:product build="08/12/2004" name="FileMaker Web Publishing Engine" version="7.0v3"/> <:datasource database="" date-format="" layout="" table="" time-format="" timestamp-format="" total-count="0"/> <:metadata/> <:resultset count="0" fetch-size="0"/> <:/fmresultset> Here is my index.xsl page that could initially call calc.xsl: <:?xml version="1.0" encoding="ISO-8859-1"?> <:?xslt-cwp-query param="-grammar=fmresultset"?> <: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> <:meta http-equiv="content-type" content="text/htm;charset=iso-8859-1"/> <:title>Phonotactic Probability Home Page<:/title> <:link rel="stylesheet" href="biphones.css" type="text/css"/> <:/head> <:body> <:center> <:h1>PHONOTACTIC PROBABILITY<:/h1> <:hr width="640" color="#0000FF" noshade="noshade"/> <:p><:xsl:text disable-output-escaping="yes">
Martin Brändle Posted June 2, 2005 Posted June 2, 2005 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&-lay=CGI&-max=1&-findany" alt="Link to the BiPhones Homepage.">Begin Calculation</a>
ddhull Posted June 6, 2005 Author Posted June 6, 2005 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
Martin Brändle Posted June 6, 2005 Posted June 6, 2005 Just a short answer to your entity error: Probably all my & have been replaced by & in this (sorry: lousy) forum engine. Write your query with & I come to your other questions later.
Martin Brändle Posted June 6, 2005 Posted June 6, 2005 Ok. Now I see the problem. You don't need -recid for global fields (see CWP Guide p. 78). I will post a solution back ASAP it works.
Martin Brändle Posted June 6, 2005 Posted June 6, 2005 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
Martin Brändle Posted June 6, 2005 Posted June 6, 2005 See echo.zip in attachment. Just compare with your files. Not tested. There might be small typos. echo.zip
ddhull Posted June 7, 2005 Author Posted June 7, 2005 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
Martin Brändle Posted June 7, 2005 Posted June 7, 2005 Strange. I tested yesterday on our server, and the output came back. Did you restart the WPE AND the web server after turning on the database sessions?
ddhull Posted June 7, 2005 Author Posted June 7, 2005 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
Martin Brändle Posted June 7, 2005 Posted June 7, 2005 Ok. I will reinstall the DB and the pages on our server and see if I have made a little mistake.
Martin Brändle Posted June 7, 2005 Posted June 7, 2005 That's what I get with the files that I uploaded yesterday to fmforums. See screen shot. This was with the Admin account. Did you change the biphones.fp7 DB in the mean time?
ddhull Posted June 7, 2005 Author Posted June 7, 2005 Yes, that screen shot is what I am after. No change in database. Thanks for looking. Doug
Martin Brändle Posted June 7, 2005 Posted June 7, 2005 Our messages crossed. I tried that with the Admin account.
Martin Brändle Posted June 7, 2005 Posted June 7, 2005 Can you post a screen shot of your installation? And maybe the XML tree that you get as output?
Martin Brändle Posted June 7, 2005 Posted June 7, 2005 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.
ddhull Posted June 8, 2005 Author Posted June 8, 2005 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now