[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> |