UNPKG

enketo-transformer

Version:

Library that transforms ODK-compliant XForms into a format that Enketo can consume

1 lines 110 kB
{"version":3,"file":"openrosa2html5form.xsl.cjs","sources":["../../../src/xsl/openrosa2html5form.xsl?raw"],"sourcesContent":["export default \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n\\n<!--\\n*****************************************************************************************************\\nXSLT Stylesheet that transforms OpenRosa style (X)Forms into valid HTMl5 forms\\n(exception: when non-IANA lang attributes are used the form will not validate (but that's not serious))\\n*****************************************************************************************************\\n-->\\n<xsl:stylesheet\\n    xmlns:xsl=\\\"http://www.w3.org/1999/XSL/Transform\\\"\\n    xmlns:xf=\\\"http://www.w3.org/2002/xforms\\\"\\n    xmlns:orx=\\\"http://openrosa.org/xforms\\\"\\n    xmlns:enk=\\\"http://enketo.org/xforms\\\"\\n    xmlns:odk=\\\"http://www.opendatakit.org/xforms\\\"\\n    xmlns:kb=\\\"http://kobotoolbox.org/xforms\\\"\\n    xmlns:esri=\\\"http://esri.com/xforms\\\"\\n    xmlns:oc=\\\"http://openclinica.org/xforms\\\"\\n    xmlns:h=\\\"http://www.w3.org/1999/xhtml\\\"\\n    xmlns:ev=\\\"http://www.w3.org/2001/xml-events\\\"\\n    xmlns:xsd=\\\"http://www.w3.org/2001/XMLSchema\\\"\\n    xmlns:jr=\\\"http://openrosa.org/javarosa\\\"\\n    xmlns:exsl=\\\"http://exslt.org/common\\\"\\n    xmlns:str=\\\"http://exslt.org/strings\\\"\\n    xmlns:dyn=\\\"http://exslt.org/dynamic\\\"\\n    extension-element-prefixes=\\\"exsl str dyn\\\"\\n    version=\\\"1.0\\\"\\n    >\\n    <xsl:param name=\\\"openclinica\\\"/>\\n    <xsl:output method=\\\"html\\\" omit-xml-declaration=\\\"yes\\\" encoding=\\\"UTF-8\\\" indent=\\\"yes\\\"/><!-- for xml: version=\\\"1.0\\\" -->\\n\\n    <xsl:key\\n        name=\\\"bindings-by-id\\\"\\n        match=\\\"/h:html/h:head/xf:model/xf:bind\\\"\\n        use=\\\"@id\\\" />\\n    <xsl:key\\n        name=\\\"nodeset-bindings\\\"\\n        match=\\\"/h:html/h:head/xf:model/xf:bind\\\"\\n        use=\\\"@nodeset\\\" />\\n    <xsl:key\\n        name=\\\"preload-bindings\\\"\\n        match=\\\"/h:html/h:head/xf:model/xf:bind\\\"\\n        use=\\\"@jr:preload != ''\\\" />\\n    <xsl:key\\n        name=\\\"calculate-bindings\\\"\\n        match=\\\"/h:html/h:head/xf:model/xf:bind\\\"\\n        use=\\\"@calculate != ''\\\" />\\n    <xsl:key name=\\\"instances\\\" match=\\\"/h:html/h:head/xf:model/xf:instance\\\" use=\\\"true()\\\" />\\n    <xsl:key\\n        name=\\\"primary-instance-root\\\"\\n        match=\\\"/h:html/h:head/xf:model/xf:instance[1]/child::node()\\\"\\n        use=\\\"true()\\\" />\\n    <xsl:key\\n        name=\\\"model-actions\\\"\\n        match=\\\"/h:html/h:head/xf:model/xf:setvalue[@event] | /h:html/h:head/xf:model/odk:setgeopoint[@event]\\\"\\n        use=\\\"local-name()\\\" />\\n    <xsl:key\\n        name=\\\"fields-by-ref\\\"\\n        match=\\\"/h:html/h:body//xf:input | /h:html/h:body//xf:upload | /h:html/h:body//xf:select | /h:html/h:body//xf:select1\\\"\\n        use=\\\"@ref\\\" />\\n    <xsl:key\\n        name=\\\"default-translation\\\"\\n        match=\\\"/h:html/h:head/xf:model/xf:itext/xf:translation[@default]\\\"\\n        use=\\\"true()\\\" />\\n    <xsl:key\\n        name=\\\"translations\\\"\\n        match=\\\"/h:html/h:head/xf:model/xf:itext/xf:translation\\\"\\n        use=\\\"true()\\\" />\\n    <xsl:key\\n        name=\\\"itext-texts-by-id\\\"\\n        match=\\\"/h:html/h:head/xf:model/xf:itext/xf:translation/xf:text\\\"\\n        use=\\\"@id\\\" />\\n\\n    <xsl:variable name=\\\"upper-case\\\" select=\\\"'ABCDEFGHIJKLMNOPQRSTUVWXYZ'\\\" />\\n    <xsl:variable name=\\\"lower-case\\\" select=\\\"'abcdefghijklmnopqrstuvwxyz'\\\" />\\n    <xsl:variable name=\\\"undefined\\\">undefined</xsl:variable>\\n    <xsl:variable name=\\\"warning\\\">warning</xsl:variable>\\n    <xsl:variable name=\\\"error\\\">error</xsl:variable>\\n    <xsl:variable name=\\\"translated\\\"><!-- assumes that either a whole form is translated or nothing (= real life) -->\\n        <xsl:if test=\\\"count(key('translations', true())) &gt; 1\\\" >\\n            <xsl:value-of select=\\\"string('true')\\\" /><!-- no time to figure out how to use real boolean values -->\\n        </xsl:if>\\n    </xsl:variable>\\n    <xsl:variable name=\\\"default-lang\\\">\\n        <xsl:choose>\\n            <xsl:when test=\\\"key('default-translation', true())/@lang\\\">\\n                <xsl:value-of select=\\\"key('default-translation', true())/@lang\\\" />\\n            </xsl:when>\\n            <xsl:otherwise>\\n                <xsl:value-of select=\\\"''\\\" />\\n            </xsl:otherwise>\\n        </xsl:choose>\\n    </xsl:variable>\\n    <xsl:variable name=\\\"first-lang\\\">\\n        <!-- first language or empty if itext was not used -->\\n        <xsl:value-of select=\\\"key('translations', true())[1]/@lang\\\" />\\n    </xsl:variable>\\n    <xsl:variable name=\\\"current-lang\\\">\\n        <xsl:choose>\\n            <xsl:when test=\\\"string-length($default-lang) > 0\\\">\\n                <xsl:value-of select=\\\"$default-lang\\\" />\\n            </xsl:when>\\n            <xsl:otherwise>\\n                <xsl:value-of select=\\\"$first-lang\\\" />\\n            </xsl:otherwise>\\n        </xsl:choose>\\n    </xsl:variable>\\n\\n    <xsl:template match=\\\"/\\\">\\n        <xsl:if test=\\\"not(function-available('exsl:node-set'))\\\">\\n            <xsl:message terminate=\\\"yes\\\">FATAL ERROR: exsl:node-set function is not available in this XSLT processor</xsl:message>\\n        </xsl:if>\\n        <xsl:for-each select=\\\"/h:html/h:head/xf:model/xf:bind\\\">\\n            <xsl:if test=\\\"not(substring(./@nodeset, 1, 1) = '/')\\\">\\n                <xsl:message terminate=\\\"no\\\">WARNING: Found binding(s) with relative nodeset attribute <!--on element: <xsl:value-of select=\\\"./@nodeset\\\" />--> (form may work correctly if relative nodesets were used consistently throughout xml form in bindings as well as body, otherwise it will certainly be messed up). </xsl:message>\\n            </xsl:if>\\n        </xsl:for-each>\\n       <!--> <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html&gt;</xsl:text>\\n        <html>\\n            <head>\\n                <title>\\n                    <xsl:text>Transformation of JR (X)Form to HTML5</xsl:text>\\n                </title>\\n                <script src=\\\"jquery.min.js\\\" type=\\\"text/javascript\\\" ><xsl:text> </xsl:text></script>\\n                <script type=\\\"text/javascript\\\">\\n                    <xsl:text disable-output-escaping='yes'>\\n                      $(function() {\\n                            $('#form-languages a').click(function(){\\n                               $('form [lang]').show().not('[lang=\\\"'+$(this).attr('lang')+'\\\"], [lang=\\\"\\\"], #form-languages a').hide();\\n                            });\\n                      });</xsl:text>\\n                </script>\\n            </head>-->\\n            <root>\\n                <form autocomplete=\\\"off\\\" novalidate=\\\"novalidate\\\" class=\\\"clearfix\\\" dir=\\\"ltr\\\">\\n                    <xsl:attribute name=\\\"class\\\">\\n                        <xsl:value-of select=\\\"'or clearfix'\\\" />\\n                        <xsl:if test=\\\"/h:html/h:body/@class\\\">\\n                            <xsl:value-of select=\\\"concat(' ', /h:html/h:body/@class)\\\" />\\n                        </xsl:if>\\n                    </xsl:attribute>\\n                    <xsl:attribute name=\\\"data-form-id\\\">\\n                        <xsl:choose>\\n                            <xsl:when test=\\\"key('primary-instance-root', true())/@id\\\">\\n                                <xsl:value-of select=\\\"key('primary-instance-root', true())/@id\\\" />\\n                            </xsl:when>\\n                            <xsl:otherwise>\\n                                <xsl:text>_</xsl:text>\\n                            </xsl:otherwise>\\n                        </xsl:choose>\\n                    </xsl:attribute>\\n                    <xsl:if test=\\\"/h:html/h:head/xf:model/xf:submission/@action\\\">\\n                        <xsl:attribute name=\\\"action\\\">\\n                            <xsl:value-of select=\\\"/h:html/h:head/xf:model/xf:submission/@action\\\"/>\\n                        </xsl:attribute>\\n                    </xsl:if>\\n                    <xsl:if test=\\\"/h:html/h:head/xf:model/xf:submission/@method\\\">\\n                        <xsl:attribute name=\\\"method\\\">\\n                            <xsl:choose>\\n                                <xsl:when test=\\\"/h:html/h:head/xf:model/xf:submission/@method = 'form-data-post'\\\">\\n                                     <xsl:value-of select=\\\"'post'\\\"/>\\n                                </xsl:when>\\n                                <xsl:otherwise>\\n                                    <xsl:value-of select=\\\"/h:html/h:head/xf:model/xf:submission/@method\\\"/>\\n                                </xsl:otherwise>\\n                            </xsl:choose>\\n                        </xsl:attribute>\\n                    </xsl:if>\\n                    <xsl:if test=\\\"/h:html/h:head/xf:model/xf:submission/@base64RsaPublicKey\\\">\\n                        <xsl:attribute name=\\\"data-base64RsaPublicKey\\\">\\n                            <xsl:value-of select=\\\"/h:html/h:head/xf:model/xf:submission/@base64RsaPublicKey\\\"/>\\n                        </xsl:attribute>\\n                    </xsl:if>\\n                    <xsl:text>&#10;</xsl:text>\\n                    <xsl:comment>This form was created by transforming an ODK/OpenRosa-flavored (X)Form using an XSL stylesheet created by Enketo LLC.</xsl:comment>\\n                    <section class=\\\"form-logo\\\">\\n                        <xsl:text></xsl:text>\\n                    </section>\\n                    <h3 dir=\\\"auto\\\" id=\\\"form-title\\\">\\n                        <xsl:choose>\\n                            <xsl:when test=\\\"/h:html/h:head/h:title\\\">\\n                                <xsl:value-of select=\\\"/h:html/h:head/h:title\\\"/>\\n                            </xsl:when>\\n                            <xsl:otherwise>\\n                                <xsl:text>No Title</xsl:text>\\n                            </xsl:otherwise>\\n                        </xsl:choose>\\n                    </h3>\\n                <!--\\n                    <div id=\\\"stats\\\" style=\\\"display: none;\\\">\\n                        <span id=\\\"jrSelect\\\"><xsl:value-of select=\\\"count(/h:html/h:body//xf:select)\\\"/></span>\\n                        <span id=\\\"jrSelect1\\\"><xsl:value-of select=\\\"count(/h:html/h:body//xf:select1)\\\"/></span>\\n                        <span id=\\\"jrItemset\\\"><xsl:value-of select=\\\"count(/h:html/h:body//xf:itemset)\\\"/></span>\\n                        <span id=\\\"jrItem\\\"><xsl:value-of select=\\\"count(/h:html/h:body//xf:item)\\\"/></span>\\n                        <span id=\\\"jrInput\\\"><xsl:value-of select=\\\"count(/h:html/h:body//xf:input)\\\"/></span>\\n                        <span id=\\\"jrUpload\\\"><xsl:value-of select=\\\"count(/h:html/h:body//xf:upload)\\\"/></span>\\n                        <span id=\\\"jrTrigger\\\"><xsl:value-of select=\\\"count(/h:html/h:body//xf:trigger)\\\"/></span>\\n                        <span id=\\\"jrRepeat\\\"><xsl:value-of select=\\\"count(/h:html/h:body//xf:repeat)\\\"/></span>\\n                        <span id=\\\"jrRelevant\\\"><xsl:value-of select=\\\"count(/h:html/h:head/xf:model/xf:bind[@relevant])\\\"/></span>\\n                        <span id=\\\"jrConstraint\\\"><xsl:value-of select=\\\"count(/h:html/h:head/xf:model/xf:bind[@constraint])\\\"/></span>\\n                        <span id=\\\"jrCalculate\\\"><xsl:value-of select=\\\"count(/h:html/h:head/xf:model/xf:bind[@calculate])\\\"/></span>\\n                        <span id=\\\"jrPreload\\\"><xsl:value-of select=\\\"count(/h:html/h:head/xf:model/xf:bind[@jr:preload])\\\"/></span>\\n                    </div>\\n                -->\\n                    <xsl:if test=\\\"//*/@lang\\\" >\\n                        <select id=\\\"form-languages\\\">\\n                            <xsl:if test=\\\"$translated != 'true'\\\">\\n                                <xsl:attribute name=\\\"style\\\">display:none;</xsl:attribute>\\n                            </xsl:if>\\n                            <xsl:attribute name=\\\"data-default-lang\\\">\\n                                <xsl:value-of select=\\\"$default-lang\\\" />\\n                            </xsl:attribute>\\n                            <xsl:call-template name=\\\"languages\\\" />\\n                        </select>\\n                    </xsl:if>\\n\\n                    <xsl:apply-templates />\\n\\n                    <!-- Create hidden input fields for preload items that do not have a form control. -->\\n                    <xsl:if test=\\\"key('preload-bindings', true())\\\" >\\n                        <fieldset id=\\\"or-preload-items\\\" style=\\\"display:none;\\\">\\n                            <xsl:apply-templates select=\\\"key('preload-bindings', true())\\\"/>\\n                        </fieldset>\\n                    </xsl:if>\\n\\n                    <!-- Create hidden input fields for calculated items that do not have a form control. -->\\n                    <!-- the template will exclude those that have an input field -->\\n                    <xsl:if test=\\\"key('calculate-bindings', true())\\\">\\n                        <fieldset id=\\\"or-calculated-items\\\" style=\\\"display:none;\\\">\\n                            <xsl:apply-templates select=\\\"key('calculate-bindings', true())\\\" />\\n                        </fieldset>\\n                    </xsl:if>\\n\\n\\n                    <!-- Create hidden input fields for calculated items that do not have a form control. -->\\n                    <!-- the template will exclude those that have an input field -->\\n                    <xsl:if test=\\\"key('model-actions', 'setvalue')\\\">\\n                        <fieldset id=\\\"or-setvalue-items\\\" style=\\\"display:none;\\\">\\n                            <xsl:apply-templates select=\\\"key('model-actions', 'setvalue')\\\" />\\n                        </fieldset>\\n                    </xsl:if>\\n                    <xsl:if test=\\\"key('model-actions', 'setgeopoint')\\\">\\n                        <fieldset id=\\\"or-setgeopoint-items\\\" style=\\\"display:none;\\\">\\n                            <xsl:apply-templates select=\\\"key('model-actions', 'setgeopoint')\\\" />\\n                        </fieldset>\\n                    </xsl:if>\\n                    <!--\\n                    <xsl:if test=\\\"/h:html/h:body//xf:output\\\">\\n                        <xsl:message>WARNING: Output element(s) added but note that only /absolute/path/to/node is properly supported as \\\"value\\\" attribute of outputs. Please test to make sure they do what you want.</xsl:message>\\n                    </xsl:if>\\n                    <xsl:if test=\\\"/h:html/h:body//xf:itemset\\\">\\n                        <xsl:message>WARNING: Itemset support is experimental. Make sure to test whether they do what you want.</xsl:message>\\n                    </xsl:if>\\n                    -->\\n                    <xsl:if test=\\\"//xf:submission\\\">\\n                        <xsl:message>ERROR: Submissions element(s) not supported.</xsl:message>\\n                    </xsl:if>\\n                </form>\\n            </root>\\n        </xsl:template>\\n    <xsl:template match=\\\"h:head\\\"/> <!--[not(self::xf:model/xf:bind[@jr:preload])]\\\" />-->\\n\\n    <xsl:template match=\\\"xf:group\\\">\\n        <!-- NOTE: TO IMPROVE PERFORMANCE, SUPPORT FOR RELATIVE NODESET BINDINGS HAS BEEN SWITCHED OFF\\n            To turn this back on:\\n            - uncomment the variable nodeset_used\\n            - revert back to commented-out code for variable nodeset\\n            - revert back to commented-out code for variable binding\\n            - all this takes place in the next 10 lines\\n        <xsl:variable name=\\\"nodeset_used\\\">\\n            <xsl:call-template name=\\\"nodeset_used\\\" />\\n        </xsl:variable>\\n    -->\\n        <xsl:variable name=\\\"nodeset\\\">\\n            <!--<xsl:call-template name=\\\"nodeset_absolute\\\">\\n                <xsl:with-param name=\\\"nodeset_u\\\" select=\\\"$nodeset_used\\\"/>\\n            </xsl:call-template>-->\\n            <xsl:call-template name=\\\"nodeset_used\\\" />\\n        </xsl:variable>\\n\\n        <!-- note that bindings are not required -->\\n        <!--<xsl:variable name=\\\"binding\\\" select=\\\"/h:html/h:head/xf:model/xf:bind[@nodeset=$nodeset_used] | /h:html/h:head/xf:model/xf:bind[@nodeset=$nodeset]\\\"/>-->\\n        <xsl:variable name=\\\"binding\\\" select=\\\"key('nodeset-bindings', $nodeset)\\\"/>\\n\\n        <section>\\n            <xsl:attribute name=\\\"class\\\">\\n                <!-- only add or-group if label is present or if it has a repeat as child-->\\n                <xsl:choose>\\n                    <xsl:when test=\\\"string(./xf:label/@ref) or string(./xf:label)\\\">\\n                        <xsl:value-of select=\\\"'or-group '\\\" />\\n                    </xsl:when>\\n                    <xsl:otherwise>\\n                        <xsl:value-of select=\\\"'or-group-data '\\\" />\\n                    </xsl:otherwise>\\n                </xsl:choose>\\n                <xsl:if test=\\\"$binding/@relevant\\\">\\n                    <xsl:value-of select=\\\"'or-branch pre-init '\\\"/>\\n                </xsl:if>\\n                <xsl:if test=\\\"@appearance or @rows\\\">\\n                    <xsl:value-of select=\\\"'or-appearances-placeholder '\\\"></xsl:value-of>\\n                </xsl:if>\\n                <!-- Workaround for XLSForm limitation: add \\\"compact\\\" to group if the immediate repeat child has this appearance -->\\n                <!-- This should actually be fixed in pyxform instead -->\\n                <xsl:if test=\\\"contains(./xf:repeat/@appearance, 'compact')\\\">\\n                    <xsl:value-of select=\\\"'or-appearance-compact '\\\"/>\\n                </xsl:if>\\n                <!-- same workaround for \\\"no-collapse\\\" -->\\n                <xsl:if test=\\\"contains(./xf:repeat/@appearance, 'no-collapse')\\\">\\n                    <xsl:value-of select=\\\"'or-appearance-no-collapse '\\\"/>\\n                </xsl:if>\\n            </xsl:attribute>\\n            <xsl:call-template name=\\\"appearance\\\" />\\n\\n            <xsl:if test=\\\"string($nodeset)\\\">\\n                <!--<xsl:variable name=\\\"nodeset\\\" select=\\\"@ref\\\" />-->\\n                <xsl:attribute name=\\\"name\\\">\\n                    <xsl:value-of select=\\\"$nodeset\\\"/>\\n                </xsl:attribute>\\n\\n                <xsl:if test=\\\"$binding/@relevant\\\">\\n                    <xsl:attribute name=\\\"data-relevant\\\">\\n                        <!--<xsl:value-of select=\\\"/h:html/h:head/xf:model/xf:bind[@nodeset=$nodeset]/@relevant\\\" />-->\\n                        <xsl:value-of select=\\\"$binding/@relevant\\\"/>\\n                    </xsl:attribute>\\n                </xsl:if>\\n            </xsl:if>\\n            <xsl:if test=\\\"string(./xf:label/@ref) or string (./xf:label)\\\">\\n                <h4>\\n                    <xsl:apply-templates select=\\\"xf:label\\\" />\\n                </h4>\\n            </xsl:if>\\n            <xsl:apply-templates select=\\\"*[not(self::xf:label or self::xf:hint)]\\\"/>\\n            <xsl:call-template name=\\\"constraint-and-required-msg\\\" >\\n                <xsl:with-param name=\\\"binding\\\" select=\\\"$binding\\\"/>\\n            </xsl:call-template>\\n            <xsl:text>\\n            </xsl:text>\\n        </section><xsl:comment>end of group <xsl:value-of select=\\\"@nodeset\\\" /> </xsl:comment>\\n    </xsl:template>\\n\\n    <xsl:template match=\\\"xf:repeat\\\">\\n    <!-- NOTE: TO IMPROVE PERFORMANCE, SUPPORT FOR RELATIVE NODESET BINDINGS HAS BEEN SWITCHED OFF\\n            To turn this back on:\\n            - uncomment the variable nodeset_used\\n            - revert back to commented-out code for variable nodeset\\n            - revert back to commented-out code for variable binding\\n            - all this takes place in the next 10 lines\\n        <xsl:variable name=\\\"nodeset_used\\\">\\n            <xsl:call-template name=\\\"nodeset_used\\\" />\\n        </xsl:variable>\\n    -->\\n\\n        <!-- the correct absolute nodeset as used in HTML -->\\n        <xsl:variable name=\\\"nodeset\\\">\\n             <!--<xsl:call-template name=\\\"nodeset_absolute\\\">\\n                 <xsl:with-param name=\\\"nodeset_u\\\" select=\\\"$nodeset_used\\\"/>\\n             </xsl:call-template>-->\\n             <xsl:call-template name=\\\"nodeset_used\\\" />\\n        </xsl:variable>\\n\\n        <!-- note that bindings are not required -->\\n        <!--<xsl:variable name=\\\"binding\\\" select=\\\"/h:html/h:head/xf:model/xf:bind[@nodeset=$nodeset_used] | /h:html/h:head/xf:model/xf:bind[@nodeset=$nodeset]\\\" />-->\\n        <!-- Note: not in use, commented out below with \\\"watch out\\\" warning -->\\n        <!-- <xsl:variable name=\\\"binding\\\" select=\\\"key('nodeset-bindings', $nodeset)\\\" /> -->\\n\\n        <section>\\n            <xsl:attribute name=\\\"class\\\">\\n                <xsl:value-of select=\\\"'or-repeat '\\\" />\\n                <!-- watch out or-branch pre-init added to or-group parent! -->\\n                <!--<xsl:if test=\\\"$binding/@relevant\\\">\\n                    <xsl:value-of select=\\\"'or-branch pre-init '\\\"/>\\n                </xsl:if>-->\\n                <xsl:if test=\\\"@appearance or @rows\\\">\\n                    <xsl:value-of select=\\\"'or-appearances-placeholder '\\\"></xsl:value-of>\\n                </xsl:if>\\n            </xsl:attribute>\\n            <xsl:call-template name=\\\"appearance\\\" />\\n            <xsl:attribute name=\\\"name\\\">\\n                <xsl:value-of select=\\\"$nodeset\\\"/>\\n            </xsl:attribute>\\n            <xsl:if test=\\\"string(./xf:label/@ref) or string (./xf:label)\\\">\\n                <h4>\\n                    <xsl:apply-templates select=\\\"xf:label\\\" />\\n                </h4>\\n            </xsl:if>\\n\\n            <xsl:apply-templates select=\\\"*[not(self::xf:label or self::xf:hint)]\\\"/>\\n            <xsl:text>\\n            </xsl:text>\\n        </section>\\n        <!-- Add a repeat-info node -->\\n        <div>\\n            <xsl:attribute name=\\\"class\\\">\\n                <xsl:value-of select=\\\"'or-repeat-info'\\\" />\\n            </xsl:attribute>\\n            <xsl:attribute name=\\\"data-name\\\">\\n                <xsl:value-of select=\\\"$nodeset\\\"/>\\n            </xsl:attribute>\\n            <xsl:if test=\\\"@jr:count\\\">\\n                <xsl:attribute name=\\\"data-repeat-count\\\">\\n                    <xsl:value-of select=\\\"@jr:count\\\" />\\n                </xsl:attribute>\\n            </xsl:if>\\n             <xsl:if test=\\\"@jr:noAddRemove\\\">\\n                <xsl:attribute name=\\\"data-repeat-fixed\\\">\\n                     <xsl:value-of select=\\\"string('fixed')\\\"/>\\n                </xsl:attribute>\\n            </xsl:if>\\n        </div>\\n    </xsl:template>\\n\\n    <xsl:template name=\\\"appearance\\\">\\n        <xsl:variable name=\\\"rows\\\" select=\\\"./@rows\\\" />\\n        <xsl:if test=\\\"local-name() = 'select' or local-name() = 'select1'\\\">\\n            <xsl:attribute name=\\\"data-appearances-select-type\\\" />\\n        </xsl:if>\\n        <xsl:if test=\\\"@appearance or @rows\\\">\\n            <xsl:attribute name=\\\"data-appearances\\\">\\n                <xsl:value-of select=\\\"@appearance\\\" />\\n                <!-- turn rows attribute into an appearance (which is what it should have been in the first place imho) -->\\n                <xsl:if test=\\\"$rows\\\">\\n                    <xsl:value-of select=\\\"concat(' rows-', $rows)\\\" />\\n                </xsl:if>\\n            </xsl:attribute>\\n        </xsl:if>\\n    </xsl:template>\\n\\n\\n    <xsl:template match=\\\"xf:input | xf:upload | xf:range | xf:item | xf:bind[@jr:preload] | xf:bind[@calculate] | xf:setvalue[@event] | odk:setgeopoint[@event]\\\">\\n    <!-- NOTE: TO IMPROVE PERFORMANCE, SUPPORT FOR RELATIVE NODESET BINDINGS HAS BEEN SWITCHED OFF\\n            To turn this back on:\\n            - uncomment the variable nodeset_used\\n            - revert back to commented-out code for variable nodeset\\n            - revert back to commented-out code for variable binding\\n            - all this takes place in the next 10 lines\\n        <xsl:variable name=\\\"nodeset_used\\\">\\n            <xsl:call-template name=\\\"nodeset_used\\\" />\\n        </xsl:variable>\\n    -->\\n        <!-- the correct absolute nodeset as used in HTML -->\\n        <xsl:variable name=\\\"nodeset\\\">\\n             <!--<xsl:call-template name=\\\"nodeset_absolute\\\">\\n                 <xsl:with-param name=\\\"nodeset_u\\\" select=\\\"$nodeset_used\\\"/>\\n             </xsl:call-template>-->\\n             <xsl:call-template name=\\\"nodeset_used\\\" />\\n        </xsl:variable>\\n\\n        <!-- note that bindings are not required -->\\n        <!--<xsl:variable name=\\\"binding\\\" select=\\\"/h:html/h:head/xf:model/xf:bind[@nodeset=$nodeset_used] | /h:html/h:head/xf:model/xf:bind[@nodeset=$nodeset]\\\" />-->\\n        <xsl:variable name=\\\"binding\\\" select=\\\"key('nodeset-bindings', $nodeset)\\\" />\\n\\n        <!-- If this is a bind element that also has an input, do nothing as it will be dealt with by the corresponding xf:input -->\\n        <!-- Note that this test is not fully spec-compliant. It will work with XLS-form produced forms that have no relative nodes\\n             and use the ref atribute only -->\\n        <xsl:if test=\\\"not( local-name() = 'bind' and count( key('fields-by-ref', $nodeset) ) > 0 )\\\">\\n            <xsl:choose>\\n                <xsl:when test=\\\"(local-name() = 'range' and  contains(@appearance, 'picker'))\\\">\\n                    <xsl:call-template name=\\\"select-select\\\">\\n                        <xsl:with-param name=\\\"nodeset\\\" select=\\\"$nodeset\\\" />\\n                        <xsl:with-param name=\\\"binding\\\" select=\\\"$binding\\\" />\\n                    </xsl:call-template>\\n                </xsl:when>\\n                <xsl:otherwise>\\n                    <label>\\n                        <xsl:attribute name=\\\"class\\\">\\n                            <xsl:if test=\\\"local-name() = 'input' or local-name() = 'upload' or local-name() = 'range'\\\">\\n                                <xsl:value-of select=\\\"'question '\\\"/>\\n                            </xsl:if>\\n                            <xsl:if test=\\\"(local-name() = 'input' or local-name() = 'upload' or local-name() = 'range' or local-name() = 'bind') and $binding/@relevant\\\">\\n                                <xsl:value-of select=\\\"'or-branch pre-init '\\\"/>\\n                            </xsl:if>\\n                            <xsl:if test=\\\"local-name() = 'bind'\\\">\\n                                <xsl:value-of select=\\\"'calculation '\\\"/>\\n                            </xsl:if>\\n                            <xsl:if test=\\\"local-name() = 'setvalue'\\\">\\n                                <xsl:value-of select=\\\"'setvalue '\\\"/>\\n                            </xsl:if>\\n                            <xsl:if test=\\\"local-name() = 'setgeopoint'\\\">\\n                                <xsl:value-of select=\\\"'setgeopoint '\\\"/>\\n                            </xsl:if>\\n                            <!--<xsl:if test=\\\"local-name() = 'item'\\\">\\n                                <xsl:value-of select=\\\"'clearfix '\\\"/>\\n                            </xsl:if>-->\\n                            <xsl:if test=\\\"local-name() != 'item'\\\">\\n                                <xsl:value-of select=\\\"'non-select '\\\"/>\\n                            </xsl:if>\\n                            <xsl:if test=\\\"@appearance or @rows\\\">\\n                                <xsl:value-of select=\\\"'or-appearances-placeholder '\\\"></xsl:value-of>\\n                            </xsl:if>\\n                        </xsl:attribute>\\n                        <xsl:call-template name=\\\"appearance\\\" />\\n\\n                        <xsl:apply-templates select=\\\"./@kb:image-customization\\\"/>\\n\\n                        <xsl:if test=\\\"not(local-name() = 'item' or local-name() = 'bind' or local-name() = 'setvalue' or local-name() = 'setgeopoint')\\\">\\n                            <xsl:apply-templates select=\\\"xf:label\\\" />\\n                            <xsl:if test=\\\"not($binding/@readonly = 'true()')\\\">\\n                                <xsl:apply-templates select=\\\"$binding/@required\\\"/>\\n                            </xsl:if>\\n                        </xsl:if>\\n                        <!--\\n                            note: Hints should actually be placed in title attribute (of input) as it is semantically nicer.\\n                            However, to support multiple languages and parse all of them (to be available offline)\\n                            they are placed in the label instead.\\n                        -->\\n                        <xsl:apply-templates select=\\\"xf:hint\\\" />\\n\\n                        <xsl:variable name=\\\"appearance\\\">\\n                            <xsl:value-of select=\\\"translate(@appearance, $upper-case, $lower-case)\\\"/>\\n                        </xsl:variable>\\n                        <xsl:variable name=\\\"element\\\">\\n                            <xsl:choose>\\n                                <xsl:when test=\\\"$binding/@type = 'string' and contains($appearance, 'multi-line') or contains($appearance, 'multiline') or contains($appearance, 'text-area') or contains($appearance, 'textarea') or ./@rows\\\">\\n                                    <xsl:value-of select=\\\"string('textarea')\\\" />\\n                                </xsl:when>\\n                                <xsl:otherwise>\\n                                    <xsl:value-of select=\\\"string('input')\\\" />\\n                                </xsl:otherwise>\\n                            </xsl:choose>\\n                        </xsl:variable>\\n                        <xsl:variable name=\\\"type\\\">\\n                            <xsl:if test=\\\"$element = 'textarea'\\\">\\n                                <xsl:value-of select=\\\"$element\\\"/>\\n                            </xsl:if>\\n                        </xsl:variable>\\n                        <xsl:element name=\\\"{$element}\\\">\\n                            <xsl:choose>\\n                                <xsl:when test=\\\"not(local-name() = 'setvalue' or local-name() = 'setgeopoint') and ancestor::odk:rank\\\">\\n                                    <xsl:call-template name=\\\"rank-item-attributes\\\"/>\\n                                </xsl:when>\\n                                <xsl:when test=\\\"local-name() = 'setvalue' or local-name() = 'setgeopoint'\\\">\\n                                    <xsl:call-template name=\\\"action-attributes\\\">\\n                                        <xsl:with-param name=\\\"binding\\\" select=\\\"$binding\\\"/>\\n                                        <xsl:with-param name=\\\"nodeset\\\" select=\\\"$nodeset\\\"/>\\n                                    </xsl:call-template>\\n                                </xsl:when>\\n                                <xsl:otherwise>\\n                                    <xsl:call-template name=\\\"binding-attributes\\\">\\n                                        <xsl:with-param name=\\\"binding\\\" select=\\\"$binding\\\"/>\\n                                        <xsl:with-param name=\\\"nodeset\\\" select=\\\"$nodeset\\\"/>\\n                                        <xsl:with-param name=\\\"type\\\" select=\\\"$type\\\"/>\\n                                    </xsl:call-template>\\n                                </xsl:otherwise>\\n                            </xsl:choose>\\n                        </xsl:element>\\n                        <xsl:if test=\\\"local-name() = 'item'\\\">\\n                            <xsl:apply-templates select=\\\"xf:label\\\" />\\n                        </xsl:if>\\n\\n                        <xsl:if test=\\\"not(local-name() = 'item' or local-name() = 'bind' or local-name() = 'setvalue' or local-name() = 'setgeopoint')\\\">\\n                            <!-- the only use case at the moment is a <setvalue> and <odk:setgeopoint> child with xforms-value-changed event-->\\n                            <xsl:if test=\\\"./xf:setvalue[@event] or ./odk:setgeopoint[@event]\\\">\\n                                <xsl:apply-templates select=\\\"./xf:setvalue[@event] | ./odk:setgeopoint[@event]\\\" />\\n                            </xsl:if>\\n                            <xsl:call-template name=\\\"constraint-and-required-msg\\\" >\\n                                 <xsl:with-param name=\\\"binding\\\" select=\\\"$binding\\\"/>\\n                            </xsl:call-template>\\n                        </xsl:if>\\n                    </label>\\n                </xsl:otherwise>\\n            </xsl:choose>\\n        </xsl:if>\\n    </xsl:template>\\n\\n    <xsl:template match=\\\"*\\\" mode=\\\"range-option-picker\\\">\\n        <xsl:param name=\\\"start\\\" />\\n        <xsl:param name=\\\"end\\\" />\\n        <xsl:param name=\\\"step\\\" />\\n        <xsl:param name=\\\"readonly\\\" />\\n        <xsl:param name=\\\"limit\\\" />\\n        <xsl:if test=\\\"not($start > $end)\\\">\\n            <option>\\n                <xsl:if test=\\\"$readonly\\\">\\n                    <xsl:attribute name=\\\"disabled\\\">\\n                        <xsl:value-of select=\\\"'disabled'\\\"/>\\n                    </xsl:attribute>\\n                </xsl:if>\\n                <xsl:attribute name=\\\"value\\\">\\n                    <xsl:choose>\\n                        <xsl:when test=\\\"string($start)\\\">\\n                            <xsl:value-of select=\\\"$start\\\" />\\n                        </xsl:when>\\n                        <xsl:otherwise>\\n                            <xsl:message>ERROR: Could not determine value of select option.</xsl:message>\\n                        </xsl:otherwise>\\n                    </xsl:choose>\\n                </xsl:attribute>\\n                <xsl:value-of select=\\\"$start\\\" />\\n            </option>\\n            <span>\\n                <xsl:attribute name=\\\"data-option-value\\\">\\n                    <xsl:value-of select=\\\"$start\\\" />\\n                </xsl:attribute>\\n                <xsl:value-of select=\\\".\\\"/>\\n            </span>\\n            <xsl:variable name=\\\"next\\\" select=\\\"$start + $step\\\"/>\\n            <xsl:choose>\\n                <xsl:when test=\\\"$limit > 1\\\">\\n                    <xsl:apply-templates select=\\\"current()\\\" mode=\\\"range-option-picker\\\">\\n                        <xsl:with-param name=\\\"start\\\" select=\\\"$next\\\"/>\\n                        <xsl:with-param name=\\\"end\\\" select=\\\"$end\\\"/>\\n                        <xsl:with-param name=\\\"step\\\" select=\\\"$step\\\"/>\\n                        <xsl:with-param name=\\\"readonly\\\" select=\\\"$readonly\\\"/>\\n                        <xsl:with-param name=\\\"limit\\\" select=\\\"$limit - 1\\\"/>\\n                    </xsl:apply-templates>\\n                </xsl:when>\\n                <xsl:otherwise>\\n                    <xsl:message>ERROR: Exceed maximum iterations allowed.</xsl:message>\\n                </xsl:otherwise>\\n            </xsl:choose>\\n        </xsl:if>\\n    </xsl:template>\\n\\n    <xsl:template match=\\\"xf:item\\\" mode=\\\"select-option\\\">\\n        <xsl:param name=\\\"tolerate-spaces\\\" />\\n        <xsl:param name=\\\"readonly\\\" />\\n        <xsl:variable name=\\\"label_translations\\\">\\n            <xsl:apply-templates select=\\\"xf:label\\\" />\\n        </xsl:variable>\\n        <xsl:variable name=\\\"value\\\">\\n            <xsl:value-of select=\\\"xf:value\\\" />\\n            <xsl:if test=\\\"not($tolerate-spaces) and contains(xf:value, ' ')\\\">\\n                <xsl:message terminate=\\\"yes\\\">ERROR: (Multi-)select item found with a value that contains spaces!</xsl:message>\\n            </xsl:if>\\n            <xsl:if test=\\\"not(string(xf:value))\\\">\\n                <xsl:message terminate=\\\"no\\\">WARNING: Select item found without a value!</xsl:message>\\n            </xsl:if>\\n        </xsl:variable>\\n        <option>\\n            <xsl:if test=\\\"$readonly\\\">\\n                <xsl:attribute name=\\\"disabled\\\">\\n                    <xsl:value-of select=\\\"'disabled'\\\"/>\\n                </xsl:attribute>\\n            </xsl:if>\\n            <xsl:attribute name=\\\"value\\\">\\n                <xsl:choose>\\n                    <xsl:when test=\\\"string($value)\\\">\\n                        <xsl:value-of select=\\\"$value\\\" />\\n                    </xsl:when>\\n                    <xsl:otherwise>\\n                        <xsl:message>ERROR: Could not determine value of select option.</xsl:message>\\n                    </xsl:otherwise>\\n                </xsl:choose>\\n            </xsl:attribute>\\n            <!-- better to use default language if defined and otherwise span[1] -->\\n            <xsl:choose>\\n                <!-- TODO: IT WOULD BE MORE EFFICIENT TO EXTRACT THIS FROM exsl:node-set($label_translations) -->\\n                <xsl:when test=\\\"exsl:node-set($label_translations)/span[@lang=$current-lang]\\\">\\n                    <xsl:value-of select=\\\"exsl:node-set($label_translations)/span[@lang=$current-lang] \\\" />\\n                </xsl:when>\\n                <xsl:otherwise>\\n                    <xsl:value-of select=\\\"exsl:node-set($label_translations)/span[1] \\\" />\\n                </xsl:otherwise>\\n            </xsl:choose>\\n        </option>\\n        <xsl:for-each select=\\\"exsl:node-set($label_translations)/span\\\" >\\n            <span>\\n                <xsl:attribute name=\\\"data-option-value\\\">\\n                    <xsl:value-of select=\\\"$value\\\" />\\n                </xsl:attribute>\\n                <xsl:attribute name=\\\"lang\\\">\\n                    <xsl:value-of select=\\\"@lang\\\" />\\n                </xsl:attribute>\\n                <xsl:value-of select=\\\".\\\"/>\\n            </span>\\n        </xsl:for-each>\\n    </xsl:template>\\n\\n    <xsl:template match=\\\"xf:itemset\\\" mode=\\\"templates\\\">\\n        <xsl:param name=\\\"nodeset\\\" />\\n        <xsl:param name=\\\"binding\\\"/>\\n        <xsl:param name=\\\"type\\\"/>\\n        <xsl:choose>\\n            <xsl:when test=\\\"not($type = 'option')\\\">\\n                <label class=\\\"itemset-template\\\">\\n                    <xsl:attribute name=\\\"data-items-path\\\">\\n                        <xsl:value-of select=\\\"@nodeset\\\"/>\\n                    </xsl:attribute>\\n                    <!--<xsl:value-of select=\\\"'__LABEL__'\\\" />-->\\n                    <input>\\n                        <xsl:choose>\\n                            <xsl:when test=\\\"ancestor::odk:rank\\\">\\n                                <xsl:call-template name=\\\"rank-item-attributes\\\"/>\\n                            </xsl:when>\\n                            <xsl:otherwise>\\n                                <xsl:call-template name=\\\"binding-attributes\\\">\\n                                    <xsl:with-param name=\\\"binding\\\" select=\\\"$binding\\\"/>\\n                                    <xsl:with-param name=\\\"nodeset\\\" select=\\\"$nodeset\\\"/>\\n                                </xsl:call-template>\\n                            </xsl:otherwise>\\n                        </xsl:choose>\\n                        <xsl:attribute name=\\\"value\\\"></xsl:attribute>\\n                    </input>\\n                </label>\\n            </xsl:when>\\n            <xsl:otherwise>\\n                <option class=\\\"itemset-template\\\" value=\\\"\\\">\\n                    <xsl:attribute name=\\\"data-items-path\\\">\\n                        <xsl:value-of select=\\\"@nodeset\\\"/>\\n                    </xsl:attribute>\\n                    <xsl:if test=\\\"$binding/@readonly = 'true()'\\\">\\n                       <xsl:attribute name=\\\"disabled\\\"/>\\n                    </xsl:if>\\n                    <xsl:value-of select=\\\"'...'\\\"/>\\n                </option>\\n            </xsl:otherwise>\\n        </xsl:choose>\\n    </xsl:template>\\n\\n    <xsl:template match=\\\"xf:itemset\\\" mode=\\\"labels\\\">\\n        <xsl:variable name=\\\"valueRef\\\" select=\\\"@valueRef\\\" />\\n        <xsl:variable name=\\\"labelRef\\\" select=\\\"@labelRef\\\" />\\n        <xsl:variable name=\\\"itextPath\\\" select=\\\"@itextPath\\\" />\\n\\n        <span class=\\\"itemset-labels\\\">\\n            <xsl:attribute name=\\\"data-value-ref\\\">\\n                <xsl:value-of select=\\\"$valueRef\\\"/>\\n            </xsl:attribute>\\n            <xsl:choose>\\n                <xsl:when test=\\\"contains($labelRef, 'jr:itext(')\\\">\\n                    <xsl:attribute name=\\\"data-label-type\\\">\\n                        <xsl:value-of select=\\\"'itext'\\\"/>\\n                    </xsl:attribute>\\n                    <xsl:variable name=\\\"label-node-name\\\"\\n                        select=\\\"substring(substring-after($labelRef, 'itext('),1,string-length(substring-after($labelRef, 'itext('))-1)\\\"/>\\n                    <xsl:attribute name=\\\"data-label-ref\\\">\\n                        <xsl:value-of select=\\\"$label-node-name\\\"/>\\n                    </xsl:attribute>\\n\\n                    <xsl:for-each select=\\\"./*[local-name()=$label-node-name]\\\">\\n                        <!-- so this is support for itext(node) (not itext(path/to/node)), but only 'ad-hoc' for itemset labels for now -->\\n                        <xsl:variable name=\\\"id\\\" select=\\\".\\\" />\\n\\n                        <xsl:call-template name=\\\"translations\\\">\\n                            <xsl:with-param name=\\\"id\\\" select=\\\"$id\\\"/>\\n                            <xsl:with-param name=\\\"class\\\" select=\\\"'option-label'\\\"/>\\n                        </xsl:call-template>\\n                    </xsl:for-each>\\n                </xsl:when>\\n                <xsl:otherwise>\\n                    <xsl:attribute name=\\\"data-label-ref\\\">\\n                        <xsl:value-of select=\\\"$labelRef\\\"/>\\n                    </xsl:attribute>\\n                </xsl:otherwise>\\n            </xsl:choose>\\n            <xsl:text> <!-- This preserves whitespace which affects snapshot tests. --></xsl:text>\\n        </span>\\n    </xsl:template>\\n\\n    <!--\\n       turns STRING: '/path/to/node' into: /*[name()='path'/*[name()='to']/*[name()='node'\\n    -->\\n    <!--\\n    <xsl:template name=\\\"string-to-path\\\">\\n        <xsl:param name=\\\"path-string\\\"/>\\n        <xsl:if test=\\\"starts-with($path-string, '/')\\\">\\n            <xsl:value-of select=\\\"'/'\\\"/>\\n        </xsl:if>\\n        <xsl:choose>\\n            <xsl:when test=\\\"contains($path-string, '/')\\\">\\n                <xsl:value-of select=\\\"substring-before($path-string, '/')\\\"/>\\n                <xsl:call-template name=\\\"string-to-path\\\">\\n                    <xsl:with-param name=\\\"path-string\\\" select=\\\"substring-after($path-string, '/')\\\"/>\\n                </xsl:call-template>\\n            </xsl:when>\\n        </xsl:choose>\\n    </xsl:template>\\n    -->\\n\\n    <xsl:template name=\\\"select-select\\\">\\n        <xsl:param name=\\\"nodeset\\\"/>\\n        <xsl:param name=\\\"binding\\\"/>\\n        <xsl:variable name=\\\"appearance\\\" select=\\\"./@appearance\\\" />\\n        <xsl:variable name=\\\"datalist-id\\\" select=\\\"translate($nodeset, ' _-.\\\\/', '')\\\"/>\\n        <xsl:variable name=\\\"type\\\">\\n           <xsl:choose>\\n               <xsl:when test=\\\"local-name() = 'select'\\\">select_multiple</xsl:when>\\n               <xsl:otherwise>select_one</xsl:otherwise>\\n           </xsl:choose>\\n        </xsl:variable>\\n        <xsl:variable name=\\\"element\\\">\\n            <xsl:choose>\\n                <xsl:when test=\\\"local-name() = 'select1' and (contains(@appearance, 'autocomplete') or contains(@appearance, 'search'))\\\">datalist</xsl:when>\\n                <xsl:otherwise>select</xsl:otherwise>\\n            </xsl:choose>\\n        </xsl:variable>\\n        <xsl:variable name=\\\"options\\\">\\n            <xsl:choose>\\n                <xsl:when test=\\\"contains(@appearance, 'picker')\\\">\\n                    <xsl:apply-templates select=\\\"current()\\\" mode=\\\"range-option-picker\\\">\\n                        <xsl:with-param name=\\\"start\\\" select=\\\"@start\\\" />\\n                        <xsl:with-param name=\\\"end\\\" select=\\\"@end\\\" />\\n                        <xsl:with-param name=\\\"step\\\" select=\\\"@step\\\" />\\n                        <xsl:with-param name=\\\"readonly\\\" select=\\\"$binding/@readonly = 'true()'\\\" />\\n                        <xsl:with-param name=\\\"limit\\\" select=\\\"500\\\" />\\n                    </xsl:apply-templates>\\n                </xsl:when>\\n                <xsl:otherwise>\\n                    <xsl:apply-templates select=\\\"xf:item\\\" mode=\\\"select-option\\\">\\n                        <xsl:with-param name=\\\"tolerate-spaces\\\" select=\\\"$type = 'select_one'\\\" />\\n                        <xsl:with-param name=\\\"readonly\\\" select=\\\"$binding/@readonly = 'true()'\\\" />\\n                    </xsl:apply-templates>\\n                </xsl:otherwise>\\n            </xsl:choose>\\n        </xsl:variable>\\n        <label>\\n            <xsl:attribute name=\\\"class\\\">\\n                <xsl:value-of select=\\\"'question '\\\"/>\\n                <xsl:if test=\\\"./@appearance or ./@rows\\\">\\n                    <xsl:value-of select=\\\"'or-appearances-placeholder '\\\" />\\n                </xsl:if>\\n                <xsl:if test=\\\"$binding/@relevant\\\">\\n                    <xsl:value-of select=\\\"' or-branch pre-init '\\\"/>\\n                </xsl:if>\\n            </xsl:attribute>\\n            <xsl:call-template name=\\\"appearance\\\" />\\n            <xsl:apply-templates select=\\\"./@kb:image-customization\\\"/>\\n            <xsl:apply-templates select=\\\"xf:label\\\" />\\n            <xsl:apply-templates select=\\\"$binding/@required\\\"/>\\n            <xsl:apply-templates select=\\\"xf:hint\\\" />\\n            <xsl:if test=\\\"$element = 'datalist'\\\">\\n                <input>\\n                    <xsl:call-template name=\\\"binding-attributes\\\">\\n                        <xsl:with-param name=\\\"nodeset\\\" select=\\\"$nodeset\\\" />\\n                        <xsl:with-param name=\\\"binding\\\" select=\\\"$binding\\\" />\\n                        <xsl:with-param name=\\\"type\\\" select=\\\"$type\\\" />\\n                    </xsl:call-template>\\n                    <!-- override type attribute -->\\n                    <xsl:attribute name=\\\"type\\\">\\n                        <xsl:value-of select=\\\"'text'\\\"/>\\n                    </xsl:attribute>\\n                    <xsl:attribute name=\\\"list\\\">\\n                        <xsl:value-of select=\\\"$datalist-id\\\"/>\\n                    </xsl:attribute>\\n                </input>\\n            </xsl:if>\\n            <xsl:element name=\\\"{$element}\\\">\\n                <xsl:choose>\\n                    <xsl:when test=\\\"$element != 'datalist'\\\">\\n                        <xsl:call-template name=\\\"binding-attributes\\\">\\n                            <xsl:with-param name=\\\"nodeset\\\" select=\\\"$nodeset\\\" />\\n                            <xsl:with-param name=\\\"binding\\\" select=\\\"$binding\\\" />\\n                            <xsl:with-param name=\\\"type\\\" select=\\\"$type\\\" />\\n                        </xsl:call-template>\\n                    </xsl:when>\\n                    <xsl:otherwise>\\n                        <xsl:attribute name=\\\"id\\\">\\n                            <xsl:value-of select=\\\"$datalist-id\\\"/>\\n                        </xsl:attribute>\\n                    </xsl:otherwise>\\n                </xsl:choose>\\n                <xsl:choose>\\n                    <xsl:when test=\\\"not(./xf:itemset)\\\">\\n                        <option value=\\\"\\\">...</option>\\n                        <xsl:for-each select=\\\"exsl:node-set($options)/option\\\">\\n                            <xsl:copy-of select=\\\".\\\"/>\\n                        </xsl:for-each>\\n                    </xsl:when>\\n                    <xsl:otherwise>\\n                        <xsl:apply-templates select=\\\"xf:itemset\\\" mode=\\\"templates\\\">\\n                            <xsl:with-param name=\\\"binding\\\" select=\\\"$binding\\\"/>\\n                            <xsl:with-param name=\\\"type\\\" select=\\\"'option'\\\"/>\\n                        </xsl:apply-templates>\\n                    </xsl:otherwise>\\n                </xsl:choose>\\n            </xsl:element>\\n            <span class=\\\"or-option-translations\\\" style=\\\"display:none;\\\">\\n                <xsl:if test=\\\"not(./xf:itemset) and $translated = 'true'\\\">\\n                    <xsl:for-each select=\\\"exsl:node-set($options)/span\\\">\\n                        <xsl:copy-of select=\\\".\\\" />\\n                    </xsl:for-each>\\n                </xsl:if>\\n                <xsl:text>\\n                </xsl:text>\\n            </span>\\n            <xsl:if test=\\\"./xf:itemset\\\">\\n                <xsl:apply-templates select=\\\"xf:itemset\\\" mode=\\\"labels\\\"/>\\n            </xsl:if>\\n            <xsl:if test=\\\"./xf:setvalue[@event] or ./odk:setgeopoint[@event]\\\">\\n                <xsl:apply-templates select=\\\"./xf:setvalue[@event] | ./odk:setgeopoint[@event]\\\" />\\n            </xsl:if>\\n            <xsl:call-template name=\\\"constraint-and-required-msg\\\" >\\n                <xsl:with-param name=\\\"binding\\\" select=\\\"$binding\\\"/>\\n            </xsl:call-template>\\n        </label>\\n    </xsl:template>\\n\\n    <xsl:template name=\\\"select-input\\\">\\n        <xsl:param name=\\\"nodeset\\\"/>\\n        <xsl:param name=\\\"binding\\\"/>\\n        <!--\\n            legends are a royal pain-in-the-ass, but semantically correct to use. To restore sanity, the least\\n            ugly solution that works regardless of the legend text + hint length (and showing a nice error background)\\n            is to use a double fieldset (though another outer element would be okay too). Is consequence of being stingy with\\n            # of DOM elements used.\\n        -->\\n        <fieldset>\\n            <xsl:attribute name=\\\"class\\\">\\n                <xsl:value-of select=\\\"'question '\\\"/>\\n                <xsl:if test=\\\"not(contains(@appearance, 'compact') or contains(@appearance, 'list-nolabel') or contains(@appearance, 'label') or contains(@appearance, 'likert') or contains(@appearance, 'horizontal-compact') or contains(@appearance, 'no-buttons'))\\\" >\\n                    <xsl:value-of select=\\\"'simple-select '\\\"/>\\n                </xsl:if>\\n                <xsl:if test=\\\"local-name() = 'trigger'\\\">\\n                    <xsl:value-of select=\\\"'trigger '\\\"/>\\n                </xsl:if>\\n                <xsl:if test=\\\"$binding/@relevant\\\">\\n                    <xsl:value-of select=\\\"'or-branch pre-init '\\\"/>\\n                </xsl:if>\\n                <xsl:if test=\\\"@appearance\\\">\\n                    <xsl:value-of select=\\\"'or-appearances-placeholder '\\\"></xsl:value-of>\\n                </xsl:if>\\n            </xsl:attribute>\\n            <xsl:if test=\\\"@appearance\\\">\\n                <xsl:call-template name=\\\"appearance\\\" />\\n            </xsl:if>\\n            <xsl:apply-templates select=\\\"./@kb:image-customization\\\"/>\\n            <xsl:apply-templates select=\\\"./@kb:flash\\\"/>\\n            <fieldset>\\n                <!--<xsl:if test=\\\"./xf:itemset\\\">\\n                    <xsl:attribute name=\\\"data-itemset\\\"/>\\n                </xsl:if>-->\\n                <legend>\\n                    <xsl:apply-templates select=\\\"xf:label\\\" />\\n                    <xsl:apply-templates select=\\\"$binding/@required\\\"/>\\n                    <xsl:apply-templates select=\\\"xf:hint\\\" />\\n                    <xsl:text>\\n                    </xsl:text>\\n                </legend>\\n                <xsl:if test=\\\"local-name() = 'rank'\\\">\\n                    <input class=\\\"rank\\\">\\n                        <xsl:call-template name=\\\"binding-attributes\\\">\\n                            <xsl:with-param name=\\\"binding\\\" select=\\\"$binding\\\"/>\\n                            <xsl:with-param name=\\\"nodeset\\\" select=\\\"$nodeset\\\"/>\\n                        </xsl:call-template>\\n                    </input>\\n                </xsl:if>\\n                <div class=\\\"option-wrapper\\\">\\n                    <xsl:choose>\\n                        <xsl:when test=\\\"local-name() = 'trigger'\\\">\\n                            <label>\\n                                <input value=\\\"OK\\\">\\n                                    <xsl:call-template name=\\\"binding-attributes\\\">\\n                                        <xsl:with-param name=\\\"binding\\\" select=\\\"$binding\\\"/>\\n                                        <xsl:with-param name=\\\"nodeset\\\" select=\\\"$nodeset\\\"/>\\n                                    </xsl:call-template>\\n                                </input>\\n                                <span class=\\\"option-label active\\\" lang=\\\"\\\">\\n                                    <xsl:value-of select=\\\"'OK'\\\"/>\\n                                </span>\\n                            </label>\\n                        </xsl:when>\\n                        <xsl:when test=\\\"not(./xf:itemset)\\\">\\n                            <xsl:apply-templates select=\\\"xf:item\\\" />\\n                        </xsl:when>\\n                        <xsl:otherwise>\\n                            <xsl:apply-templates select=\\\"xf:itemset\\\" mode=\\\"templates\\\">\\n                                <xsl:with-param name=\\\"nodeset\\\" select=\\\"$nodeset\\\" />\\n                                <xsl:with-param name=\\\"binding\\\" select=\\\"$binding\\\" />\\n                            </xsl:apply-templates>\\n                            <xsl:apply-templates select=\\\"xf:itemset\\\" mode=\\\"labels\\\"/>\\n                        </xsl:otherwise>\\n                    </xsl:choose>\\n                </div>\\n            </fieldset>\\n             <!-- the only use case at the moment is a <setvalue> or <odk:setgeopoint> child with xforms-value-changed event-->\\n            <xsl:if test=\\\"./xf:setvalue[@event] or ./odk:setgeopoint[@event]\\\">\\n                <xsl:apply-templates select=\\\"./xf:setvalue[@event] | ./odk:setgeopoint[@event]\\\" />\\n            </xsl:if>\\n            <xsl:call-template name=\\\"constraint-and-required-msg\\\" >\\n                <xsl:with-param name=\\\"binding\\\" select=\\\"$binding\\\"/>\\n            </xsl:call-template>\\n        </fieldset>\\n    </xsl:template>\\n\\n\\n    <!--\\n        Don't add any logic or names to odk:rank items\\n    -->\\n    <xsl:template name=\\\"rank-item-attributes\\\">\\n        <xsl:attribute name=\\\"value\\\">\\n            <xsl:value-of select=\\\"./xf:value\\\"/>\\n        </xsl:attribute>\\n        <xsl:attribute name=\\\"class\\\">\\n            <xsl:value-of select=\\\"'ignore'\\\"/>\\n        </xsl:attribute>\\n        <xsl:attribute name=\\\"type\\\">\\n            <xsl:value-of select=\\\"'text'\\\"/>\\n        </xsl:attribute>\\n    </xsl:template>\\n\\n    <!--\\n        Don't add any logic or names to setvalue or setgeopoint items\\n    -->\\n    <xsl:template name=\\\"action-attributes\\\">\\n        <xsl:param name=\\\"binding\\\"/>\\n        <xsl:param name=\\\"nodeset\\\"/>\\n        <xsl:attribute name=\\\"name\\\">\\n            <xsl:value-of select=\\\"normalize-space($nodeset)\\\" />\\n        </xsl:attribute>\\n        <xsl:attribute name=\\\"data-type-xml\\\">\\n            <xsl:call-template name=\\\"xml_type\\\">\\n                <xsl:with-param name=\\\"nodeset\\\" select=\\\"$nodeset\\\"/>\\n            </xsl:call-template>\\n        </xsl:attribute>\\n        <xsl:attribute name=\\\"data-event\\\">\\n            <xsl:value-of select=\\\"./@event\\\"/>\\n        </xsl:attribute>\\n        <xsl:choose>\\n            <xsl:when test=\\\"local-name() = 'setvalue'\\\">\\n                <xsl:attribute name=\\\"data-setvalue\\\">\\n                    <xsl:choose>\\n                        <xsl:when test=\\\"./@value\\\">\\n                            <xsl:value-of select=\\\"./@value\\\" />\\n                        </xsl:when>\\n                        <xsl:when test=\\\"string-length(.) > 0\\\">\\n                            <xsl:value-of select=\\\"concat('&quot;', ./text(), '&quot;')\\\" />\\n                        </xsl:when>\\n                    </xsl:choose>\\n                </xsl:attribute>\\n            </xsl:when>\\n            <xsl:when test=\\\"local-name() = 'setgeopoint'\\\">\\n                <xsl:attribute name=\\\"data-setgeopoint\\\">\\n                    <xsl:value-of select=\\\"true()\\\" />\\n                </xsl:attribute>\\n            </xsl:when>\\n        </xsl:choose>\\n        <xsl:attribute name=\\\"type\\\">\\n            <xsl:value-of select=\\\"'hidden'\\\"/>\\n        </xsl:attribute>\\n        <xsl:if test=\\\"$openclinica = 1\\\">\\n            <xsl:for-each select=\\\"$binding/@*[starts-with(name(), 'oc:') and not(substring-before(name(), 'Msg'))]\\\" >\\n                <xsl:attribute name=\\\"{concat('data-oc-', local-name(.))}\\\">\\n                    <xsl:value-of select=\\\"normalize-space(.)\\\" />\\n                </xsl:attribute>\\n            </xsl:for-each>\\n        </xsl:if>\\n    </xsl:template>\\n\\n\\n    <!--\\n        adds binding attributes to the context node, meant for <input>, <select>, <textarea>\\n    -->\\n    <xsl:template name=\\\"binding-attributes\\\">\\n        <xsl:param name=\\\"binding\\\"/>\\n        <xsl:param name=\\\"nodeset\\\"/>\\n        <xsl:param name=\\\"type\\\"/>\\n        <xsl:variable name=\\\"xml-type\\\">\\n            <xsl:call-template name=\\\"xml_type\\\">\\n                <xsl:with-param name=\\\"nodeset\\\" select=\\\"$nodeset\\\"/>\\n                <!--<xsl:with-param name=\\\"binding\\\" select=\\\"$binding\\\"/>-->\\n            </xsl:call-template>\\n        </xsl:variable>\\n        <xsl:variable name=\\\"html-input-type\\\">\\n            <xsl:call-template name=\\\"html_type\\\">\\n                <xsl:with-param name=\\\"xml_type\\\" select=\\\"$xml-type\\\" />\\n            </xsl:call-template>\\n        </xsl:variable>\\n        <xsl:choose>\\n            <xsl:when test=\\\"$type = 'select_multiple'\\\">\\n                <xsl:attribute name=\\\"multiple\\\">multiple</xsl:attribute>\\n            </xsl:when>\\n            <xsl:when test=\\\"$type = 'select_one'\\\"></xsl:when>\\n            <xsl:when test=\\\"$type = 'textarea'\\\"></xsl:when>\\n            <xsl:when test=\\\"$type = 'rank'\\\">\\n                <xsl:attribute name=\\\"type\\\">rank</xsl:attribute>\\n            </xsl:when>\\n            <xsl:otherwise>\\n                <xsl:attribute name=\\\"type\\\">\\n                    <xsl:value-of select=\\\"$html-input-type\\\"/>\\n                </xsl:attribute>\\n            </xsl:otherwise>\\n        </xsl:choose>\\n        <xsl:attribute name=\\\"name\\\">\\n            <xsl:value-of select=\\\"normalize-space($nodeset)\\\" />\\n        </xsl:attribute>\\n        <xsl:if test=\\\"$html-input-type = 'radio'\\\">\\n            <xsl:attribute name=\\\"data-name\\\">\\n                <xsl:value-of select=\\\"normalize-space($nodeset)\\\" />\\n            </xsl:attribute>\\n        </xsl:if>\\n        <xsl:if test=\\\"local-name() = 'item'\\\">\\n            <xsl:attribute name=\\\"value\\\">\\n                <xsl:value-of select=\\\"./xf:value\\\"/>\\n            </xsl:attribute>\\n        </xsl:if>\\n        <xsl:if test=\\\"(string-length($binding/@required) &gt; 0) and not($binding/@required = 'false()') and not(local-name() = 'bind')\\\">\\n            <xsl:attribute name=\\\"data-required\\\">\\n                <xsl:value-of select=\\\"$binding/@required\\\" />\\n            </xsl:attribute>\\n        </xsl:if>\\n        <xsl:if test=\\\"$binding/@constraint\\\">\\n            <xsl:attribute name=\\\"data-constraint\\\">\\n                <xsl:value-of select=\\\"$binding/@constraint\\\" />\\n            </xsl:attribute>\\n        </xsl:if>\\n        <xsl:if test=\\\"$binding/@relevant\\\">\\n            <xsl:attribute name=\\\"data-relevant\\\">\\n                <xsl:value-of select=\\\"$binding/@relevant\\\"/>\\n            </xsl:attribute>\\n        </xsl:if>\\n        <xsl:if test=\\\"$binding/@calculate\\\">\\n            <xsl:attribute name=\\\"data-calculate\\\">\\n                <xsl:value-of select=\\\"$binding/@calculate\\\" />\\n            </xsl:attribute>\\n        </xsl:if>\\n        <xsl:if test=\\\"$binding/@jr:preload\\\">\\n            <xsl:attribute name=\\\"data-preload\\\">\\n                <xsl:value-of select=\\\"$binding/@jr:preload\\\"/>\\n            </xsl:attribute>\\n            <xsl:attribute name=\\\"data-preload-params\\\">\\n                <xsl:value-of select=\\\"$binding/@jr:preloadParams\\\"/>\\n            </xsl:attribute>\\n        </xsl:if>\\n        <xsl:if test=\\\"$binding/@enk:for\\\">\\n            <xsl:attribute name=\\\"data-for\\\">\\n                <xsl:value-of select=\\\"normalize-space($binding/@enk:for)\\\" />\\n            </xsl:attribute>\\n        </xsl:if>\\n        <xsl:if test=\\\"$openclinica = 1\\\">\\n            <xsl:for-each select=\\\"$binding/@*[starts-with(name(), 'oc:') and not(substring-before(name(), 'Msg'))]\\\" >\\n                <xsl:attribute name=\\\"{concat('data-oc-', local-name(.))}\\\">\\n                    <xsl:value-of select=\\\"normalize-space(.)\\\" />\\n                </xsl:attribute>\\n            </xsl:for-each>\\n        </xsl:if>\\n        <xsl:if test=\\\"$binding/@orx:max-pixels\\\">\\n            <xsl:attribute name=\\\"data-max-pixels\\\">\\n                <xsl:value-of select=\\\"normalize-space($binding/@orx:max-pixels)\\\" />\\n            </xsl:attribute>\\n        </xsl:if>\\n        <xsl:attribute name=\\\"data-type-xml\\\">\\n            <xsl:value-of select=\\\"$xml-type\\\" />\\n        </xsl:attribute>\\n        <xsl:if test=\\\"$xml-type = 'decimal'\\\">\\n            <xsl:attribute name=\\\"step\\\">any</xsl:attribute>\\n        </xsl:if>\\n        <xsl:if test=\\\"$binding/@readonly = 'true()' and not($html-input-type = 'hidden')\\\" >\\n            <!--\\n                This also adds a readonly attribute to <select> which is not valid HTML.\\n                We could add some logic to avoid that (the <option>s already get the disabled attribute),\\n                but it's an extra line of defence and doesn't really hurt. The input change handler in\\n                Enketo Core ignores changes on a <select readonly>.\\n            -->\\n            <xsl:attribute name=\\\"readonly\\\">readonly</xsl:attribute>\\n        </xsl:if>\\n        <xsl:if test=\\\"local-name() = 'range'\\\">\\n        <!-- note that due to the unhelpful default value behavior of input type=range in HTML, we use type=number -->\\n            <xsl:if test=\\\"@start\\\">\\n                <xsl:attribute name=\\\"min\\\">\\n                    <xsl:value-of select=\\\"@start\\\" />\\n                </xsl:attribute>\\n            </xsl:if>\\n            <xsl:if test=\\\"@end\\\">\\n                <xsl:attribute name=\\\"max\\\">\\n                    <xsl:value-of select=\\\"@end\\\" />\\n                </xsl:attribute>\\n            </xsl:if>\\n            <xsl:if test=\\\"@step\\\">\\n                <xsl:attribute name=\\\"step\\\">\\n                    <xsl:value-of select=\\\"@step\\\" />\\n                </xsl:attribute>\\n            </xsl:if>\\n        </xsl:if>\\n        <xsl:if test=\\\"$html-input-type = 'file'\\\">\\n            <xsl:attribute name=\\\"accept\\\">\\n                <xsl:choose>\\n                    <xsl:when test=\\\"@accept\\\">\\n                        <xsl:value-of select=\\\"@accept\\\" />\\n                    </xsl:when>\\n                    <xsl:when test=\\\"@mediatype\\\">\\n                        <xsl:value-of select=\\\"@mediatype\\\" />\\n                    </xsl:when>\\n                </xsl:choose>\\n            </xsl:attribute>\\n            <!-- Note, this test captures new, new-front, new-rear -->\\n            <xsl:if test=\\\"contains(@appearance, 'new')\\\">\\n                <xsl:attribute name=\\\"capture\\\">\\n                    <xsl:choose>\\n                        <xsl:when test=\\\"contains(@appearance, 'new-front')\\\">\\n                            <xsl:value-of select=\\\"'user'\\\"/>\\n                        </xsl:when>\\n                        <xsl:when test=\\\"contains(@appearance, 'new-rear')\\\">\\n                            <xsl:value-of select=\\\"'environment'\\\"/>\\n                        </xsl:when>\\n                        <!-- else (if appearance=\\\"new\\\"), the capture attribute remains empty, by design -->\\n                    </xsl:choose>\\n                </xsl:attribute>\\n            </xsl:if>\\n        </xsl:if>\\n    </xsl:template>\\n\\n    <xsl:template match=\\\"xf:select | xf:select1 | odk:rank | xf:trigger\\\">\\n        <xsl:variable name=\\\"nodeset_used\\\">\\n            <xsl:call-template name=\\\"nodeset_used\\\" />\\n        </xsl:variable>\\n        <xsl:variable name=\\\"nodeset\\\">\\n            <xsl:call-template name=\\\"nodeset_absolute\\\">\\n                <xsl:with-param name=\\\"nodeset_u\\\" select=\\\"$nodeset_used\\\"/>\\n            </xsl:call-template>\\n        </xsl:variable>\\n        <xsl:variable name=\\\"binding\\\" select=\\\"key('nodeset-bindings',$nodeset_used) | key('nodeset-bindings', $nodeset)\\\" />\\n        <xsl:choose>\\n            <xsl:when test=\\\"( local-name() = 'select' or local-name() = 'select1' ) and contains(@appearance, 'minimal') or contains(@appearance, 'autocomplete') or contains(@appearance, 'search')\\\">\\n                <xsl:call-template name=\\\"select-select\\\">\\n                    <xsl:with-param name=\\\"nodeset\\\" select=\\\"$nodeset\\\" />\\n                    <xsl:with-param name=\\\"binding\\\" select=\\\"$binding\\\" />\\n                </xsl:call-template>\\n            </xsl:when>\\n            <xsl:otherwise>\\n                <xsl:call-template name=\\\"select-input\\\">\\n                    <xsl:with-param name=\\\"nodeset\\\" select=\\\"$nodeset\\\" />\\n                    <xsl:with-param name=\\\"binding\\\" select=\\\"$binding\\\" />\\n                </xsl:call-template>\\n            </xsl:otherwise>\\n        </xsl:choose>\\n    </xsl:template>\\n\\n    <xsl:template match=\\\"xf:label | xf:hint | xf:bind/@jr:constraintMsg | xf:bind/@jr:requiredMsg | xf:bind/@*[starts-with(name(), 'oc:')]\\\">\\n        <xsl:variable name=\\\"class\\\">\\n            <xsl:choose>\\n                <xsl:when test=\\\"name() = 'jr:constraintMsg'\\\">\\n                    <xsl:value-of select=\\\"'or-constraint-msg'\\\" />\\n                </xsl:when>\\n                <xsl:when test=\\\"local-name() = 'requiredMsg'\\\">\\n                    <xsl:value-of select=\\\"'or-required-msg'\\\" />\\n                </xsl:when>\\n                <xsl:when test=\\\"local-name() = 'relevantMsg'\\\">\\n                    <xsl:value-of select=\\\"'or-relevant-msg'\\\" />\\n                </xsl:when>\\n                <xsl:when test=\\\"local-name() = 'hint'\\\">\\n                    <xsl:value-of select=\\\"'or-hint'\\\" />\\n                </xsl:when>\\n                <xsl:when test=\\\"local-name() = 'label' and local-name(..) != 'item' \\\">\\n                    <xsl:value-of select=\\\"'question-label'\\\"/>\\n                </xsl:when>\\n                <xsl:when test=\\\"local-name() = 'label' and local-name(..) = 'item' \\\">\\n                    <xsl:value-of select=\\\"'option-label'\\\"/>\\n                </xsl:when>\\n                <xsl:when test=\\\"$openclinica = 1 and starts-with(name(), 'oc:constraint') and string-length(local-name()) > 13 and substring(name(), string-length(name()) - string-length('Msg') +1) = 'Msg' \\\" >\\n                    <xsl:value-of select=\\\"concat('or-', substring-before(local-name(.), 'Msg'), '-msg')\\\"/>\\n                </xsl:when>\\n            </xsl:choose>\\n        </xsl:variable>\\n        <xsl:choose>\\n            <xsl:when test=\\\"not(string(./@ref)) and ( string(.) or string(./xf:output/@value) ) and not(contains(.,'itext('))\\\">\\n                <span lang=\\\"\\\">\\n                    <xsl:attribute name=\\\"class\\\">\\n                        <xsl:value-of select=\\\"concat($class, ' active')\\\" />\\n                    </xsl:attribute>\\n                    <xsl:call-template name=\\\"text-content\\\" />\\n                </span>\\n            </xsl:when>\\n            <xsl:otherwise>\\n                <xsl:variable name=\\\"ref\\\">\\n                   <xsl:choose>\\n                        <xsl:when test=\\\"@ref\\\">\\n                            <xsl:value-of select=\\\"@ref\\\" />\\n                        </xsl:when>\\n                        <xsl:otherwise>\\n                            <xsl:value-of select=\\\".\\\" />\\n                        </xsl:otherwise>\\n                    </xsl:choose>\\n                </xsl:variable>\\n\\n                <xsl:variable name=\\\"refid\\\"\\n                    select=\\\"substring(substring-after($ref, 'itext('),2,string-length(substring-after($ref, 'itext('))-3)\\\"/>\\n            <!--\\n                ** HUGE PERFORMANCE HOG! **\\n                <xsl:if test=\\\"not(/h:html/h:head/xf:model/xf:itext/xf:translation/xf:text[@id=$refid])\\\">\\n                    <xsl:message>ERROR: itext(id) found with non-existing id: \\\"<xsl:value-of select=\\\"$refid\\\"/>\\\". Maybe itext(path/to/node) construct was used, which is not supported.</xsl:message>\\n                </xsl:if>\\n            -->\\n                <xsl:call-template name=\\\"translations\\\">\\n                    <xsl:with-param name=\\\"id\\\" select=\\\"$refid\\\"/>\\n                    <xsl:with-param name=\\\"class\\\" select=\\\"$class\\\"/>\\n                </xsl:call-template>\\n            </xsl:otherwise>\\n        </xsl:choose>\\n    </xsl:template>\\n\\n    <xsl:template name=\\\"constraint-and-required-msg\\\">\\n        <xsl:param name=\\\"binding\\\"/>\\n        <xsl:if test=\\\"string-length($binding/@constraint) &gt; 0\\\">\\n            <xsl:choose>\\n                <xsl:when test=\\\"$binding/@jr:constraintMsg\\\">\\n                    <xsl:apply-templates select=\\\"$binding/@jr:constraintMsg\\\" />\\n                </xsl:when>\\n                <xsl:otherwise>\\n                    <xsl:call-template name=\\\"default-constraint-msg\\\"/>\\n                </xsl:otherwise>\\n            </xsl:choose>\\n        </xsl:if>\\n        <xsl:if test=\\\"(string-length($binding/@required) &gt; 0) and not($binding/@required = 'false()')\\\">\\n            <xsl:choose>\\n                <xsl:when test=\\\"$binding/@jr:requiredMsg\\\">\\n                    <xsl:apply-templates select=\\\"$binding/@jr:requiredMsg\\\" />\\n                </xsl:when>\\n                <xsl:otherwise>\\n                    <xsl:call-template name=\\\"default-required-msg\\\"/>\\n                </xsl:otherwise>\\n            </xsl:choose>\\n        </xsl:if>\\n        <xsl:if test=\\\"$openclinica = 1\\\">\\n            <xsl:if test=\\\"(string-length($binding/@relevant) &gt; 0) and not($binding/@relevant = 'true()')\\\">\\n                <xsl:choose>\\n                    <xsl:when test=\\\"$binding/@oc:relevantMsg\\\">\\n                        <xsl:apply-templates select=\\\"$binding/@oc:relevantMsg\\\" />\\n                    </xsl:when>\\n                    <xsl:otherwise>\\n                        <xsl:call-template name=\\\"default-relevant-msg\\\"/>\\n                    </xsl:otherwise>\\n                </xsl:choose>\\n            </xsl:if>\\n            <xsl:for-each select=\\\"$binding/@*[starts-with(name(), 'oc:constraint') and substring(name(), string-length(name()) - string-length('Msg') +1) = 'Msg' ]\\\" >\\n                <xsl:apply-templates select=\\\".\\\" />\\n            </xsl:for-each>\\n        </xsl:if>\\n    </xsl:template>\\n\\n    <xsl:template name=\\\"default-constraint-msg\\\">\\n        <span class=\\\"or-constraint-msg active\\\" lang=\\\"\\\" data-i18n=\\\"constraint.invalid\\\">Value not allowed</span>\\n    </xsl:template>\\n\\n    <xsl:template name=\\\"default-required-msg\\\">\\n        <span class=\\\"or-required-msg active\\\" lang=\\\"\\\" data-i18n=\\\"constraint.required\\\">This field is required</span>\\n    </xsl:template>\\n\\n    <xsl:template name=\\\"default-relevant-msg\\\">\\n        <span class=\\\"or-relevant-msg active\\\" lang=\\\"\\\" data-i18n=\\\"constraint.relevant\\\">This value should be cleared</span>\\n    </xsl:template>\\n\\n    <xsl:template match=\\\"xf:bind/@required\\\">\\n        <xsl:if test=\\\"not(. = 'false()' or string-length(.) = 0)\\\">\\n            <span class=\\\"required\\\">*</span>\\n        </xsl:if>\\n    </xsl:template>\\n\\n     <xsl:template match=\\\"xf:output\\\">\\n        <span class=\\\"or-output\\\">\\n            <xsl:variable name=\\\"itext\\\"\\n                    select=\\\"substring(substring-after(@value, 'itext('),2,string-length(substring-after(@value, 'itext('))-3)\\\"/>\\n            <xsl:attribute name=\\\"data-value\\\">\\n                <!-- this is just a quick hack! Need a robust itext processor that can make a distinction\\n                between id and node and figure out which instance to take node from with multiple instances -->\\n                <xsl:choose>\\n                    <xsl:when test=\\\"string-length($itext) &gt; 0\\\" >\\n                        <xsl:value-of select=\\\"$itext\\\"/>\\n                    </xsl:when>\\n                    <xsl:otherwise>\\n                        <xsl:value-of select=\\\"@value\\\"/>\\n                    </xsl:otherwise>\\n                </xsl:choose>\\n            </xsl:attribute>\\n            <xsl:text><!-- avoids self-closing tags on empty elements --> </xsl:text>\\n        </span>\\n    </xsl:template>\\n\\n    <xsl:template match=\\\"@kb:image-customization\\\">\\n        <xsl:if test=\\\".\\\">\\n            <xsl:attribute name=\\\"data-image-customization\\\">\\n                <xsl:value-of select=\\\"normalize-space(.)\\\" />\\n            </xsl:attribute>\\n        </xsl:if>\\n    </xsl:template>\\n\\n    <xsl:template match=\\\"@kb:flash\\\">\\n        <xsl:if test=\\\".\\\">\\n            <xsl:attribute name=\\\"data-flash\\\">\\n                <xsl:value-of select=\\\"normalize-space(.)\\\" />\\n            </xsl:attribute>\\n        </xsl:if>\\n    </xsl:template>\\n\\n    <xsl:template name=\\\"text-content\\\">\\n        <xsl:choose>\\n            <xsl:when test=\\\"string-length(.) = 0\\\">\\n                <xsl:text><!-- avoids self-closing tags on empty elements --> </xsl:text>\\n                <xsl:apply-templates />\\n            </xsl:when>\\n            <!-- Firefox does not apply templates to these attributes -->\\n            <xsl:when test=\\\"name() = 'jr:constraintMsg' or name() = 'jr:requiredMsg' or ($openclinica = 1 and starts-with(name(), 'oc:') and substring(name(), string-length(name()) - string-length('Msg') + 1) = 'Msg' )\\\">\\n                <xsl:value-of select=\\\".\\\" />\\n            </xsl:when>\\n            <xsl:otherwise>\\n                <xsl:apply-templates />\\n            </xsl:otherwise>\\n        </xsl:choose>\\n    </xsl:template>\\n\\n    <xsl:template name=\\\"translations\\\">\\n        <xsl:param name=\\\"id\\\"/>\\n        <xsl:param name=\\\"class\\\"/>\\n        <xsl:for-each select=\\\"key('itext-texts-by-id', $id)\\\">\\n            <xsl:variable name=\\\"lang\\\" select=\\\"ancestor::xf:translation/@lang\\\"/>\\n            <xsl:variable name=\\\"active\\\">\\n                <xsl:if test=\\\"string($lang) = string($current-lang)\\\">active</xsl:if>\\n            </xsl:variable>\\n            <xsl:variable name=\\\"notext\\\">\\n                <xsl:value-of select=\\\"string-length(./xf:value[@form='long' or @form='short' or not(@form)]) = 0\\\" />\\n            </xsl:variable>\\n            <!-- text labels get priority -->\\n            <xsl:for-each select=\\\"./xf:value\\\" >\\n                <xsl:if test=\\\"not(@form = 'image' or @form = 'video' or @form = 'audio' or @form='big-image' or @form='guidance')\\\">\\n                    <span>\\n                        <xsl:attribute name=\\\"lang\\\">\\n                            <xsl:value-of select=\\\"$lang\\\"/>\\n                        </xsl:attribute>\\n                        <xsl:if test=\\\"string($class) or @form or string($active)\\\">\\n                            <xsl:attribute name=\\\"class\\\">\\n                                <xsl:value-of select=\\\"concat($class, ' ')\\\" />\\n                                <xsl:if test=\\\"@form\\\">\\n                                    <xsl:value-of select=\\\"concat(' or-form-', @form, ' ')\\\" />\\n                                </xsl:if>\\n                                <xsl:if test=\\\"@form = 'long' or (@form = 'short' and not(../node()/@form = 'long')) or not(@form) or @form = 'guidance'\\\">\\n                                    <xsl:value-of select=\\\"$active\\\" />\\n                                </xsl:if>\\n                            </xsl:attribute>\\n                        </xsl:if>\\n                        <xsl:attribute name=\\\"data-itext-id\\\">\\n                            <xsl:value-of select=\\\"$id\\\"/>\\n                        </xsl:attribute>\\n                        <xsl:call-template name=\\\"text-content\\\" />\\n                    </span>\\n                </xsl:if>\\n            </xsl:for-each>\\n            <!-- guidance is next -->\\n            <xsl:for-each select=\\\"./xf:value[@form = 'guidance']\\\">\\n                <details>\\n                    <xsl:attribute name=\\\"lang\\\">\\n                        <xsl:value-of select=\\\"$lang\\\"/>\\n                    </xsl:attribute>\\n                    <xsl:if test=\\\"string($class) or @form or string($active)\\\">\\n                        <xsl:attribute name=\\\"class\\\">\\n                            <xsl:value-of select=\\\"concat($class, ' or-form-', @form, ' ', $active)\\\" />\\n                        </xsl:attribute>\\n                    </xsl:if>\\n                    <summary data-i18n=\\\"hint.guidance.details\\\">more details</summary>\\n                    <xsl:call-template name=\\\"text-content\\\" />\\n                </details>\\n            </xsl:for-each>\\n            <!-- media labels in document order -->\\n            <xsl:for-each select=\\\"./xf:value[@form = 'image' or @form = 'video' or @form = 'audio' and not($class = 'or-hint')]\\\" >\\n                <xsl:choose>\\n                    <xsl:when test=\\\"@form = 'image'\\\" >\\n                        <!-- test if there is a sibling big-image -->\\n                        <xsl:choose>\\n                            <xsl:when test=\\\"../xf:value[@form = 'big-image']\\\" >\\n                                <a>\\n                                    <xsl:attribute name=\\\"class\\\">\\n                                        <xsl:value-of select=\\\"'or-big-image'\\\" />\\n                                    </xsl:attribute>\\n                                    <xsl:attribute name=\\\"href\\\">\\n                                        <xsl:value-of select=\\\"../xf:value[@form = 'big-image']\\\"/>\\n                                    </xsl:attribute>\\n                                    <xsl:call-template name=\\\"image\\\">\\n                                        <xsl:with-param name=\\\"active\\\" select=\\\"$active\\\"/>\\n                                        <xsl:with-param name=\\\"notext\\\" select=\\\"$notext\\\"/>\\n                                        <xsl:with-param name=\\\"lang\\\" select=\\\"$lang\\\"/>\\n                                    </xsl:call-template>\\n                                </a>\\n                            </xsl:when>\\n                            <xsl:otherwise>\\n                                <xsl:call-template name=\\\"image\\\">\\n                                    <xsl:with-param name=\\\"active\\\" select=\\\"$active\\\"/>\\n                                    <xsl:with-param name=\\\"notext\\\" select=\\\"$notext\\\"/>\\n                                    <xsl:with-param name=\\\"lang\\\" select=\\\"$lang\\\"/>\\n                                    <xsl:with-param name=\\\"id\\\" select=\\\"$id\\\"/>\\n                                </xsl:call-template>\\n                            </xsl:otherwise>\\n                        </xsl:choose>\\n                    </xsl:when>\\n                    <xsl:when test=\\\"@form = 'audio'\\\">\\n                        <audio controls=\\\"controls\\\">\\n                            <xsl:attribute name=\\\"lang\\\">\\n                                <xsl:value-of select=\\\"$lang\\\"/>\\n                            </xsl:attribute>\\n                            <xsl:if test=\\\"string($active)\\\">\\n                                <xsl:attribute name=\\\"class\\\">\\n                                    <xsl:value-of select=\\\"$active\\\" />\\n                                </xsl:attribute>\\n                            </xsl:if>\\n                            <xsl:attribute name=\\\"src\\\">\\n                                <xsl:value-of select=\\\".\\\" />\\n                            </xsl:attribute>\\n                            <xsl:attribute name=\\\"data-itext-id\\\">\\n                                <xsl:value-of select=\\\"$id\\\"/>\\n                            </xsl:attribute>\\n                            <xsl:text>Your browser does not support HTML5 audio.</xsl:text>\\n                        </audio>\\n                    </xsl:when>\\n                    <xsl:when test=\\\"@form = 'video'\\\">\\n                        <video controls=\\\"controls\\\">\\n                            <xsl:attribute name=\\\"lang\\\">\\n                                <xsl:value-of select=\\\"$lang\\\"/>\\n                            </xsl:attribute>\\n                            <xsl:if test=\\\"string($active)\\\">\\n                                <xsl:attribute name=\\\"class\\\">\\n                                    <xsl:value-of select=\\\"$active\\\" />\\n                                </xsl:attribute>\\n                            </xsl:if>\\n                            <xsl:attribute name=\\\"src\\\">\\n                                <xsl:value-of select=\\\".\\\" />\\n                            </xsl:attribute>\\n                            <xsl:attribute name=\\\"data-itext-id\\\">\\n                                <xsl:value-of select=\\\"$id\\\"/>\\n                            </xsl:attribute>\\n                            <xsl:text>Your browser does not support HTML5 video.</xsl:text>\\n                        </video>\\n                    </xsl:when>\\n                </xsl:choose>\\n            </xsl:for-each>\\n        </xsl:for-each>\\n    </xsl:template>\\n\\n    <xsl:template name=\\\"strip_namespace\\\">\\n        <xsl:param name=\\\"string\\\" />\\n        <xsl:choose>\\n            <xsl:when test=\\\"contains($string, ':')\\\" >\\n                <!-- crude check, should be improved -->\\n                <xsl:value-of select=\\\"substring-after($string, ':')\\\" />\\n            </xsl:when>\\n            <xsl:otherwise>\\n                <xsl:value-of select=\\\"$string\\\" />\\n            </xsl:otherwise>\\n        </xsl:choose>\\n    </xsl:template>\\n\\n    <xsl:template name=\\\"languages\\\">\\n        <xsl:for-each select=\\\"key('translations', true())\\\" >\\n            <option>\\n                <xsl:attribute name=\\\"value\\\">\\n                    <xsl:value-of select=\\\"@lang\\\"/>\\n                </xsl:attribute>\\n                <xsl:value-of select=\\\"@lang\\\" />\\n            </option>\\n            <xsl:text> </xsl:text>\\n        </xsl:for-each>\\n    </xsl:template>\\n\\n    <!-- future support for itext node parameters -->\\n    <xsl:template name=\\\"itext-helper\\\">\\n\\n    </xsl:template>\\n\\n    <xsl:template name=\\\"node-path-helper\\\">\\n        <xsl:param name=\\\"input-node\\\"/>\\n        <xsl:choose>\\n            <xsl:when test=\\\"$input-node/@bind\\\">\\n                <xsl:variable name=\\\"id\\\" select=\\\"$input-node/@bind\\\" />\\n                <xsl:value-of select=\\\"key('bindings-by-id', $id)/@nodeset\\\"/>\\n            </xsl:when>\\n            <xsl:when test=\\\"$input-node/@ref or $input-node/@nodeset\\\">\\n                <xsl:variable name=\\\"path\\\" select=\\\"normalize-space($input-node/@ref | $input-node/@nodeset)\\\" />\\n                <xsl:if test=\\\"not(substring($path, 1, 1) = '/') and not(parent::h:body)\\\" >\\n                    <!-- path is relative, so we need context -->\\n                    <!--<xsl:choose>-->\\n                        <!-- should ancestor:: be replaced with parent:: ??? TEST -->\\n                       <!-- <xsl:when test=\\\"parent::xf:repeat/@nodeset\\\">\\n                            <xsl:value-of select=\\\"concat(ancestor::xf:repeat/@nodeset, '/')\\\" />\\n                        </xsl:when>\\n                        <xsl:when test=\\\"parent::xf:repeat/@ref\\\">\\n                            <xsl:value-of select=\\\"concat(ancestor::xf:repeat/@ref, '/')\\\" />\\n                        </xsl:when>\\n                        <xsl:when test=\\\"parent::xf:group/@nodeset\\\">\\n                            <xsl:value-of select=\\\"concat(ancestor::xf:group/@nodeset, '/')\\\" />\\n                        </xsl:when>\\n                        <xsl:when test=\\\"parent::xf:group/@ref\\\">\\n                            <xsl:value-of select=\\\"concat(ancestor::xf:group/@ref, '/')\\\" />\\n                        </xsl:when>-->\\n                        <!-- and use top level instance node, if the ancestor is h:body -->\\n                        <!--<xsl:when test=\\\"parent::h:body\\\">-->\\n                            <!-- start with the top level element of the instance, e.g. /data/ -->\\n                        <!--    <xsl:value-of select=\\\"concat('/', local-name(//xf:instance/child::*[1]), '/')\\\" />-->\\n                            <!--<xsl:message>INFO: tried to add top level node of instance:<xsl:value-of select=\\\"local-name(//xf:instance/child::*[1])\\\"/></xsl:message>-->\\n                        <!--</xsl:when>-->\\n                        <!--<xsl:otherwise>\\n                            <xsl:message>ERROR: Could not determine context node for relative path.</xsl:message>\\n                        </xsl:otherwise>\\n                    </xsl:choose>-->\\n                    <xsl:for-each select=\\\"ancestor::*\\\">\\n                       <!-- <xsl:if test=\\\"not(substring($path, 1, 1) = '/') and not(local-name() = 'body') \\\">-->\\n\\n                        <!--<xsl:message>ancestor: <xsl:value-of select=\\\"local-name()\\\" /></xsl:message>-->\\n                        <xsl:if test=\\\"(local-name() = 'repeat' or local-name() = 'group')\\\">\\n\\n                                <!--substring(@nodeset, 1, 1) = '/' or substring(@ref, 1, 1) = '/'\\n                                        )\\\">-->\\n                            <!--<xsl:for-each select=\\\"descendant::*\\\">\\n                                <xsl:if test=\\\"local-name() = 'group' or local-name() = 'repeat'\\\">-->\\n                                <xsl:if test=\\\"string-length(@ref) &gt; 0 or string-length(@nodeset) &gt; 0\\\">\\n                                    <xsl:value-of select=\\\"concat(@ref,@nodeset, '/')\\\" />\\n                                </xsl:if>\\n                            <!--    </xsl:if>\\n                            </xsl:for-each>-->\\n                            <!-- not totally foolproof (will fail if nested group use both local and absolute paths) but probably okay, test this with multiple nested groups -->\\n                        </xsl:if>\\n                        <!--</xsl:if>-->\\n                    </xsl:for-each>\\n                </xsl:if>\\n                <xsl:value-of select=\\\"$path\\\"/>\\n            </xsl:when>\\n            <!-- if a group without @ref but with an immediate repeat child is used (ODK Build) -->\\n            <xsl:when test=\\\"local-name() = 'group' and $input-node/xf:repeat/@nodeset\\\">\\n                <xsl:value-of select=\\\"$input-node/xf:repeat/@nodeset\\\" />\\n            </xsl:when>\\n            <!--<xsl:otherwise>\\n                <xsl:message>ERROR: Could not determine node path for <xsl:value-of select=\\\"local-name($input-node)\\\" /></xsl:message>\\n            </xsl:otherwise>-->\\n        </xsl:choose>\\n    </xsl:template>\\n\\n    <!--<xsl:template name=\\\"one-step-back\\\">\\n        <xsl:param name=\\\"path\\\" />\\n        <xsl:param name=\\\"node\\\" />\\n        <xsl:variable name=\\\"newpath\\\">\\n            <xsl:choose>\\n                <xsl:when test=\\\"parent::xf:repeat/@nodeset\\\">\\n                    <xsl:value-of select=\\\"concat(ancestor::xf:repeat/@nodeset, '/', $path)\\\" />\\n                </xsl:when>\\n                <xsl:when test=\\\"parent::xf:repeat/@ref\\\">\\n                    <xsl:value-of select=\\\"concat(ancestor::xf:repeat/@ref, '/', $path)\\\" />\\n                </xsl:when>\\n                <xsl:when test=\\\"parent::xf:group/@nodeset\\\">\\n                    <xsl:value-of select=\\\"concat(ancestor::xf:group/@nodeset, '/', $path)\\\" />\\n                </xsl:when>\\n                <xsl:when test=\\\"parent::xf:group/@ref\\\">\\n                    <xsl:value-of select=\\\"concat(ancestor::xf:group/@ref, '/', $path)\\\" />\\n                </xsl:when>\\n                <xsl:otherwise>\\n                    strictly speaking, if the parent group or repeat doesn't have a ref/nodeset, we should go\\n                    one level higher. Not implemented here.\\n                    <xsl:message>ERROR: Could not determine context node for relative path.</xsl:message>\\n                </xsl:otherwise>\\n            <xsl:choose>\\n        </xsl:variable>\\n        <xsl:if test=\\\"not(substring($path, 1, 1) = '/') and not(parent::h:body)\\\">\\n            <xsl:call-template name=\\\"one-step-back\\\" >\\n                <xsl:with-param name=\\\"path\\\" select=\\\"$newpath\\\"/>\\n                <xsl:with-param name=\\\"node\\\" select=\\\"parent::*\\\"/>\\n            </xsl:call-template>\\n        </xsl:if>\\n        <xsl:value-of select=\\\"$newpath\\\" />\\n    </xsl:template>-->\\n\\n    <xsl:template name=\\\"image\\\">\\n        <xsl:param name=\\\"active\\\"/>\\n        <xsl:param name=\\\"notext\\\" />\\n        <xsl:param name=\\\"lang\\\"/>\\n        <xsl:param name=\\\"id\\\"/>\\n         <!-- add empty span for option-labels that have no text, just an image, to support the new radio buttons and checkboxes -->\\n         <xsl:if test=\\\"$notext = 'true'\\\" >\\n             <span>\\n                 <xsl:attribute name=\\\"lang\\\">\\n                     <xsl:value-of select=\\\"$lang\\\"/>\\n                 </xsl:attribute>\\n                 <xsl:attribute name=\\\"class\\\">\\n                     <xsl:value-of select=\\\"'option-label '\\\"/>\\n                     <xsl:if test=\\\"string($active)\\\">\\n                         <xsl:value-of select=\\\"$active\\\"/>\\n                     </xsl:if>\\n                 </xsl:attribute>\\n                 <xsl:text>\\n                 </xsl:text>\\n             </span>\\n         </xsl:if>\\n         <img>\\n             <xsl:attribute name=\\\"lang\\\">\\n                 <xsl:value-of select=\\\"$lang\\\"/>\\n             </xsl:attribute>\\n             <xsl:if test=\\\"string($active)\\\">\\n                 <xsl:attribute name=\\\"class\\\">\\n                     <xsl:value-of select=\\\"$active\\\" />\\n                 </xsl:attribute>\\n             </xsl:if>\\n             <xsl:attribute name=\\\"src\\\">\\n                 <xsl:value-of select=\\\".\\\" />\\n             </xsl:attribute>\\n             <xsl:attribute name=\\\"data-itext-id\\\">\\n                <xsl:value-of select=\\\"$id\\\"/>\\n            </xsl:attribute>\\n             <xsl:attribute name=\\\"alt\\\">image</xsl:attribute>\\n         </img>\\n    </xsl:template>\\n\\n    <xsl:template name=\\\"nodeset_used\\\">\\n        <xsl:choose>\\n            <!-- first the simplest case (for preload or calculated fields taken from bind elements) -->\\n            <xsl:when test=\\\"local-name() = 'bind'\\\">\\n                <!--<xsl:choose>-->\\n                    <!-- if nodeset value is relative -->\\n                    <!--<xsl:when test=\\\"not(substring(./@nodeset, 1, 1) = '/')\\\">-->\\n                        <!-- start with the top level element of the instance, e.g. /data/ -->\\n                    <!--    <xsl:value-of select=\\\"concat('/', local-name(//xf:instance/child::*[1]), '/')\\\" />\\n                    </xsl:when>\\n                    <xsl:otherwise />\\n                </xsl:choose>-->\\n                <xsl:value-of select=\\\"./@nodeset\\\"/>\\n            </xsl:when>\\n            <!-- then for input elements -->\\n            <xsl:otherwise>\\n                <xsl:variable name=\\\"intermediate\\\">\\n                    <xsl:choose>\\n                        <xsl:when test=\\\"not(local-name() = 'setvalue' or local-name() = 'setgeopoint') and ( local-name(..) = 'select1' or local-name(..) = 'select' )\\\">\\n                            <xsl:call-template name=\\\"node-path-helper\\\">\\n                                <xsl:with-param name=\\\"input-node\\\" select=\\\"..\\\" />\\n                            </xsl:call-template>\\n                        </xsl:when>\\n                        <xsl:otherwise>\\n                            <xsl:call-template name=\\\"node-path-helper\\\">\\n                                <xsl:with-param name=\\\"input-node\\\" select=\\\".\\\" />\\n                            </xsl:call-template>\\n                        </xsl:otherwise>\\n                    </xsl:choose>\\n                </xsl:variable>\\n                <!-- now strip anything preceding a // which occurs e.g. in widgets.xml-->\\n                <!-- note that this goes only 1 level deep so is not reliable enough -->\\n                <xsl:choose>\\n                    <xsl:when test=\\\"contains($intermediate, '//')\\\">\\n                        <xsl:value-of select=\\\"concat('/', substring-after($intermediate, '//'))\\\"/>\\n                    </xsl:when>\\n                    <xsl:otherwise>\\n                        <xsl:value-of select=\\\"$intermediate\\\"/>\\n                    </xsl:otherwise>\\n                </xsl:choose>\\n            </xsl:otherwise>\\n        </xsl:choose>\\n    </xsl:template>\\n\\n    <xsl:template name=\\\"nodeset_absolute\\\">\\n        <xsl:param name=\\\"nodeset_u\\\"/>\\n        <xsl:variable name=\\\"nodeset_a\\\">\\n            <xsl:choose>\\n                <xsl:when test=\\\"not(substring($nodeset_u, 1, 1) = '/')\\\">\\n                    <xsl:value-of select=\\\"concat('/', local-name(key('primary-instance-root', true())[1]), '/', $nodeset_u)\\\"/>\\n            <!--<xsl:message terminate=\\\"yes\\\">ERROR: Could not determine absolute path/to/instance/node (terminated transformation), found: <xsl:value-of select=\\\"$nodeset\\\" />.</xsl:message>-->\\n                </xsl:when>\\n                <xsl:otherwise>\\n                    <xsl:value-of select=\\\"$nodeset_u\\\" />\\n                </xsl:otherwise>\\n            </xsl:choose>\\n        </xsl:variable>\\n        <xsl:if test=\\\"not($nodeset_u = $nodeset_a)\\\">\\n            <!--<xsl:message>INFO: changed relative nodeset: <xsl:value-of select=\\\"$nodeset_u\\\"/> to: <xsl:value-of select=\\\"$nodeset_a\\\" /></xsl:message>-->\\n        </xsl:if>\\n        <xsl:value-of select=\\\"$nodeset_a\\\"/>\\n    </xsl:template>\\n\\n    <xsl:template name=\\\"xml_type\\\">\\n        <xsl:param name=\\\"nodeset\\\" />\\n        <!--<xsl:param name=\\\"binding\\\" />-->\\n        <xsl:variable name=\\\"xml_type\\\">\\n            <!--<xsl:value-of select=\\\"$binding\\\"/>-->\\n            <xsl:value-of select=\\\"key('nodeset-bindings', $nodeset)/@type\\\" />\\n        </xsl:variable>\\n        <xsl:choose>\\n            <xsl:when test=\\\"string-length($xml_type) &lt; 1\\\" >string</xsl:when>\\n            <xsl:otherwise>\\n                <xsl:call-template name=\\\"strip_namespace\\\">\\n                    <xsl:with-param name=\\\"string\\\">\\n                        <xsl:value-of select=\\\"$xml_type\\\"/>\\n                    </xsl:with-param>\\n                </xsl:call-template>\\n            </xsl:otherwise>\\n        </xsl:choose>\\n    </xsl:template>\\n\\n    <!-- ONLY TO BE USED FOR INPUT ELEMENT TYPES -->\\n    <xsl:template name=\\\"html_type\\\">\\n        <xsl:param name=\\\"xml_type\\\" />\\n        <xsl:choose>\\n            <xsl:when test=\\\"local-name(..) = 'select1' or $xml_type='select1' or local-name(.) = 'trigger'\\\">radio</xsl:when>\\n            <xsl:when test=\\\"local-name(..) = 'select' or $xml_type='select'\\\">checkbox</xsl:when>\\n            <xsl:when test=\\\"local-name() = 'bind'\\\">hidden</xsl:when>\\n            <xsl:when test=\\\"local-name() = 'range'\\\">number</xsl:when>\\n            <xsl:when test=\\\"$xml_type = 'dateTime'\\\">datetime-local</xsl:when>\\n            <xsl:when test=\\\"$xml_type = 'date'\\\">date</xsl:when>\\n            <!-- note, it may not actually be possible to support 'file' with offline storage -->\\n            <xsl:when test=\\\"$xml_type = 'binary'\\\">file</xsl:when>\\n            <xsl:when test=\\\"$xml_type = 'time'\\\">time</xsl:when>\\n            <xsl:when test=\\\"$xml_type = 'rank'\\\">text</xsl:when>\\n            <xsl:when\\n                test=\\\"$xml_type = 'decimal' or $xml_type = 'float' or $xml_type = 'double' or $xml_type = 'int' or $xml_type = 'integer'\\\"\\n                >number</xsl:when>\\n            <xsl:when test=\\\"$xml_type = 'string' and contains(./@appearance, 'numbers')\\\">tel</xsl:when>\\n            <xsl:when test=\\\"$xml_type = 'string'\\\">text</xsl:when>\\n            <xsl:when test=\\\"$xml_type = 'barcode' or $xml_type = 'geopoint' or $xml_type = 'geotrace' or $xml_type = 'geoshape'\\\" >\\n                <xsl:value-of select=\\\"string('text')\\\" />\\n            </xsl:when>\\n            <xsl:otherwise>\\n                <xsl:value-of select=\\\"$error\\\"/>\\n                <xsl:message terminate=\\\"no\\\">ERROR: Unsupported data type '<xsl:value-of select=\\\"$xml_type\\\"/>' found.</xsl:message>\\n            </xsl:otherwise>\\n        </xsl:choose>\\n    </xsl:template>\\n</xsl:stylesheet>\\n\""],"names":[],"mappings":";;AAAA,MAAe,UAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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