xsltforms-support Mailing List for XSLTForms (Page 100)
Brought to you by:
alain-couthures
You can subscribe to this list here.
2009 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(6) |
Jun
(9) |
Jul
(16) |
Aug
(5) |
Sep
(43) |
Oct
(36) |
Nov
(58) |
Dec
(43) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2010 |
Jan
(79) |
Feb
(81) |
Mar
(107) |
Apr
(93) |
May
(85) |
Jun
(54) |
Jul
(64) |
Aug
(54) |
Sep
(45) |
Oct
(53) |
Nov
(34) |
Dec
(77) |
2011 |
Jan
(56) |
Feb
(53) |
Mar
(52) |
Apr
(66) |
May
(44) |
Jun
(16) |
Jul
(28) |
Aug
(5) |
Sep
(15) |
Oct
(21) |
Nov
(51) |
Dec
(46) |
2012 |
Jan
(16) |
Feb
(38) |
Mar
(47) |
Apr
(45) |
May
(41) |
Jun
(41) |
Jul
(72) |
Aug
(17) |
Sep
(10) |
Oct
(16) |
Nov
(29) |
Dec
(30) |
2013 |
Jan
(25) |
Feb
(13) |
Mar
(20) |
Apr
(25) |
May
(34) |
Jun
(8) |
Jul
(12) |
Aug
(9) |
Sep
(21) |
Oct
(19) |
Nov
(6) |
Dec
(2) |
2014 |
Jan
(14) |
Feb
(8) |
Mar
(7) |
Apr
(13) |
May
(33) |
Jun
(13) |
Jul
(6) |
Aug
(5) |
Sep
(5) |
Oct
(34) |
Nov
(7) |
Dec
|
2015 |
Jan
(1) |
Feb
(6) |
Mar
(17) |
Apr
(12) |
May
(10) |
Jun
(18) |
Jul
(31) |
Aug
(9) |
Sep
(3) |
Oct
(6) |
Nov
(19) |
Dec
(1) |
2016 |
Jan
(18) |
Feb
(4) |
Mar
(13) |
Apr
(19) |
May
|
Jun
(17) |
Jul
(7) |
Aug
|
Sep
(3) |
Oct
(6) |
Nov
(3) |
Dec
|
2017 |
Jan
(5) |
Feb
(17) |
Mar
(4) |
Apr
(8) |
May
(3) |
Jun
|
Jul
(8) |
Aug
(2) |
Sep
|
Oct
(5) |
Nov
(6) |
Dec
(4) |
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(6) |
Nov
|
Dec
(1) |
2019 |
Jan
|
Feb
|
Mar
(4) |
Apr
(2) |
May
(4) |
Jun
|
Jul
|
Aug
(2) |
Sep
(7) |
Oct
|
Nov
|
Dec
|
2020 |
Jan
(13) |
Feb
(17) |
Mar
(8) |
Apr
(11) |
May
(15) |
Jun
(11) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(6) |
2021 |
Jan
(9) |
Feb
(26) |
Mar
(17) |
Apr
|
May
(7) |
Jun
(18) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(10) |
2022 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
(2) |
Sep
(3) |
Oct
(2) |
Nov
(10) |
Dec
(1) |
2023 |
Jan
(10) |
Feb
|
Mar
(7) |
Apr
(8) |
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
(8) |
Oct
(11) |
Nov
(8) |
Dec
(5) |
2024 |
Jan
(7) |
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2025 |
Jan
(4) |
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Claudius T. <cla...@ya...> - 2010-01-13 13:58:48
|
Hi, For those interested, a new version of eXSLTForms (exsltforms-beta2) is available at http://sourceforge.net/projects/extxsltforms/. The XSL transformation extension action is now working for Internet Explorer. Claudius Teodorescu |
From: Stephen C. <Ste...@ut...> - 2010-01-13 08:52:49
|
Hello, I have noticed that XSLTForms is quite a lot slower in IE than Firefox or Chrome. Its still useable in IE for me but only just, there is a significant pause before anything shows on the screen when the data model has to be loaded from outside the form. I'm wondering if it would be simple to add an animated gif appear before the GUI displays to make people think something is happening in the wait period. -- Regards Stephen Cameron Data Programmer Integrated Marine Observing System (IMOS) eMarine Information Infrastructure Project University of Tasmania, Private Bag 21, Hobart, TAS 7001, Australia Tel: +61 3 6226 8507 Fax: +61 3 6226 2997 Email: ste...@ut... URL: http://www.imos.org.au/eMII.html |
From: Stephen C. <Ste...@ut...> - 2010-01-13 06:37:16
|
Hello Alain, There is a bug in the current build when you have an xforms:itemset with a @nodeset of size=1. An exception is thrown it seems. The following code demonstrates the effect: <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet href="xsltforms/xsltforms.xsl" type="text/xsl"?><html xmlns:aatams="http://www.imos.org.au/aatams" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:wfs="http://www.opengis.net/wfs" xmlns:ogc="http://www.opengis.net/ogc" xmlns:ows="http://www.opengis.net/ows" xmlns="http://www.w3.org/1999/xhtml" xmlns:gml="http://www.opengis.net/gml"> <head> <title>AATAMS Web Interface</title> <link href="aatams.css" rel="stylesheet" type="text/css"/> <xf:model id="model1"> <xf:instance id="inst_implant_type"> <wfs:FeatureCollection> <gml:featureMember> <aatams:implant_type gml:id="aatams.implant_type.1"> <aatams:name>INTERNAL</aatams:name> </aatams:implant_type> </gml:featureMember> </wfs:FeatureCollection> </xf:instance> <xf:instance id="inst_subfeatures"> <dummy xmlns=""> <implant_type_id/> </dummy> </xf:instance> <xf:bind id="implant_type" nodeset="instance('inst_subfeatures')//implant_type_id" type="xsd:string" required="false()"/> </xf:model> </head> <body> <div class="form"> <label>ADD TAG RELEASE</label> <div class="form-contents"> <div class="xfselect1"> <xf:select1 bind="implant_type" appearance="minimal" incremental="true()"> <xf:label>implant type</xf:label> <xf:itemset nodeset="instance('inst_implant_type')/gml:featureMember/aatams:implant_type"> <xf:value ref="@gml:id"/> <xf:label ref="aatams:name"/> </xf:itemset> </xf:select1> </div> </div> </div> <br/> <div id="console"/> </body> </html> -- Regards Stephen Cameron Data Programmer Integrated Marine Observing System (IMOS) eMarine Information Infrastructure Project University of Tasmania, Private Bag 21, Hobart, TAS 7001, Australia Tel: +61 3 6226 8507 Fax: +61 3 6226 2997 Email: ste...@ut... URL: http://www.imos.org.au/eMII.html |
From: COUTHURES A. <ala...@ag...> - 2010-01-12 22:33:00
|
Hello Javier, Thank you very much for pointing this. I was always testing with server treatment of Accept-Language so I didn't notice... I have rewritten some parts of this and it should work correctly with the latest SVN version. BTW I discovered a dirty bug about class inheritance between XDocument and XNode when recycling. This bug cannot happen again now. Don't hesitate to contact me again if you still have problems with that. -Alain > Hello, > > I put before "if (properties.doc) {" line the following: > > if (!properties.doc) { > properties.setDoc(properties.srcXML); > } > > And now it enters inside the code that loads the localization config > xsl (and loads it ok if I have in config.xsl "navigator"). Is > something wrong in the code? Or there is an error in my xsltforms > local version? In this case, where should be created "properties.doc", > to check it? > > After that, I have examined the code and I see that a copy of the > localization config xsl is done in line 532: > var filename = > "config_" + lan + ".xsl"; > > Core.loadProperties(properties, filename); > > But I see that in the next access, the doc that is loading is the > first one instead the localization one. It may be another bug, or may > be related with the previous issue. > > I also see an error in language list of js: > > langs : ["cz", "de", "en_uk", "es", "fr" , "gl", "it", "ja", "nb_no", > "nl", "nn_no", "pt", "ro", "ru", "si", "sk"], > > there is a language named "en_uk" that doesn't have a config_en_uk.xsl > file, while there are two files, config_en.xsl and config_en_us.xsl > that aren't defined in the js. > > Best Regards, > Javier > > Javier Díaz escribió: >> Hello, >> >> I have updated my xsltforms installation to the last version, and I'm >> trying to understand how new configuration files work. >> >> It seems that xsltforms.xsl include config.xsl and it seems it works >> ok, loading always the localization message of this xsl. >> >> But It seems the rest of the xsl configs are never used. I see they >> are only used in xsltforms.js: >> >> get : function(key) { >> var properties = >> $("xf-instance-config").xfElement; >> * if (properties.doc) {* >> if (Language == "navigator" >> || Language != >> properties.doc.documentElement.getElementsByTagName("language")[0].firstChild.nodeValue) >> { >> var lan = Language == >> "navigator" ? (navigator.language || navigator.userLanguage) : >> properties.doc.documentElement.getElementsByTagName("language")[0].firstChild.nodeValue; >> lan = >> lan.replace("-", "_").toLowerCase(); >> var finded = >> inArray(lan, I8N.langs); >> if (!finded) { >> ind = >> lan.indexOf("_"); >> if (ind != -1) { >> >> lan = lan.substring(0, ind); >> } >> finded = >> inArray(lan, I8N.langs); >> } >> if (finded) { >> * var filename >> = "config_" + lan + ".xsl";* >> >> Core.loadProperties(properties, filename); >> >> But I can't get how to load a different xsl because properties.doc is >> always undefined. ¿I'm missing to initialize something? ¿What is >> properties.doc? >> >> Apart from this, I have a little doubt that i don't know if is >> related xforms or xsltforms implementation. >> >> I have an xform with this model: >> >> <xf:model id="orden"> >> <!--<xf:model id="orden" >> schema="/opt/GEREMIAS/GRM/SPCI_T/XSD/ATLASv2/ICX-interno2.xsd">--> >> <xf:instance> >> ... xml data ... >> </xf:instance> >> * <xf:instance id="datos"> >> <datos_seleccion> >> <vct><elm>admin1</elm><elm>admin1 (cca1)</elm></vct> >> <vct><elm>admin2</elm><elm>admin2 (cca2)</elm></vct> >> </datos_seleccion> >> </xf:instance>* >> >> "datos" is an auxiliar instance used with the following itemset of a >> select to fill the first instance: >> >> <xf:select1 ref="/SELECCION/DATO_ELEGIDO" >> appearance="compact"> >> <xf:label>Datos</xf:label> >> * <xf:itemset model="orden" >> nodeset="instance('datos')/vct">* >> * <xf:label ref="elm[2]"></xf:label><xf:value >> ref="elm[1]"></xf:value> >> </xf:itemset>* >> </xf:select1> >> >> It works ok but surprisingly only if I skip the root node! Is this >> correct? Shouldn't be better *instance('datos')/datos_seleccion/vct* ? >> >> Best Regards, >> Javier >> >> COUTHURES Alain escribió: >>> Hello, >>> >>> Extensibility is now to be considered for XSLTForms. That's why, with >>> the latest SVN version, it is now possible for other projects to >>> integrate their own sources files without modifying XSLTForms files. >>> >>> The "messages_??.properties" files called from Javascript instructions >>> mechanism is replaced by a similar mechanism, a "config.xsl" file >>> called, of course, from XSLT instructions. >>> >>> XSLT templates can be added in the "config.xsl" file: for matching >>> templates, priority use permits to replace XSLTForms genuine templates. >>> Because named templates cannot be replaced, calling templates have to be >>> changed too, but it would also be possible to test whether a similar >>> named template, "ext-*" for example, is present in the "config.xsl" file. >>> >>> In the "config.xsl" file, the "config" named template allows to define >>> options (<debug/>, <nocss/>) and localization values. It also allows to >>> specify elements, such as <script> or <link> elements, to be added, in >>> the HTML head element, just after xsltforms.js and xsltforms.css calls. >>> >>> Localization can now easily be based on a server-side treatment >>> according to HTTP Accept-Language parameter but, as before, specifying >>> "navigator" in the "config.xsl" file, will ask the Javascript part to, >>> as before, load localization values according to the Javascript >>> "navigator.language" value. Localization values are now stored in a >>> dedicated instance, itself in a dedicated model: they can also be read >>> with XPath and, eventually set by XForms actions or controls. >>> >>> These new features should be very useful for other projects (such as >>> exsltforms : http://sourceforge.net/projects/exsltforms). Don't hesitate >>> to contact me if this is causing problems with already operational use >>> of XSLTForms. >>> >>> Thanks! >>> >>> -Alain >>> >>> ------------------------------------------------------------------------------ >>> This SF.Net email is sponsored by the Verizon Developer Community >>> Take advantage of Verizon's best-in-class app development support >>> A streamlined, 14 day to market process makes app distribution fast and easy >>> Join now and get one step closer to millions of Verizon customers >>> http://p.sf.net/sfu/verizon-dev2dev >>> _______________________________________________ >>> Xsltforms-support mailing list >>> Xsl...@li... >>> https://lists.sourceforge.net/lists/listinfo/xsltforms-support >>> >> ------------------------------------------------------------------------ >> >> ------------------------------------------------------------------------------ >> This SF.Net email is sponsored by the Verizon Developer Community >> Take advantage of Verizon's best-in-class app development support >> A streamlined, 14 day to market process makes app distribution fast and easy >> Join now and get one step closer to millions of Verizon customers >> http://p.sf.net/sfu/verizon-dev2dev >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Xsltforms-support mailing list >> Xsl...@li... >> https://lists.sourceforge.net/lists/listinfo/xsltforms-support >> |
From: Javier D. <jd...@ge...> - 2010-01-12 20:21:29
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> </head> <body bgcolor="#ffffff" text="#000000"> Hello,<br> <br> I put before "if (properties.doc) {" line the following:<br> <br> <tt> if (!properties.doc) {<br> properties.setDoc(properties.srcXML);<br> }</tt><br> <br> And now it enters inside the code that loads the localization config xsl (and loads it ok if I have in config.xsl "navigator"). Is something wrong in the code? Or there is an error in my xsltforms local version? In this case, where should be created "properties.doc", to check it?<br> <br> After that, I have examined the code and I see that a copy of the localization config xsl is done in line 532:<br> var filename = "config_" + lan + ".xsl";<br> Core.loadProperties(properties, filename);<br> <br> But I see that in the next access, the doc that is loading is the first one instead the localization one. It may be another bug, or may be related with the previous issue.<br> <br> I also see an error in language list of js:<br> <br> langs : ["cz", "de", "en_uk", "es", "fr" , "gl", "it", "ja", "nb_no", "nl", "nn_no", "pt", "ro", "ru", "si", "sk"],<br> <br> there is a language named "en_uk" that doesn't have a config_en_uk.xsl file, while there are two files, config_en.xsl and config_en_us.xsl that aren't defined in the js.<br> <br> Best Regards,<br> Javier<br> <br> Javier Díaz escribió: <blockquote cite="mid:4B4...@ge..." type="cite"> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> <title></title> Hello,<br> <br> I have updated my xsltforms installation to the last version, and I'm trying to understand how new configuration files work.<br> <br> It seems that xsltforms.xsl include config.xsl and it seems it works ok, loading always the localization message of this xsl.<br> <br> But It seems the rest of the xsl configs are never used. I see they are only used in xsltforms.js:<br> <br> <tt> get : function(key) {<br> var properties = $("xf-instance-config").xfElement;<br> <b> if (properties.doc) {</b><br> if (Language == "navigator" || Language != properties.doc.documentElement.getElementsByTagName("language")[0].firstChild.nodeValue) {<br> var lan = Language == "navigator" ? (navigator.language || navigator.userLanguage) : properties.doc.documentElement.getElementsByTagName("language")[0].firstChild.nodeValue;<br> lan = lan.replace("-", "_").toLowerCase();<br> var finded = inArray(lan, I8N.langs);<br> if (!finded) {<br> ind = lan.indexOf("_");<br> if (ind != -1) {<br> lan = lan.substring(0, ind);<br> }<br> finded = inArray(lan, I8N.langs);<br> }<br> if (finded) {<br> <b> var filename = "config_" + lan + ".xsl";</b><br> Core.loadProperties(properties, filename);<br> <br> </tt>But I can't get how to load a different xsl because properties.doc is always undefined. ¿I'm missing to initialize something? ¿What is properties.doc?<br> <br> Apart from this, I have a little doubt that i don't know if is related xforms or xsltforms implementation.<br> <br> I have an xform with this model:<br> <br> <xf:model id="orden"><br> <!--<xf:model id="orden" schema="/opt/GEREMIAS/GRM/SPCI_T/XSD/ATLASv2/ICX-interno2.xsd">--><br> <xf:instance><br> ... xml data ...<br> </xf:instance><br> <b> <xf:instance id="datos"><br> <datos_seleccion><br> <vct><elm>admin1</elm><elm>admin1 (cca1)</elm></vct><br> <vct><elm>admin2</elm><elm>admin2 (cca2)</elm></vct><br> </datos_seleccion><br> </xf:instance></b><br> <br> "datos" is an auxiliar instance used with the following itemset of a select to fill the first instance:<br> <br> <xf:select1 ref="/SELECCION/DATO_ELEGIDO" appearance="compact"><br> <xf:label>Datos</xf:label><br> <b> <xf:itemset model="orden" nodeset="instance('datos')/vct"></b><br> <b> <xf:label ref="elm[2]"></xf:label><xf:value ref="elm[1]"></xf:value><br> </xf:itemset></b><br> </xf:select1><br> <br> It works ok but surprisingly only if I skip the root node! Is this correct? Shouldn't be better <b>instance('datos')/datos_seleccion/vct</b> ?<br> <br> Best Regards,<br> Javier<br> <br> COUTHURES Alain escribió: <blockquote cite="mid:4B3...@ag..." type="cite"> <pre wrap="">Hello, Extensibility is now to be considered for XSLTForms. That's why, with the latest SVN version, it is now possible for other projects to integrate their own sources files without modifying XSLTForms files. The "messages_??.properties" files called from Javascript instructions mechanism is replaced by a similar mechanism, a "config.xsl" file called, of course, from XSLT instructions. XSLT templates can be added in the "config.xsl" file: for matching templates, priority use permits to replace XSLTForms genuine templates. Because named templates cannot be replaced, calling templates have to be changed too, but it would also be possible to test whether a similar named template, "ext-*" for example, is present in the "config.xsl" file. In the "config.xsl" file, the "config" named template allows to define options (<debug/>, <nocss/>) and localization values. It also allows to specify elements, such as <script> or <link> elements, to be added, in the HTML head element, just after xsltforms.js and xsltforms.css calls. Localization can now easily be based on a server-side treatment according to HTTP Accept-Language parameter but, as before, specifying "navigator" in the "config.xsl" file, will ask the Javascript part to, as before, load localization values according to the Javascript "navigator.language" value. Localization values are now stored in a dedicated instance, itself in a dedicated model: they can also be read with XPath and, eventually set by XForms actions or controls. These new features should be very useful for other projects (such as exsltforms : <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://sourceforge.net/projects/exsltforms">http://sourceforge.net/projects/exsltforms</a>). Don't hesitate to contact me if this is causing problems with already operational use of XSLTForms. Thanks! -Alain ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://p.sf.net/sfu/verizon-dev2dev">http://p.sf.net/sfu/verizon-dev2dev</a> _______________________________________________ Xsltforms-support mailing list <a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Xsl...@li...">Xsl...@li...</a> <a moz-do-not-send="true" class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/xsltforms-support">https://lists.sourceforge.net/lists/listinfo/xsltforms-support</a> </pre> </blockquote> <pre wrap=""> <hr size="4" width="90%"> ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers <a class="moz-txt-link-freetext" href="http://p.sf.net/sfu/verizon-dev2dev">http://p.sf.net/sfu/verizon-dev2dev</a> </pre> <pre wrap=""> <hr size="4" width="90%"> _______________________________________________ Xsltforms-support mailing list <a class="moz-txt-link-abbreviated" href="mailto:Xsl...@li...">Xsl...@li...</a> <a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/xsltforms-support">https://lists.sourceforge.net/lists/listinfo/xsltforms-support</a> </pre> </blockquote> </body> </html> |
From: Tambet M. <tam...@gm...> - 2010-01-12 08:11:09
|
Javier Díaz wrote: > > Apart from this, I have a little doubt that i don't know if is related > xforms or xsltforms implementation. > > I have an xform with this model: > > <xf:model id="orden"> > <!--<xf:model id="orden" > schema="/opt/GEREMIAS/GRM/SPCI_T/XSD/ATLASv2/ICX-interno2.xsd">--> > <xf:instance> > ... xml data ... > </xf:instance> > * <xf:instance id="datos"> > <datos_seleccion> > <vct><elm>admin1</elm><elm>admin1 (cca1)</elm></vct> > <vct><elm>admin2</elm><elm>admin2 (cca2)</elm></vct> > </datos_seleccion> > </xf:instance>* > > "datos" is an auxiliar instance used with the following itemset of a > select to fill the first instance: > > <xf:select1 ref="/SELECCION/DATO_ELEGIDO" > appearance="compact"> > <xf:label>Datos</xf:label> > * <xf:itemset model="orden" > nodeset="instance('datos')/vct">* > * <xf:label ref="elm[2]"></xf:label><xf:value > ref="elm[1]"></xf:value> > </xf:itemset>* > </xf:select1> > > It works ok but surprisingly only if I skip the root node! Is this > correct? Shouldn't be better *instance('datos')/datos_seleccion/vct* ? This is by specification. See the example besides instance() function: http://www.w3.org/TR/xforms11/#fn-instance. Puzzled me too first time. Tambet |
From: Javier D. <jd...@ge...> - 2010-01-12 01:29:13
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> <title></title> </head> <body bgcolor="#ffffff" text="#000000"> Hello,<br> <br> I have updated my xsltforms installation to the last version, and I'm trying to understand how new configuration files work.<br> <br> It seems that xsltforms.xsl include config.xsl and it seems it works ok, loading always the localization message of this xsl.<br> <br> But It seems the rest of the xsl configs are never used. I see they are only used in xsltforms.js:<br> <br> <tt> get : function(key) {<br> var properties = $("xf-instance-config").xfElement;<br> <b> if (properties.doc) {</b><br> if (Language == "navigator" || Language != properties.doc.documentElement.getElementsByTagName("language")[0].firstChild.nodeValue) {<br> var lan = Language == "navigator" ? (navigator.language || navigator.userLanguage) : properties.doc.documentElement.getElementsByTagName("language")[0].firstChild.nodeValue;<br> lan = lan.replace("-", "_").toLowerCase();<br> var finded = inArray(lan, I8N.langs);<br> if (!finded) {<br> ind = lan.indexOf("_");<br> if (ind != -1) {<br> lan = lan.substring(0, ind);<br> }<br> finded = inArray(lan, I8N.langs);<br> }<br> if (finded) {<br> <b> var filename = "config_" + lan + ".xsl";</b><br> Core.loadProperties(properties, filename);<br> <br> </tt>But I can't get how to load a different xsl because properties.doc is always undefined. ¿I'm missing to initialize something? ¿What is properties.doc?<br> <br> Apart from this, I have a little doubt that i don't know if is related xforms or xsltforms implementation.<br> <br> I have an xform with this model:<br> <br> <xf:model id="orden"><br> <!--<xf:model id="orden" schema="/opt/GEREMIAS/GRM/SPCI_T/XSD/ATLASv2/ICX-interno2.xsd">--><br> <xf:instance><br> ... xml data ...<br> </xf:instance><br> <b> <xf:instance id="datos"><br> <datos_seleccion><br> <vct><elm>admin1</elm><elm>admin1 (cca1)</elm></vct><br> <vct><elm>admin2</elm><elm>admin2 (cca2)</elm></vct><br> </datos_seleccion><br> </xf:instance></b><br> <br> "datos" is an auxiliar instance used with the following itemset of a select to fill the first instance:<br> <br> <xf:select1 ref="/SELECCION/DATO_ELEGIDO" appearance="compact"><br> <xf:label>Datos</xf:label><br> <b> <xf:itemset model="orden" nodeset="instance('datos')/vct"></b><br> <b> <xf:label ref="elm[2]"></xf:label><xf:value ref="elm[1]"></xf:value><br> </xf:itemset></b><br> </xf:select1><br> <br> It works ok but surprisingly only if I skip the root node! Is this correct? Shouldn't be better <b>instance('datos')/datos_seleccion/vct</b> ?<br> <br> Best Regards,<br> Javier<br> <br> COUTHURES Alain escribió: <blockquote cite="mid:4B3...@ag..." type="cite"> <pre wrap="">Hello, Extensibility is now to be considered for XSLTForms. That's why, with the latest SVN version, it is now possible for other projects to integrate their own sources files without modifying XSLTForms files. The "messages_??.properties" files called from Javascript instructions mechanism is replaced by a similar mechanism, a "config.xsl" file called, of course, from XSLT instructions. XSLT templates can be added in the "config.xsl" file: for matching templates, priority use permits to replace XSLTForms genuine templates. Because named templates cannot be replaced, calling templates have to be changed too, but it would also be possible to test whether a similar named template, "ext-*" for example, is present in the "config.xsl" file. In the "config.xsl" file, the "config" named template allows to define options (<debug/>, <nocss/>) and localization values. It also allows to specify elements, such as <script> or <link> elements, to be added, in the HTML head element, just after xsltforms.js and xsltforms.css calls. Localization can now easily be based on a server-side treatment according to HTTP Accept-Language parameter but, as before, specifying "navigator" in the "config.xsl" file, will ask the Javascript part to, as before, load localization values according to the Javascript "navigator.language" value. Localization values are now stored in a dedicated instance, itself in a dedicated model: they can also be read with XPath and, eventually set by XForms actions or controls. These new features should be very useful for other projects (such as exsltforms : <a class="moz-txt-link-freetext" href="http://sourceforge.net/projects/exsltforms">http://sourceforge.net/projects/exsltforms</a>). Don't hesitate to contact me if this is causing problems with already operational use of XSLTForms. Thanks! -Alain ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers <a class="moz-txt-link-freetext" href="http://p.sf.net/sfu/verizon-dev2dev">http://p.sf.net/sfu/verizon-dev2dev</a> _______________________________________________ Xsltforms-support mailing list <a class="moz-txt-link-abbreviated" href="mailto:Xsl...@li...">Xsl...@li...</a> <a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/xsltforms-support">https://lists.sourceforge.net/lists/listinfo/xsltforms-support</a> </pre> </blockquote> </body> </html> |
From: COUTHURES A. <ala...@ag...> - 2010-01-08 20:03:52
|
Hi Stephen, > I think that XSLTForms does not support preceding-sibling:: I have just added XPath named axes support in XSLTForms latest SVN version. This is a not very much tested yet feature... Cheers, -Alain |
From: Stephen C. <Ste...@ut...> - 2010-01-07 23:56:40
|
Tambet Matiisen wrote: > Stephen Cameron wrote: >> <!--xf:setvalue ev:event="xforms-value-changed" >> ref="../@position" >> value="count(instance('data')/item[@id=instance('temp')/@id]/preceding-sibling::item)+1"/--> >> >> > This should work: > > <xf:setvalue ev:event="xforms-value-changed" ref="../@position" > value="instance('data')/item[@id=instance('temp')/@id]/position()"/> > > Tambet > > No, I'm afraid not. I think that my solution is correct after doing some more reading, but it gives an error in XSLTForms (see below). So I think that XSLTForms does not support preceding-sibling::, this may be an XForms 1.0 vs 1.1 difference (e.g. choose() is not supported but if() is) XSLTForms Exception -------------------------- Error parsing the following XPath expression : count(instance('data')/item[@id=instance('temp')/@id]/preceding-sibling::item)+1 Unknown operator at ':item)+1' in 'count(instance('data')/item[@id=instance('temp')/@id]/preceding-sibling::item)+1' -- Regards Stephen Cameron Data Programmer Integrated Marine Observing System (IMOS) eMarine Information Infrastructure Project University of Tasmania, Private Bag 21, Hobart, TAS 7001, Australia Tel: +61 3 6226 8507 Fax: +61 3 6226 2997 Email: ste...@ut... URL: http://www.imos.org.au/eMII.html |
From: Franclin F. <f.f...@4c...> - 2010-01-07 21:30:38
|
Hi, I just want to know how to change the default image of a button. I am trying this but to no avail: <xf:trigger appearance="xf:image"> <xf:label>Name of the button</xf:label> <img src="myimage.jpg"> /* remaing stuff here */ </xf:trigger> Waiting for your reply. Franclin. |
From: Tambet M. <tam...@gm...> - 2010-01-07 11:26:17
|
Stephen Cameron wrote: > <!--xf:setvalue ev:event="xforms-value-changed" > ref="../@position" > value="count(instance('data')/item[@id=instance('temp')/@id]/preceding-sibling:item)+1"/--> > This should work: <xf:setvalue ev:event="xforms-value-changed" ref="../@position" value="instance('data')/item[@id=instance('temp')/@id]/position()"/> Tambet |
From: Stephen C. <Ste...@ut...> - 2010-01-07 11:20:19
|
For those interested (not really specifically an XSLTForms issue) I have been playing with this problem a bit further. The following demo illustrates what I am wanting to do. There is one final problem in the code that I've not gotten to work, its the line that is commented out. Hopefully it's self explanatory Cheers. <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet href="xsltforms/xsltforms.xsl" type="text/xsl"?> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events"> <head> <xf:model id="m1"> <xf:instance id="data"> <data xmlns=""> <item id="A" name="item 1"> <p1>1-1</p1> <p2>1-2</p2> <p3>1-3</p3> </item> <item id="B" name="item 2"> <p1>2-1</p1> <p2>2-2</p2> <p3>2-3</p3> </item> <item id="C" name="item 3"> <p1>3-1</p1> <p2>3-2</p2> <p3>3-3</p3> </item> <item id="D" name="item 4"> <p1>4-1</p1> <p2>4-2</p2> <p3>4-3</p3> </item> <item id="E" name="item 5"> <p1>5-1</p1> <p2>5-2</p2> <p3>5-3</p3> </item> <item id="F" name="item 6"> <p1>6-1</p1> <p2>6-2</p2> <p3>6-3</p3> </item> <item id="G" name="item 7"> <p1>7-1</p1> <p2>7-2</p2> <p3>7-3</p3> </item> <item id="H" name="item 8"> <p1>8-1</p1> <p2>8-2</p2> <p3>8-3</p3> </item> <item id="I" name="item 9"> <p1>9-1</p1> <p2>9-2</p2> <p3>9-3</p3> </item> <item id="J" name="item 10"> <p1>10-1</p1> <p2>10-2</p2> <p3>10-3</p3> </item> </data> </xf:instance> <xf:instance id="temp"> <data xmlns="" id="" position="0" min="0" max="0" /> </xf:instance> <xf:action ev:event="xforms-model-construct-done"> <xf:setvalue ref="instance('temp')/@id" value="instance('data')/item[1]/@id" /> <xf:setvalue ref="instance('temp')/@min" value="if(count(instance('data')/item)>0,1,0)" /> <xf:setvalue ref="instance('temp')/@max" value="count(instance('data')/item)" /> <xf:setvalue ref="instance('temp')/@position" value="if(../@max>0,1,0)" /> </xf:action> </xf:model> </head> <body> <xf:select1 ref="instance('temp')/@id"> <xf:itemset nodeset="instance('data')/item"> <xf:value ref="@id" /> <xf:label ref="@name" /> </xf:itemset> <!--xf:setvalue ev:event="xforms-value-changed" ref="../@position" value="count(instance('data')/item[@id=instance('temp')/@id]/preceding-sibling:item)+1"/--> </xf:select1> <xf:trigger> <xf:label>|<</xf:label> <xf:setvalue ev:event="DOMActivate" ref="instance('temp')/@position" value="../@min"/> <xf:setvalue ev:event="DOMActivate" ref="instance('temp')/@id" value="instance('data')/item[position()=instance('temp')/@position]/@id"/> </xf:trigger> <xf:trigger> <xf:label><</xf:label> <xf:setvalue ev:event="DOMActivate" ref="instance('temp')/@position" value="if(.=../@min,.,.-1)"/> <xf:setvalue ev:event="DOMActivate" ref="instance('temp')/@id" value="instance('data')/item[position()=instance('temp')/@position]/@id"/> </xf:trigger> <xf:trigger> <xf:label>></xf:label> <xf:setvalue ev:event="DOMActivate" ref="instance('temp')/@position" value="if(.=../@max,.,.+1)"/> <xf:setvalue ev:event="DOMActivate" ref="instance('temp')/@id" value="instance('data')/item[position()=instance('temp')/@position]/@id"/> </xf:trigger> <xf:trigger> <xf:label>>|</xf:label> <xf:setvalue ev:event="DOMActivate" ref="instance('temp')/@position" value="../@max"/> <xf:setvalue ev:event="DOMActivate" ref="instance('temp')/@id" value="instance('data')/item[position()=instance('temp')/@position]/@id"/> </xf:trigger> <xf:group ref="instance('temp')"> <xf:output ref="./@position"/> <xf:output ref="if(./@min>0,' of ','')"/> <xf:output ref="./@max"/> </xf:group> <xf:group ref="instance('data')/item[@id = instance('temp')/@id]"> <br /> <xf:output ref="p1"> <xf:label>Property 1 = </xf:label> </xf:output> <br /> <xf:output ref="p2"> <xf:label>Property 2 = </xf:label> </xf:output> <br /> <xf:output ref="p3"> <xf:label>Property 3 = </xf:label> </xf:output> </xf:group> <br /> <div id="console" style="display:block;top:100px;" /> </body> </html> -- Regards Stephen Cameron Data Programmer Integrated Marine Observing System (IMOS) eMarine Information Infrastructure Project University of Tasmania, Private Bag 21, Hobart, TAS 7001, Australia Tel: +61 3 6226 8507 Fax: +61 3 6226 2997 Email: ste...@ut... URL: http://www.imos.org.au/eMII.html |
From: Jesper T. <je...@tv...> - 2010-01-06 21:30:01
|
Thanks, it works. Yes, I should look deep into xsltforms.js, and I will try out this FireBug. Cheers, Jesper Tverskov |
From: COUTHURES A. <ala...@ag...> - 2010-01-06 21:09:56
|
Jesper, Sorry for the late response. You have to look at XNode class in xsltforms.js to exactly know which methods are implemented. In your test case, you can use "setAttributeNS". Usually, for Javascript instructions, I use a debugger. FireBug has its own bugs but has also some advantages, especially in this case, it can display which methods are available. Cheers, -Alain > I would very much appreciate if anyone could come with a working > example of how to change an attribute value in the instance document > using getInstanceDocument(). > > The DOM interface to the instance document is a must for any but the > most trivial use cases of XSLTForms. > > In my supplied test file I have manage to update element content. My > test file is working e.g. in IE (the DTD must be deleted first), > Firefox, Opera and Chrome, but I have not been able to update or > create attributes or to create a new element. > > Cheers, > Jesper Tverskov > > http://www.xmlkurser.dk > http://www.xmlplease.com > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > Xsltforms-support mailing list > Xsl...@li... > https://lists.sourceforge.net/lists/listinfo/xsltforms-support > > |
From: Jesper T. <je...@tv...> - 2010-01-06 06:22:33
|
I would very much appreciate if anyone could come with a working example of how to change an attribute value in the instance document using getInstanceDocument(). The DOM interface to the instance document is a must for any but the most trivial use cases of XSLTForms. In my supplied test file I have manage to update element content. My test file is working e.g. in IE (the DTD must be deleted first), Firefox, Opera and Chrome, but I have not been able to update or create attributes or to create a new element. Cheers, Jesper Tverskov http://www.xmlkurser.dk http://www.xmlplease.com |
From: Stephen C. <Ste...@ut...> - 2010-01-06 02:10:33
|
I've found my error which was a silly mistake on my part (a bad tradesman always blames his tools!!), thanks for the help! I was taking the wrong element value in the second xf:select list to use as the id to fill the xf:group, it was staring me in the face yesterday. -- Regards Stephen Cameron Data Programmer Integrated Marine Observing System (IMOS) eMarine Information Infrastructure Project University of Tasmania, Private Bag 21, Hobart, TAS 7001, Australia Tel: +61 3 6226 8507 Fax: +61 3 6226 2997 Email: ste...@ut... URL: http://www.imos.org.au/eMII.html |
From: Klotz, L. <Lei...@xe...> - 2010-01-06 01:07:51
|
Stephen, I don't mean to make you do an "oral defense" of your code. I do want to find out if I can glean any XSLTForms bugs from your experience, and at the same time give back to you in the form of some streamlining. So there's more commentary below. -----Original Message----- From: Stephen Cameron [mailto:Ste...@ut...] Sent: Tuesday, January 05, 2010 4:42 PM To: xsl...@li... Subject: Re: [Xsltforms-support] stepping through recordset type data display Thanks for your valued comments Leigh, I'll work through them all and comment Klotz, Leigh wrote: > . xforms-ready vs. xforms-model-construct-done Unless you want to wait > for the UI to be initialized, you can do model setup on xforms-model-construct-done instead of on xforms-ready. > It should avoid an extra (possibly expensive) refresh. > I actually need the refresh to occur (I think), see my comments below regarding xforms-revalidate. Can you let me know in what cases the refresh doesn't happen? If you do a setvalue in an action handler, refresh should just happen automagically. The "extra refresh" I was talking about is this: if you wait until xforms-read, the UI will get set up, then you'll do some changes, and then the refresh will happen again. xforms-model-construct-done is the last step before the UI gets set up, and it's the right place to hook in data initialization, which is what I think you're doing in this case. ... > . Questions about the init sequence > Why is the dispatch of the custom event "set-selected" and separate setvalue necessary? > Does doing the setvalue directly on xforms-ready (or on xforms-model-construct-done) not work? > If it doesn't, it may be an XSLTForms bug. > > Also, the dispatche to xforms-revalidate is a puzzler as well, and if it's a bug workaround for xsltforms it would be good to know. > I'd have naively thought that this might work fine: > <xf:setvalue ev:event="xforms-model-construct-done" ref="instance('inst_selected')/installation_fid" > > value="instance('inst_installations')/aatams:installation[1]/@gml:id" > /> > > Sorry, I copied some old code for this Xform and some things are not needed, however to explain the origins of the set-selected custom event: I've got a more specific question, which is to ask why you're listening to xforms-ready and then dispatching a custom event called set-selected. In the example code, the set-selected event isn't used anywhere else; maybe in the real code it's used in other places, which would explain why it's named (for sharing). If it's a bug workaround of some sort, it'd be nice to know. In HTML you have the following situation. <select id="list1"> <option value="1" >Item 1</option> <option value="2" selected="true">Item 2</option> <option value="3">Item 3</option> </select> So the second item in the list appears selected after the form loads. In Xforms I cannot see how to achieve the same thing other than using the method I devised. This method avoids user confusion, as it's problematic when the first item is visible in the select1 list but unless the user actually selects an item in the list nothing has actually been triggered (so a mandatory field appears as invalid even though a valid option is visible). This problem shouldn't happen at all, and it's a bug in the XSLTForms implementation. An xf:select1 bound to a node where the node value isn't in the itemset or items should not show a selected value. It should also sport a CSS3 psuedo-class :out-of-range; most current XHTML+XForms+CSS2 implementations do this with a dynamic DOM-level attribute instead since CSS3 isn't there for us. But anyway, even once that's cleared up, you probably still would want to set the initial value, and so doing this ought to work fine: <xf:setvalue ev:event="xforms-model-construct-done" ref="instance('inst_selected')/installation_fid" value="instance('inst_installations')/aatams:installation[1]/@gml:id" /> If you find you still need the revalidate or refresh, I'm pretty sure there's a bug in XSLTForms. ... There is a problem currently when there is only one item in the list as that item cannot be manually selected at all, this is something on my todo list for resolution (is it a bug?). This may have been fixed in recent SVN versions of XSLTForms by Alain. Leigh. |
From: Stephen C. <Ste...@ut...> - 2010-01-06 00:42:18
|
Thanks for your valued comments Leigh, I'll work through them all and comment Klotz, Leigh wrote: > If the test code is working for you, it's possible there's a bug with bind in XSLTForms so you might try re-doing your existing code without the bind/@id and see if that works. > > By the way, there are a couple of simplications you might try as well: > > . Unless I'm wrong and XSLTForms is unusual, you can remove a couple of MIP attribute from those binds: > > <xf:bind id="selected_deployment_fid" nodeset="instance('inst_selected')/deployment_fid" type="xsd:string" required="false()" /> > > The type and required bindings aren't doing anything for you. You might be planning to use them for something later though. > If you do decide to put the types in, you'll probably need an xmlns:xsd definition, or else use a recent SVN release of XSLTforms and use unprefixed names (which are actually defined as unions with the empty string). > Presumably as these (type and required) are the defaults and so are not needed. Is that unprefixed names for datatypes only ? > . In XPath, // is usually expensive: > In ref="instance('inst_selected')//installation_fid" > You might do get better performnance if the binding doesn't have to search the entire instance to find the element. > In this case, since the context node default is "/*[1]" you can just do > ref="instance('inst_selected')/installation_fid" > Agreed > . xforms-ready vs. xforms-model-construct-done > Unless you want to wait for the UI to be initialized, you can do model setup on xforms-model-construct-done instead of on xforms-ready. > It should avoid an extra (possibly expensive) refresh. > I actually need the refresh to occur (I think), see my comments below regarding xforms-revalidate. > . Initial instances > This may be an artifact of your test code that the instances are loaded from long query stirngs, but you might find it more maintainable to do this: (You might not find this more readable, but if you do, it might be helpful.) > > <xf:instance id="inst_installations"> > <data xmlns=""> > <service>WFS</service> > <version>1.1.0<version> > <request>GetFeature</request> > <namespace>xmlns(aatams=http://www.imos.org.au/aatams)</namespace> > <typename>aatams:installation</typename> > </data> > </xf:instance> > <xf:submission id="init_inst_installations" resource="../deegree-wfs/services" ref="instance('inst_installations')" replace="instance" method="get" separator="&" /> > <xf:send ev:event="xforms-model-construct-done" submission="init_inst_installations" /> > > This is a nice way to do it, I presume this method is available to allow you to build a request dynamically, handy to know! > . Questions about the init sequence > Why is the dispatch of the custom event "set-selected" and separate setvalue necessary? > Does doing the setvalue directly on xforms-ready (or on xforms-model-construct-done) not work? > If it doesn't, it may be an XSLTForms bug. > > Also, the dispatche to xforms-revalidate is a puzzler as well, and if it's a bug workaround for xsltforms it would be good to know. > I'd have naively thought that this might work fine: > <xf:setvalue ev:event="xforms-model-construct-done" ref="instance('inst_selected')/installation_fid" > value="instance('inst_installations')/aatams:installation[1]/@gml:id" /> > > Sorry, I copied some old code for this Xform and some things are not needed, however to explain the origins of the set-selected custom event: In HTML you have the following situation. <select id="list1"> <option value="1" >Item 1</option> <option value="2" selected="true">Item 2</option> <option value="3">Item 3</option> </select> So the second item in the list appears selected after the form loads. In Xforms I cannot see how to achieve the same thing other than using the method I devised. This method avoids user confusion, as it's problematic when the first item is visible in the select1 list but unless the user actually selects an item in the list nothing has actually been triggered (so a mandatory field appears as invalid even though a valid option is visible). I don't really want to use an empty option, partly as this is not simple to achieve in XForms either when the select1 data comes from outside of the form. There is a problem currently when there is only one item in the list as that item cannot be manually selected at all, this is something on my todo list for resolution (is it a bug?). > . @incremental > @incremental isn't an xpath expression, so it's incremental="true". > > Leigh. > > -----Original Message----- > From: Stephen Cameron [mailto:Ste...@ut...] > Sent: Monday, January 04, 2010 9:32 PM > To: xsl...@li... > Subject: [Xsltforms-support] stepping through recordset type data display > > Hello, > > I have a specific problem where I wish to select a record from a > xf:select1 list and then on on the basis of the selected value display a full record below it. > > The full record will be displayed with the use of a xf:group tag, so I am a really wanting to dynamically change the node the group references via its 'ref 'or 'bind' attribute. > > I cannot get this to work, but I cannot find an example where someone has done this to know that it should work. > > Effectively the behaviour that I want to replicate can be seen in an > (non-Xform) example here > http://xmljs.sourceforge.net/contributedAdd-ons/xpath/sampleApplications/contactManager/contactManager.html. > This just steps through a xml 'recordset' displaying each record in turn. I'd be interested to see this done in an XSLTForms example! > > My Xform code is as follows: > > <?xml version="1.0" encoding="UTF-8"?> > <?xml-stylesheet href="forms/xsltforms/xsltforms.xsl" type="text/xsl"?> <html xmlns:gml="http://www.opengis.net/gml" > xmlns:wfs="http://www.opengis.net/wfs" > xmlns:aatams="http://www.imos.org.au/aatams" > xmlns="http://www.w3.org/1999/xhtml" > xmlns:xf="http://www.w3.org/2002/xforms" > xmlns:ev="http://www.w3.org/2001/xml-events" wfs:dummy="dummy" > gml:dummy="dummy" aatams:dummy="dummy"> > <head> > <title>PRINT RECOVERY WORKSHEET</title> > <link href="forms/aatams.css" rel="stylesheet" type="text/css" /> > <xf:model id="model1"> > <!-- get the relevant deployments --> > <xf:instance id="inst_installations" > src="../deegree-wfs/services?service=WFS&version=1.1.0&request=GetFeature&namespace=xmlns(aatams=http://www.imos.org.au/aatams)&typename=aatams:installation" > /> > <xf:instance id="inst_installation_deployments" > src="../deegree-wfs/services?service=WFS&version=1.1.0&request=GetFeature&namespace=xmlns(aatams=http://www.imos.org.au/aatams)&typename=aatams:installation_deployment" > /> > <xf:instance id="inst_selected"> > <data> > <installation_fid /> > <deployment_fid /> > </data> > </xf:instance> > <xf:bind id="selected_installation_fid" > nodeset="instance('inst_selected')/installation_fid" type="xsd:string" > required="false()" /> > <xf:bind id="selected_deployment_fid" > nodeset="instance('inst_selected')/deployment_fid" type="xsd:string" > required="false()" /> > <xf:bind id="selected_deployment" > nodeset="instance('inst_installation_deployments')//aatams:installation_deployment[aatams:deployment_fid=instance('inst_selected')/deployment_fid]" > /> > <xf:dispatch ev:event="xforms-ready" name="set-selected" > target="model1" /> > <xf:action ev:event="set-selected"> > <xf:setvalue > ref="instance('inst_selected')//installation_fid" > value="instance('inst_installations')//aatams:installation[1]/@gml:id" /> > <xf:dispatch name="xforms-revalidate" target="model1" /> > </xf:action> > </xf:model> > </head> > <body> > <xf:switch> > <xf:case id="select_deployment"> > <div class="form"> > <legend>PRINT RECOVERY WORKSHEET</legend> > <div class="form-contents"> > <div class="dependant-selects"> > <xf:select1 bind="selected_installation_fid" > appearance="minimal" incremental="true()"> > <xf:label>Installation</xf:label> > <xf:itemset nodeset="instance('inst_installations')//aatams:installation"> > <xf:value ref="@gml:id" /> > <xf:label ref="aatams:name" /> > </xf:itemset> > <xf:action ev:event="xforms-value-changed"> > <xf:setvalue ref="instance('inst_selected')//deployment_fid" value="" /> > </xf:action> > </xf:select1> > <xf:select1 bind="selected_deployment_fid" > appearance="minimal" incremental="true()"> > <xf:label>Scheduled Recoveries</xf:label> > <xf:itemset nodeset="instance('inst_installation_deployments')//aatams:installation_deployment[aatams:installation_fid=instance('inst_selected')/installation_fid > and aatams:scheduled_recovery_date >= local-date()]"> > <xf:value ref="@gml:id" /> > <xf:label ref="aatams:name" /> > </xf:itemset> > </xf:select1> > </div> > <xf:trigger> > <xf:label>Show Worksheet</xf:label> > <xf:toggle case="show_worksheet" > ev:event="DOMActivate" /> > </xf:trigger> > </div> > </div> > </xf:case> > <xf:case id="show_worksheet"> > <xf:group bind="selected_deployment"> > <xf:output ref="aatams:longitude"> > <xf:label>Longitude:</xf:label> > </xf:output> > <xf:output ref="aatams:latitude"> > <xf:label>Latitude:</xf:label> > </xf:output> > </xf:group> > <xf:output bind="selected_deployment_fid"> > <xf:label>deployment:</xf:label> > </xf:output> > <xf:trigger> > <xf:label>Select Deployment</xf:label> > <xf:toggle case="select_deployment" > ev:event="DOMActivate" /> > </xf:trigger> > </xf:case> > </xf:switch> > <br /> > <div id="console" style="display:block;top:100px;" /> > </body> > </html> > > I want the output controls in the xf:group to change according to the item selected in the second select. > > Interestingly the contents of the second xf:select1 changes automatically according to what is selected by the user in the first > xf:select1 but the 'context' of the xf:group is not changing in the same fashion. > > I can provide all the model data files as well if anyone is interested to see this in action. > > > -- Regards Stephen Cameron Data Programmer Integrated Marine Observing System (IMOS) eMarine Information Infrastructure Project University of Tasmania, Private Bag 21, Hobart, TAS 7001, Australia Tel: +61 3 6226 8507 Fax: +61 3 6226 2997 Email: ste...@ut... URL: http://www.imos.org.au/eMII.html |
From: Klotz, L. <Lei...@XE...> - 2010-01-05 23:30:21
|
If the test code is working for you, it's possible there's a bug with bind in XSLTForms so you might try re-doing your existing code without the bind/@id and see if that works. By the way, there are a couple of simplications you might try as well: . Unless I'm wrong and XSLTForms is unusual, you can remove a couple of MIP attribute from those binds: <xf:bind id="selected_deployment_fid" nodeset="instance('inst_selected')/deployment_fid" type="xsd:string" required="false()" /> The type and required bindings aren't doing anything for you. You might be planning to use them for something later though. If you do decide to put the types in, you'll probably need an xmlns:xsd definition, or else use a recent SVN release of XSLTforms and use unprefixed names (which are actually defined as unions with the empty string). . In XPath, // is usually expensive: In ref="instance('inst_selected')//installation_fid" You might do get better performnance if the binding doesn't have to search the entire instance to find the element. In this case, since the context node default is "/*[1]" you can just do ref="instance('inst_selected')/installation_fid" . xforms-ready vs. xforms-model-construct-done Unless you want to wait for the UI to be initialized, you can do model setup on xforms-model-construct-done instead of on xforms-ready. It should avoid an extra (possibly expensive) refresh. . Initial instances This may be an artifact of your test code that the instances are loaded from long query stirngs, but you might find it more maintainable to do this: (You might not find this more readable, but if you do, it might be helpful.) <xf:instance id="inst_installations"> <data xmlns=""> <service>WFS</service> <version>1.1.0<version> <request>GetFeature</request> <namespace>xmlns(aatams=http://www.imos.org.au/aatams)</namespace> <typename>aatams:installation</typename> </data> </xf:instance> <xf:submission id="init_inst_installations" resource="../deegree-wfs/services" ref="instance('inst_installations')" replace="instance" method="get" separator="&" /> <xf:send ev:event="xforms-model-construct-done" submission="init_inst_installations" /> . Questions about the init sequence Why is the dispatch of the custom event "set-selected" and separate setvalue necessary? Does doing the setvalue directly on xforms-ready (or on xforms-model-construct-done) not work? If it doesn't, it may be an XSLTForms bug. Also, the dispatche to xforms-revalidate is a puzzler as well, and if it's a bug workaround for xsltforms it would be good to know. I'd have naively thought that this might work fine: <xf:setvalue ev:event="xforms-model-construct-done" ref="instance('inst_selected')/installation_fid" value="instance('inst_installations')/aatams:installation[1]/@gml:id" /> . @incremental @incremental isn't an xpath expression, so it's incremental="true". Leigh. -----Original Message----- From: Stephen Cameron [mailto:Ste...@ut...] Sent: Monday, January 04, 2010 9:32 PM To: xsl...@li... Subject: [Xsltforms-support] stepping through recordset type data display Hello, I have a specific problem where I wish to select a record from a xf:select1 list and then on on the basis of the selected value display a full record below it. The full record will be displayed with the use of a xf:group tag, so I am a really wanting to dynamically change the node the group references via its 'ref 'or 'bind' attribute. I cannot get this to work, but I cannot find an example where someone has done this to know that it should work. Effectively the behaviour that I want to replicate can be seen in an (non-Xform) example here http://xmljs.sourceforge.net/contributedAdd-ons/xpath/sampleApplications/contactManager/contactManager.html. This just steps through a xml 'recordset' displaying each record in turn. I'd be interested to see this done in an XSLTForms example! My Xform code is as follows: <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet href="forms/xsltforms/xsltforms.xsl" type="text/xsl"?> <html xmlns:gml="http://www.opengis.net/gml" xmlns:wfs="http://www.opengis.net/wfs" xmlns:aatams="http://www.imos.org.au/aatams" xmlns="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events" wfs:dummy="dummy" gml:dummy="dummy" aatams:dummy="dummy"> <head> <title>PRINT RECOVERY WORKSHEET</title> <link href="forms/aatams.css" rel="stylesheet" type="text/css" /> <xf:model id="model1"> <!-- get the relevant deployments --> <xf:instance id="inst_installations" src="../deegree-wfs/services?service=WFS&version=1.1.0&request=GetFeature&namespace=xmlns(aatams=http://www.imos.org.au/aatams)&typename=aatams:installation" /> <xf:instance id="inst_installation_deployments" src="../deegree-wfs/services?service=WFS&version=1.1.0&request=GetFeature&namespace=xmlns(aatams=http://www.imos.org.au/aatams)&typename=aatams:installation_deployment" /> <xf:instance id="inst_selected"> <data> <installation_fid /> <deployment_fid /> </data> </xf:instance> <xf:bind id="selected_installation_fid" nodeset="instance('inst_selected')/installation_fid" type="xsd:string" required="false()" /> <xf:bind id="selected_deployment_fid" nodeset="instance('inst_selected')/deployment_fid" type="xsd:string" required="false()" /> <xf:bind id="selected_deployment" nodeset="instance('inst_installation_deployments')//aatams:installation_deployment[aatams:deployment_fid=instance('inst_selected')/deployment_fid]" /> <xf:dispatch ev:event="xforms-ready" name="set-selected" target="model1" /> <xf:action ev:event="set-selected"> <xf:setvalue ref="instance('inst_selected')//installation_fid" value="instance('inst_installations')//aatams:installation[1]/@gml:id" /> <xf:dispatch name="xforms-revalidate" target="model1" /> </xf:action> </xf:model> </head> <body> <xf:switch> <xf:case id="select_deployment"> <div class="form"> <legend>PRINT RECOVERY WORKSHEET</legend> <div class="form-contents"> <div class="dependant-selects"> <xf:select1 bind="selected_installation_fid" appearance="minimal" incremental="true()"> <xf:label>Installation</xf:label> <xf:itemset nodeset="instance('inst_installations')//aatams:installation"> <xf:value ref="@gml:id" /> <xf:label ref="aatams:name" /> </xf:itemset> <xf:action ev:event="xforms-value-changed"> <xf:setvalue ref="instance('inst_selected')//deployment_fid" value="" /> </xf:action> </xf:select1> <xf:select1 bind="selected_deployment_fid" appearance="minimal" incremental="true()"> <xf:label>Scheduled Recoveries</xf:label> <xf:itemset nodeset="instance('inst_installation_deployments')//aatams:installation_deployment[aatams:installation_fid=instance('inst_selected')/installation_fid and aatams:scheduled_recovery_date >= local-date()]"> <xf:value ref="@gml:id" /> <xf:label ref="aatams:name" /> </xf:itemset> </xf:select1> </div> <xf:trigger> <xf:label>Show Worksheet</xf:label> <xf:toggle case="show_worksheet" ev:event="DOMActivate" /> </xf:trigger> </div> </div> </xf:case> <xf:case id="show_worksheet"> <xf:group bind="selected_deployment"> <xf:output ref="aatams:longitude"> <xf:label>Longitude:</xf:label> </xf:output> <xf:output ref="aatams:latitude"> <xf:label>Latitude:</xf:label> </xf:output> </xf:group> <xf:output bind="selected_deployment_fid"> <xf:label>deployment:</xf:label> </xf:output> <xf:trigger> <xf:label>Select Deployment</xf:label> <xf:toggle case="select_deployment" ev:event="DOMActivate" /> </xf:trigger> </xf:case> </xf:switch> <br /> <div id="console" style="display:block;top:100px;" /> </body> </html> I want the output controls in the xf:group to change according to the item selected in the second select. Interestingly the contents of the second xf:select1 changes automatically according to what is selected by the user in the first xf:select1 but the 'context' of the xf:group is not changing in the same fashion. I can provide all the model data files as well if anyone is interested to see this in action. -- Regards Stephen Cameron Data Programmer Integrated Marine Observing System (IMOS) eMarine Information Infrastructure Project University of Tasmania, Private Bag 21, Hobart, TAS 7001, Australia Tel: +61 3 6226 8507 Fax: +61 3 6226 2997 Email: ste...@ut... URL: http://www.imos.org.au/eMII.html ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ Xsltforms-support mailing list Xsl...@li... https://lists.sourceforge.net/lists/listinfo/xsltforms-support |
From: Stephen C. <Ste...@ut...> - 2010-01-05 23:02:58
|
Hi Tambet, I have elaborated the test case that you sent me and it works (see below). My code is doing basically the same thing so I must have made a mistake somewhere, so I'll start again with something simple and redo everything to see where it fails. Thanks <?xml version="1.0" encoding="UTF-8"?> <!-- Created with Liquitem XML Studio - FREE Community Edition 7.0.4.795 (http://www.liquitem-technologies.com) --> <?xml-stylesheet href="forms/xsltforms/xsltforms.xsl" type="text/xsl"?> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events"> <head> <xf:model id="model1"> <xf:instance id="data"> <data xmlns=""> <item id="1"> <p1>1-1</p1> <p2>1-2</p2> <p3>1-3</p3> </item> <item id="2"> <p1>2-1</p1> <p2>2-2</p2> <p3>2-3</p3> </item> <item id="3"> <p1>3-1</p1> <p2>3-2</p2> <p3>3-3</p3> </item> <item id="4"> <p1>4-1</p1> <p2>4-2</p2> <p3>4-3</p3> </item> <item id="5"> <p1>5-1</p1> <p2>5-2</p2> <p3>5-3</p3> </item> </data> </xf:instance> <xf:instance id="temp"> <data xmlns=""> <selected_item>3</selected_item> </data> </xf:instance> </xf:model> </head> <body> <xf:select1 ref="instance('temp')/selected_item"> <xf:itemset nodeset="instance('data')/item"> <xf:value ref="@id"/> <xf:label ref="@id"/> </xf:itemset> </xf:select1> <xf:group ref="instance('data')/item[@id = instance('temp')/selected_item]"> <br/> <xf:output ref="p1"> <xf:label>Property 1 = </xf:label> </xf:output> <br/> <xf:output ref="p2"> <xf:label>Property 2 = </xf:label> </xf:output> <br/> <xf:output ref="p3"> <xf:label>Property 3 = </xf:label> </xf:output> </xf:group> <br /> <div id="console" style="display:block;top:100px;" /> </body> </html> -------- Original Message -------- Subject: Re: [Xsltforms-support] stepping through recordset type data display Date: Tue, 05 Jan 2010 10:01:28 +0200 From: Tambet Matiisen <tam...@gm...> To: Stephen Cameron <Ste...@ut...> CC: xsl...@li... References: <4B4...@ut...> Stephen Cameron wrote: > Hello, > > I have a specific problem where I wish to select a record from a > xf:select1 list and then on on the basis of the selected value display a > full record below it. > > The full record will be displayed with the use of a xf:group tag, so I > am a really wanting to dynamically change the node the group references > via its 'ref 'or 'bind' attribute Something like this should work: <xforms:select1 ref="instance('temp')/selected_id"> <xforms:itemset nodeset="instance('data')/item"> <xforms:value ref="id"/> <xforms:label ref="label"/> </xforms:itemset> </xforms:select1> <xforms:group ref="instance('data')/item[id = instance('temp')/selected_id]"> <xforms:output ref="id">...</xforms:output> <xforms:output ref="label">...</xforms:output> </xforms:group> Tambet -- Regards Stephen Cameron Data Programmer Integrated Marine Observing System (IMOS) eMarine Information Infrastructure Project University of Tasmania, Private Bag 21, Hobart, TAS 7001, Australia Tel: +61 3 6226 8507 Fax: +61 3 6226 2997 Email: ste...@ut... URL: http://www.imos.org.au/eMII.html |
From: Tambet M. <tam...@gm...> - 2010-01-05 08:01:41
|
Stephen Cameron wrote: > Hello, > > I have a specific problem where I wish to select a record from a > xf:select1 list and then on on the basis of the selected value display a > full record below it. > > The full record will be displayed with the use of a xf:group tag, so I > am a really wanting to dynamically change the node the group references > via its 'ref 'or 'bind' attribute Something like this should work: <xforms:select1 ref="instance('temp')/selected_id"> <xforms:itemset nodeset="instance('data')/item"> <xforms:value ref="id"/> <xforms:label ref="label"/> </xforms:itemset> </xforms:select1> <xforms:group ref="instance('data')/item[id = instance('temp')/selected_id]"> <xforms:output ref="id">...</xforms:output> <xforms:output ref="label">...</xforms:output> </xforms:group> Tambet |
From: Stephen C. <Ste...@ut...> - 2010-01-05 05:32:15
|
Hello, I have a specific problem where I wish to select a record from a xf:select1 list and then on on the basis of the selected value display a full record below it. The full record will be displayed with the use of a xf:group tag, so I am a really wanting to dynamically change the node the group references via its 'ref 'or 'bind' attribute. I cannot get this to work, but I cannot find an example where someone has done this to know that it should work. Effectively the behaviour that I want to replicate can be seen in an (non-Xform) example here http://xmljs.sourceforge.net/contributedAdd-ons/xpath/sampleApplications/contactManager/contactManager.html. This just steps through a xml 'recordset' displaying each record in turn. I'd be interested to see this done in an XSLTForms example! My Xform code is as follows: <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet href="forms/xsltforms/xsltforms.xsl" type="text/xsl"?> <html xmlns:gml="http://www.opengis.net/gml" xmlns:wfs="http://www.opengis.net/wfs" xmlns:aatams="http://www.imos.org.au/aatams" xmlns="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events" wfs:dummy="dummy" gml:dummy="dummy" aatams:dummy="dummy"> <head> <title>PRINT RECOVERY WORKSHEET</title> <link href="forms/aatams.css" rel="stylesheet" type="text/css" /> <xf:model id="model1"> <!-- get the relevant deployments --> <xf:instance id="inst_installations" src="../deegree-wfs/services?service=WFS&version=1.1.0&request=GetFeature&namespace=xmlns(aatams=http://www.imos.org.au/aatams)&typename=aatams:installation" /> <xf:instance id="inst_installation_deployments" src="../deegree-wfs/services?service=WFS&version=1.1.0&request=GetFeature&namespace=xmlns(aatams=http://www.imos.org.au/aatams)&typename=aatams:installation_deployment" /> <xf:instance id="inst_selected"> <data> <installation_fid /> <deployment_fid /> </data> </xf:instance> <xf:bind id="selected_installation_fid" nodeset="instance('inst_selected')/installation_fid" type="xsd:string" required="false()" /> <xf:bind id="selected_deployment_fid" nodeset="instance('inst_selected')/deployment_fid" type="xsd:string" required="false()" /> <xf:bind id="selected_deployment" nodeset="instance('inst_installation_deployments')//aatams:installation_deployment[aatams:deployment_fid=instance('inst_selected')/deployment_fid]" /> <xf:dispatch ev:event="xforms-ready" name="set-selected" target="model1" /> <xf:action ev:event="set-selected"> <xf:setvalue ref="instance('inst_selected')//installation_fid" value="instance('inst_installations')//aatams:installation[1]/@gml:id" /> <xf:dispatch name="xforms-revalidate" target="model1" /> </xf:action> </xf:model> </head> <body> <xf:switch> <xf:case id="select_deployment"> <div class="form"> <legend>PRINT RECOVERY WORKSHEET</legend> <div class="form-contents"> <div class="dependant-selects"> <xf:select1 bind="selected_installation_fid" appearance="minimal" incremental="true()"> <xf:label>Installation</xf:label> <xf:itemset nodeset="instance('inst_installations')//aatams:installation"> <xf:value ref="@gml:id" /> <xf:label ref="aatams:name" /> </xf:itemset> <xf:action ev:event="xforms-value-changed"> <xf:setvalue ref="instance('inst_selected')//deployment_fid" value="" /> </xf:action> </xf:select1> <xf:select1 bind="selected_deployment_fid" appearance="minimal" incremental="true()"> <xf:label>Scheduled Recoveries</xf:label> <xf:itemset nodeset="instance('inst_installation_deployments')//aatams:installation_deployment[aatams:installation_fid=instance('inst_selected')/installation_fid and aatams:scheduled_recovery_date >= local-date()]"> <xf:value ref="@gml:id" /> <xf:label ref="aatams:name" /> </xf:itemset> </xf:select1> </div> <xf:trigger> <xf:label>Show Worksheet</xf:label> <xf:toggle case="show_worksheet" ev:event="DOMActivate" /> </xf:trigger> </div> </div> </xf:case> <xf:case id="show_worksheet"> <xf:group bind="selected_deployment"> <xf:output ref="aatams:longitude"> <xf:label>Longitude:</xf:label> </xf:output> <xf:output ref="aatams:latitude"> <xf:label>Latitude:</xf:label> </xf:output> </xf:group> <xf:output bind="selected_deployment_fid"> <xf:label>deployment:</xf:label> </xf:output> <xf:trigger> <xf:label>Select Deployment</xf:label> <xf:toggle case="select_deployment" ev:event="DOMActivate" /> </xf:trigger> </xf:case> </xf:switch> <br /> <div id="console" style="display:block;top:100px;" /> </body> </html> I want the output controls in the xf:group to change according to the item selected in the second select. Interestingly the contents of the second xf:select1 changes automatically according to what is selected by the user in the first xf:select1 but the 'context' of the xf:group is not changing in the same fashion. I can provide all the model data files as well if anyone is interested to see this in action. -- Regards Stephen Cameron Data Programmer Integrated Marine Observing System (IMOS) eMarine Information Infrastructure Project University of Tasmania, Private Bag 21, Hobart, TAS 7001, Australia Tel: +61 3 6226 8507 Fax: +61 3 6226 2997 Email: ste...@ut... URL: http://www.imos.org.au/eMII.html |
From: Klotz, L. <Lei...@xe...> - 2010-01-04 22:59:42
|
Alain, If you allow XForms controls in UI inline content in your XForms integration (which XSLTForms does), then XForms controls are allowed in xf:message. However, as John Boyer has pointed out, there are issues with bubbling of DOMActivate targeted at controls inside the xf:message. XForms 1.2 is scheduled to have xf:dialog defined. The repeat ID issues you are dealing with are also handled similarly, I believe, but you might want to check. We briefly considered using a component language to allow separate definition and instantiation of XForms dialogs, but decided against it. Leigh. -----Original Message----- From: COUTHURES Alain [mailto:ala...@ag...] Sent: Saturday, January 02, 2010 10:09 AM To: David Amusin Cc: David Amusin; xsl...@li...; Micah Dubinko Subject: Re: [Xsltforms-support] Using an xsf:dialog inside of an xf:repeat David, I have finally found a trick for xsf:dialog support inside of an xf:repeat so the test case you sent is now working for me with the latest SVN version. BTW, I have also added nested xsf:dialog support, with a workaround for IE6 bug about select and z-index. xsf:dialog is now richer than AJAXForms ajx:dialog (there is also, in AJAXForms, ajx:confirm which allows Javascript confirm() use for aborting an action processing but it's not supported in XSLTForms). When comparing xsf:dialog and xf:message, it appears to me that xf:message can just contain constant text strings and text output controls whereas controls of any kind can be in xsf:dialog. So xsf:dialog is a sort of extension of xf:message but with a different syntax. I now think it would be interesting to allow any kind of controls in xf:message without defining any new element with its own syntax. The first step for XSLTForms should be to render xf:message as a specific xsf:dialog (not anymore with Javascript alert()...). Suggestions and points of view are welcome in this mailing list. Happy New Year! -Alain ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ Xsltforms-support mailing list Xsl...@li... https://lists.sourceforge.net/lists/listinfo/xsltforms-support |
From: Jesper T. <je...@tv...> - 2010-01-03 07:44:44
|
OK Here is my test file: <?xml-stylesheet href="xsltforms/xsltforms.xsl" type="text/xsl"?> <?xsltforms-options debug="yes"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <head> <script type="text/javascript"> //<![CDATA[ function createNew(){ var model = document.getElementById("myModel"); var instance = model.getInstanceDocument("myInstance"); var dataElement = instance.getElementsByTagName("data")[0]; var itemElement0 = dataElement.getElementsByTagName("item")[0]; var itemElement1 = dataElement.getElementsByTagName("item")[1]; itemElement0.childNodes[0].nodeValue = "New content"; //itemElement1.setAttribute("z", "NEW ATT VALUE"); model.rebuild(); model.recalculate(); model.revalidate(); model.refresh(); } //]]> </script> <xf:model id="myModel"> <xf:instance id="myInstance" xmlns=""> <data> <item>Old content</item> <item z="old att value"/> <b/> </data> </xf:instance> <!-- This xf:bind is a trick of mine to get the example working! --> <!-- I would love to delete it ? --> <xf:bind calculate="5 + 5" nodeset="/data/b"/> </xf:model> </head> <body> <p><xf:output ref="/data/item[1]"/></p> <p><xf:output ref="/data/item[2]/@z"/></p> <xf:trigger> <xf:label>Change</xf:label> <xf:load ev:event="DOMActivate" resource="javascript:createNew()"/> </xf:trigger> </body> </html> The file is working, that is, I can change the content of the first item element. I don't know why I need the b element and the binding. This is a trick of mine to get the file working. Please inform me what I can do instead. *** Now, I have not succeeded in changing the z attribute value in the second item element. That is why I have out commented it in the JavaScript like this: //itemElement1.setAttribute("z", "NEW ATT VALUE"); To get the update of the attribute working is my main problem. But it would be nice if I could also be able to make new elements and attributes. I am going to use it all to make a shuffle routine in JavaScript that can annotate the instance document with the proper randomized values so the questions and their options get shuffled each time the user take the test. Cheers, Jesper Tverskov |
From: COUTHURES A. <ala...@ag...> - 2010-01-02 21:57:16
|
Hi Jesper, > I am testing the DOM interface to the instance document using > getInstanceDocument(), and I have no problems updating simpleContent > of an element. > > But I have failed so far updating an attribute or creating new > attributes and new elements from JavaScript using > getInstanceDocument(). > > Is this failure due to lack of implementation in XSLTForms or haven't > I been experimenting hard enough? > Could you please send me a test case ? I think it will be an easy way to show you how to do this. Thanks! -Alain |