Thread: [Xsltforms-support] XSLTForms rev. 531 to become 1.0 RC
Brought to you by:
alain-couthures
From: Alain C. <ala...@ag...> - 2012-02-26 16:55:35
|
Hello, Rev. 531 in SF repositories is intended to become XSLTForms 1.0 RC soon unless big issues would be reported by you. It will replace XSLTForms Beta 3 which is currently downloaded more than 50 times per week from SF. It has been tested with various browsers including IE9 in IE8 compatibility mode. Latest "impressive" features are: * AVT for HTML elements * direct Javascript function calls in XPath expressions (parameters are always passed as strings) * basic iText support (no @form support): http://opendatakit.org/help/form-design/itext/ Thank you very much for your feedbacks! -Alain ------------------------------------------------------------------------ <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms"> <head> <title>Background Colors</title> <xf:model> <xf:instance> <colors xmlns=""> <color name="Blue" code="#0000FF"/> <color name="Green" code="#00FF00"/> <color name="Olive" code="#808000"/> <color name="Orange" code="#F87A17"/> <color name="Pink" code="#FFC0CB"/> <color name="Purple" code="#800080"/> <color name="Red" code="#FF0000"/> <color name="Yellow" code="#FFFF00"/> </colors> </xf:instance> </xf:model> <script id="myscript" type="text/javascript"> function luminosity(c) { var r = parseInt(c.substr(1,2), 16); var g = parseInt(c.substr(3,2), 16); var b = parseInt(c.substr(5,2), 16); return 0.2126 * Math.pow(r/255, 2.2) + 0.7152 * Math.pow(g/255, 2.2) + 0.0722 * Math.pow(b/255, 2.2); } </script> </head> <body> <h1>Background Colors</h1> <p>Use of Attribute Value Templates, Direct Javascript Function Calls and Javascript Evaluation.</p> <xf:repeat nodeset="color"> <span style="background-color:{@code}; color:{choose(luminosity(@code) > 0.5,'black','white')}"> <xf:output value="@name"/> </span> </xf:repeat> <p>Javascript function source for luminosity extracted from HTML DOM: <pre><xf:output value="js-eval('document.getElementById("myscript").innerHTML')"/></pre> </p> </body> </html> ------------------------------------------------------------------------ <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms"> <head> <title>Address Form</title> <xf:model> <xf:instance> <Address xmlns=""> <LocationStreetFullText /> <LocationCityName /> <LocationStateName /> <LocationPostalID /> </Address> </xf:instance> <xf:itext> <xf:translation lang="eng"> <xf:text id="address"> <xf:value>Mailing Address</xf:value> </xf:text> <xf:text id="streetFullText"> <xf:value>Street: </xf:value> </xf:text> <xf:text id="cityName"> <xf:value>City: </xf:value> </xf:text> <xf:text id="stateName"> <xf:value>State: </xf:value> </xf:text> <xf:text id="postalID"> <xf:value>Postal Code: </xf:value> </xf:text> </xf:translation> <xf:translation lang="fr"> <xf:text id="address"> <xf:value>Adresse postale</xf:value> </xf:text> <xf:text id="streetFullText"> <xf:value>Rue : </xf:value> </xf:text> <xf:text id="cityName"> <xf:value>Ville : </xf:value> </xf:text> <xf:text id="stateName"> <xf:value>Département : </xf:value> </xf:text> <xf:text id="postalID"> <xf:value>Code postal : </xf:value> </xf:text> </xf:translation> </xf:itext> </xf:model> </head> <body> <xf:group ref="/Address"> <fieldset> <legend><xf:output value="itext('address')"/></legend> <xf:input ref="LocationStreetFullText"> <xf:label><xf:output value="itext('streetFullText')"/></xf:label> </xf:input> <br/> <xf:input ref="LocationCityName"> <xf:label><xf:output value="itext('cityName')"/></xf:label> </xf:input> <br/> <xf:input ref="LocationStateName"> <xf:label><xf:output value="itext('stateName')"/></xf:label> </xf:input> <br/> <xf:input ref="LocationPostalID"> <xf:label><xf:output value="itext('postalID')"/></xf:label> </xf:input> </fieldset> </xf:group> </body> </html> |
From: Andre C. <ac...@01...> - 2012-03-06 16:17:12
|
Hi Alain, Thank you fro the very useful info. I upgraded to the latest (Beta3) xsltForms version, but still had the same error. Then, I replaced the two instances of 
 for and it now works ok. I will remove the duplicate ids in the forms, although the issue did not seem to be related. Thank you for great support Regards, Andre > Hi André, > > This form contains the Unicode character for a line separator > (
) instead of > > This character is not supported in rev. 490. You could test with the > latest revision but, recently, the Javascript classes have been > renamed ("Core" became "XsltForms_browser", for example) and I noticed > that you are using some of them directly. > > If this is not possible for you to replace 
 with and if > you don't want to upgrade your XSLTForms version now, I can send you a > patched version of rev. 490. > > I also detected duplicate ids in your forms for "stratedit": the main > instance and a table. This can cause issues difficult to locate. > > Thank you for your feedbacks! > > -Alain > > Le 29/02/2012 18:11, Andre Cusson a écrit : >> oops, sorry for hijacking and not replacing the message subject, wich >> this instance tries to fix ... >> >> Hi Alain, >> >> Sorry for taking your time for this, and I hope that you are fine. >> >> On the StratML portal (http://stratml.hyperbase.com/), we have 842 >> preloaded XSLTForms, each loaded with a specific StratML document >> (see http://stratml.hyperbase.com/documents.html "Edit" links for the >> forms). They all seem to work fine, even as they get pretty large, >> but the last one added ( http://stratml.hyperbase.com/documents.html >> entry #485-LDTC, "Edit" link), which also seems to work fine when I >> run it locally, returns an error when accessed from the deployed >> version. The error message is as follows (also attached): >> >> Do you have any idea what could cause this? >> >> Thank you, >> >> Andre >> > |