xsltforms-support Mailing List for XSLTForms (Page 106)
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...> - 2009-10-01 19:52:29
|
That fix was for dynamic XForms pages (*.xql files), by using XQuery. I am using static files (*.xml files). Claudius |
From: COUTHURES A. <ala...@ag...> - 2009-10-01 19:35:20
|
Claudius, > I saw that you modified them about 15 minutes ago and loaded them. > > But Opera says > > XSLTForms Exception > > -------------------------- > > > > Error initializing : > > > > TypeError > > > > Statement on line 3006: Cannot convert undefined or null to Object > > stacktrace: n/a; see opera:config#UserPrefs|Exceptions Have Stacktrace > > > and FF says > > XSLTForms Exception > -------------------------- > > Error initializing : > > TypeError > > this.element.firstChild.firstChild is null > > > Claudius > > Such errors happen when configuration is not correct... especially indented result after transformation. Please refer to previous posts on this list because I thought this was already solved... -Alain |
From: claudius t. <cla...@ya...> - 2009-10-01 19:20:17
|
I saw that you modified them about 15 minutes ago and loaded them. But Opera says XSLTForms Exception -------------------------- Error initializing : TypeError Statement on line 3006: Cannot convert undefined or null to Object stacktrace: n/a; see opera:config#UserPrefs|Exceptions Have Stacktrace and FF says XSLTForms Exception -------------------------- Error initializing : TypeError this.element.firstChild.firstChild is null Claudius |
From: COUTHURES A. <ala...@ag...> - 2009-10-01 19:05:29
|
Hi Mark, > Well, rebuild, recalculate, revalidate and refresh methods on model > would be really nice, obviously. I just added these methods! > > Individual instances just needs to be accessible as a bog-standard XML > document objects. Here is an extract from the wiki developer documentation of XSLTForms : XNode Class * constructor function : initializes specific properties * *getElementsByTagName* method : gets an array of all elements with a given tag name for this XNode object * *getTextContent* method : gets the text context for this XNode object * *appendChild* method : appends a new child at this XNode object * *replaceChild* method : replaces a child of this XNode object * *insertBefore* method : inserts a child before another one of this XNode object * *removeChild* method : removes a child of this XNode object * *setAttributeNS* method : sets an attribute of this XNode object after creating it if necessary. "xsd:type" is interpreted to associate the corresponding type to this XNode object. * *getAttributeNS* method : gets the value of an attribute of this XNode object * *removeAttributeNS* method : removes an attribute of this XNode object * *cloneNode* method : clones this XNode object * *init* function : sets properties of this XNode object * *recycle* function : clears every properties of this XNode object and of its child XNode objects * *create* function : reuses a previously recycled XNode object or creates a new XNode object Cheers, -Alain |
From: COUTHURES A. <ala...@ag...> - 2009-10-01 17:53:58
|
I have very recently added support for namespaces in XPath function calls and both xsltforms.xsl and xsltforms.js files were concerned. It sounds as if you didn't download the latest version of both files... ;-) -Alain claudius teo a écrit : > I made another step forward, and now I have the error: > > XSLTForms Exception > > -------------------------- > > > > Error initializing : > > > > Function http://www.w3.org/2002/xforms instance() not found > > > I make tests on FF3.0.13/Debian, ies4linux/Dabian (a sort of IE for Linux) and Opera 10/Debian. > > Thanks, > Claudius > > > > > |
From: claudius t. <cla...@ya...> - 2009-10-01 17:06:40
|
I made another step forward, and now I have the error: XSLTForms Exception -------------------------- Error initializing : Function http://www.w3.org/2002/xforms instance() not found I make tests on FF3.0.13/Debian, ies4linux/Dabian (a sort of IE for Linux) and Opera 10/Debian. Thanks, Claudius |
From: Wolfgang M. <wol...@ex...> - 2009-10-01 14:26:27
|
> "Core is not defined" I guess you are still using the old xsltforms.xsl? This is one of the errors I had yesterday and which should be fixed. Please update your xsltforms.xsl with either the one in eXist trunk or XSLTForms trunk. Wolfgang |
From: <ala...@ag...> - 2009-10-01 13:55:47
|
Claudius, This simple test file is working for me. The star still located at the right side indicates that the initialization went wrong in your browser and it's just what happened with "Core is not defined" message. I suspect that the xsltforms.js file was not accessible ! Can you check this ? Thanks! -Alain |
From: claudius t. <cla...@ya...> - 2009-10-01 10:54:45
|
First simple test: with the file attached I get the following error: "Core is not defined" Also, the password mentioned in instance is not shown. How could I remove the star located in the right-side of inputs (used usually for "required" fields), as I have no required field? Claudius |
From: claudius t. <cla...@ya...> - 2009-10-01 09:18:30
|
Hi, Alain, 1. The reason for using two models with javascript functions is to use the eXist capability of sending some data after receiving a HTTP POST request. Of course, it would be easier to send the HTTP POST request to server, reset the model (only one model) and send to server a HTTP GET request for the general data wanted. But I wanted to save this new HTTP GET request and do all job with only one request to server. Of course, this costs me a lot of precessing client-side, namely: receive data after HTTP POST request, transfer it to model2, reset model1, transfer data to model1. If you think that I act in a too complicated manner, tell me, please. 2. I don't want to rush. I want to gradually transfer my XForms pages to XSLTForms. So, I will be patient and you will receive due observations from me. Thank you, Claudius |
From: COUTHURES A. <ala...@ag...> - 2009-10-01 08:53:48
|
Hi Claudius, The XForms page you sent me is a complex one : schemas, two models interfering, ... First, look at W3C test #2.4.a for schema syntax supported by XSLTForms : targetNamespace attribut,... Because namespace axis is not supported in FireFox, there has to be an element or an attribute attached to any user defined namespace. I usually add in the document element something like myprefix:dummy="dummy" ... XLTForms XPath expression analyzer doesn't understand expressions such as instance('...')[...] : you have to replace them with more conventional XPath 1.0 syntax such as instance('...')/myelement[...] Because of model1 referring to model2, late binding is required in XSLTForms : there was a bug concerning this I just fixed (it is not yet committed). But there is, at least, another XSLTForms bug concerning xf:reset within an xf:action which might need some hours to be fixed. Are you in a hurry about that ? Regards, -Alain |
From: Mark S. <m_s...@ma...> - 2009-10-01 07:02:46
|
Hi Alain, Well, rebuild, recalculate, revalidate and refresh methods on model would be really nice, obviously. Individual instances just needs to be accessible as a bog-standard XML document objects. It would be nice to see this functionality sooner rather than later if I am to be able to evaluate XSLTForms seriously for this project. The work that you and the guys working on eXist 1.4 have done has already helped me a great deal. All the best Mark On 23 Sep 2009, at 12:56, COUTHURES Alain wrote: > Hi Mark, > > Javascript interacting with XSLTForms is an important feature and I > always try to be compatible with the Mozilla XForms extension. > > As you already know, the corresponding methods are not yet present > in XSLTForms. Could you please list me the methods/attributes you > need ? > > Are you in a hurry about them ? > > Cheers, > > -Alain > > Mark Seaborne a écrit : >> Hi Alain, >> >> So, now you have the getInstanceDocument method, how can I modify >> an instance in Javascript? >> >> I have been using the Firefox plug-in's Javascript integration to >> replace nodesets within instances, as well as to set text values. >> >> My motivation for using Javascript to interact with XForms is that >> I a m using an OpenLayers map to allow users interact with instance >> data. >> >> All the best >> >> Mark >> > |
From: claudius t. <cla...@ya...> - 2009-09-30 22:08:33
|
Hi, Alain, The file attached gives errors. Claudius |
From: COUTHURES A. <ala...@ag...> - 2009-09-30 18:28:50
|
Hi Wolfgang, I have committed these two fixes. Don't hesitate to contact me again if there are still problems. Thanks again! -Alain Wolfgang a écrit : > Hi Alain, > > I was looking into how to apply the xsltforms stylesheet on the server > instead of the client. I needed to make 2 small fixes to the > xsltforms.xsl stylesheet to get it to work properly: > > 1) two lines in the generated javascript assume that the xsltforms.js > code has already been loaded: > > Core.fileName='xsltforms.js'; > > Dialog.show('statusPanel'); > > The assumption works sometimes, but mostly doesn't and causes the > entire script to fail. Just moving the two statements *inside* the > init() function fixes the issue for me. > > 2) location of xsltforms.js and xsltforms.css: the stylesheet > determines the basedir for loading those resources by looking at the > processing instruction. However, if the stylesheet is applied by a > script on the server, there won't be processing instruction. I thus > introduced a stylesheet parameter: > > <xsl:param name="baseuri"/> > > which is then checked to determine $resourcesdir: > > <xsl:variable name="resourcesdir"> > <xsl:choose> > <xsl:when test="$baseuri != ''"> > <xsl:value-of select="$baseuri"/> > </xsl:when> > <xsl:otherwise> > <xsl:value-of select="substring-before($href, > 'xsltforms.xsl')"/> > </xsl:otherwise> > </xsl:choose> > </xsl:variable> > > Wolfgang > |
From: Evgeny G. <gaz...@gm...> - 2009-09-30 15:14:56
|
Hello! Are any use XSLTFORMS and JQuery at one time? ------ Evgeny. |
From: COUTHURES A. <ala...@ag...> - 2009-09-30 14:01:29
|
Hi Wolfgang, Thank you for looking at XSLTForms transformation on server side. I will have to test these two small fixes on my own configuration before committing them. By the way, testing with Dan McCreary, it appears that this option is also required for XSLTForms : declare option exist:serialize "indent=no"; to prevent the serializer to indent the result of the transformation. Thanks! -Alain Wolfgang a écrit : > Hi Alain, > > I was looking into how to apply the xsltforms stylesheet on the server > instead of the client. I needed to make 2 small fixes to the > xsltforms.xsl stylesheet to get it to work properly: > > 1) two lines in the generated javascript assume that the xsltforms.js > code has already been loaded: > > Core.fileName='xsltforms.js'; > > Dialog.show('statusPanel'); > > The assumption works sometimes, but mostly doesn't and causes the > entire script to fail. Just moving the two statements *inside* the > init() function fixes the issue for me. > > 2) location of xsltforms.js and xsltforms.css: the stylesheet > determines the basedir for loading those resources by looking at the > processing instruction. However, if the stylesheet is applied by a > script on the server, there won't be processing instruction. I thus > introduced a stylesheet parameter: > > <xsl:param name="baseuri"/> > > which is then checked to determine $resourcesdir: > > <xsl:variable name="resourcesdir"> > <xsl:choose> > <xsl:when test="$baseuri != ''"> > <xsl:value-of select="$baseuri"/> > </xsl:when> > <xsl:otherwise> > <xsl:value-of select="substring-before($href, > 'xsltforms.xsl')"/> > </xsl:otherwise> > </xsl:choose> > </xsl:variable> > > Wolfgang > |
From: Wolfgang <wol...@ex...> - 2009-09-30 13:22:55
|
Hi Alain, I was looking into how to apply the xsltforms stylesheet on the server instead of the client. I needed to make 2 small fixes to the xsltforms.xsl stylesheet to get it to work properly: 1) two lines in the generated javascript assume that the xsltforms.js code has already been loaded: Core.fileName='xsltforms.js'; Dialog.show('statusPanel'); The assumption works sometimes, but mostly doesn't and causes the entire script to fail. Just moving the two statements *inside* the init() function fixes the issue for me. 2) location of xsltforms.js and xsltforms.css: the stylesheet determines the basedir for loading those resources by looking at the processing instruction. However, if the stylesheet is applied by a script on the server, there won't be processing instruction. I thus introduced a stylesheet parameter: <xsl:param name="baseuri"/> which is then checked to determine $resourcesdir: <xsl:variable name="resourcesdir"> <xsl:choose> <xsl:when test="$baseuri != ''"> <xsl:value-of select="$baseuri"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="substring-before($href, 'xsltforms.xsl')"/> </xsl:otherwise> </xsl:choose> </xsl:variable> Wolfgang |
From: COUTHURES A. <ala...@ag...> - 2009-09-29 20:24:36
|
-------- Message original -------- Sujet : Getting XSLTForms to work with dynamic XForms Date : Tue, 29 Sep 2009 14:40:44 -0500 De : Dan McCreary <dan...@gm...> Répondre à : da...@da... Pour : exi...@li... Copie à : COUTHURES Alain <ala...@ag...> With very patient help from Alain Courthures I believe we have figured out a way to get XSLTForms to work when the forms are generated by an XQuery. The key is to add the following to any XQueries that dynamically generate XForms using the XSLTForms client-side libraries declare option exist:serialize "process-xsl-pi=no"; This prevents the XSL PI from executing on the server side and lets the browser do the right thing. xquery version "1.0"; declare option exist:serialize "method=xhtml media-type=application/xhtml process-xsl-pi=no"; ( <?xml-stylesheet href="http://support.syntactica.com:8080/exist/xsltforms/xsltforms.xsl" type="text/xsl"?>, <html> XForms code here... </html> ) Once again a hardy thanks to Alain! - Dan |
From: Wolfgang M. <wol...@ex...> - 2009-09-29 20:17:08
|
Hi, > I think I would like to rely on XSLTForms + eXist. What do you think about storing my files within eXist? > > Do you see a solution? As I already wrote on the eXist ML, applying the stylesheet server-side does not work right now. This seems to be just a browser issue, caused by a wrong content type in the HTTP response header. This should be easy to fix on the eXist side, but I didn't have time yet, sorry. You thus need to make sure that the stylesheet is applied on the client (the browser). A few moments ago, Dan posted a workaround which makes XSLTForms work with stored XQueries. Please check the eXist ML. Wolfgang |
From: claudius t. <cla...@ya...> - 2009-09-29 20:09:18
|
I think I would like to rely on XSLTForms + eXist. What do you think about storing my files within eXist? Do you see a solution? Claudius |
From: Stephen C. <Ste...@ut...> - 2009-09-27 13:01:45
|
oops, ignore last email, should be as follows "dateTime" : { "patterns" : [ "^([12][0-9]{3})-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\\.[0-9]+)?(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])?$" ], "class" : "datetime", "displayLength" : 20, "format" : function(value) { //SC return I8N.format(I8N.parse(value, "yyyy-MM-ddThh:mm:ss")); return I8N.format(I8N.parse(value, "yyyy-MM-ddThh:mm:ss"),null,true); }, "parse" : function(value) { //SC return I8N.format(I8N.parse(value), "yyyy-MM-ddThh:mm:ss"); return I8N.format(I8N.parse(value), "yyyy-MM-ddThh:mm:ss", true); } }, -------- Original Message -------- Subject: correction to previous datetime change suggestions Date: Sun, 27 Sep 2009 22:54:04 +1000 From: Stephen Cameron <ste...@ut...> To: xsl...@li... My previous changes (see below) broke the datetime validation. The following single change seem to do the trick though. "dateTime" : { "patterns" : [ "^([12][0-9]{3})-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\\.[0-9]+)?(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])?$" ], "class" : "datetime", "displayLength" : 20, "format" : function(value) { //SC return I8N.format(I8N.parse(value, "yyyy-MM-ddThh:mm:ss")); return I8N.format(I8N.parse(value, "yyyy-MM-ddThh:mm:ss"),null,true); }, "parse" : function(value) { return I8N.format(I8N.parse(value), "yyyy-MM-ddThh:mm:ss"); } }, -------- Original Message -------- Subject: datetime change suggestions Date: Wed, 23 Sep 2009 20:39:46 +1000 From: Stephen Cameron <ste...@ut...> To: COUTHURES Alain <ala...@ag...>, xsl...@li... Hello Alain, I am back after a couple of weeks holiday. I have been looking at my datetime format problems today and have some change suggestions to make. It seems to be working now for me at least, but I am not sure of the implications of the changes. The changes are in two places but both relate to the use of the I8N.format function. This is as follows unchanged: format : function(date, pattern, loc) { if (!date) { return ""; } if (!pattern) { pattern = I8N.get("format.datetime"); } var str = I8N._format(pattern, date.getDate(), "dd"); str = I8N._format(str, (loc ? date.getMonth() : date.getUTCMonth()) + 1, "MM"); y = (loc ? date.getFullYear() : date.getUTCFullYear()); str = I8N._format(str, y < 1000? 1900 + y : y, "yyyy"); str = I8N._format(str, (loc ? date.getSeconds() : date.getUTCSeconds()), "ss"); str = I8N._format(str, (loc ? date.getMinutes() : date.getUTCMinutes()), "mm"); str = I8N._format(str, (loc ? date.getHours() : date.getUTCHours()), "hh"); o = date.getTimezoneOffset(); str = I8N._format(str, (loc ? (o < 0 ? "+" : "-")+zeros(Math.floor(Math.abs(o)/60),2)+":"+zeros(Math.abs(o) % 60,2) : "Z"), "zz"); return str; }, The "loc" parameter should by rights be boolean and determines if the time is local or not, if it is false or null then as you can see the UTC functions get called. In my case this subtracts 10 hours from the date that I entered. There is no adjustment for timezone made, probably as I don't have a timezone (zz) in my date format string. In general I want to the date entered to be considered a local time. Changes are as follows with my initials SC: 1. In the TypeDefs.Default object on about line 4731: "dateTime" : { "patterns" : [ "^([12][0-9]{3})-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\\.[0-9]+)?(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])?$" ], "class" : "datetime", "displayLength" : 20, "format" : function(value) { //SC return I8N.format(I8N.parse(value, "yyyy-MM-ddThh:mm:ss")); return I8N.format(value, null, true); }, "parse" : function(value) { //SC return I8N.format(I8N.parse(value), "yyyy-MM-ddThh:mm:ss"); return I8N.parse(value); } }, These force the datetime pattern to be taken from the messages.properties file and for the time to be considered local. 2. In the Calendar 'handler' function starting on about line 4042: if (cal.isTimestamp) { //SC added next line, not sure why it should be missing?? date.setSeconds(cal.inputSec.value); date.setMinutes(cal.inputMin.value); date.setHours(cal.inputHour.value); //SC cal.input.value = I8N.format(date); cal.input.value = I8N.format(date,null,true); } else { cal.input.value = I8N.formatDate(date); } I've not checked changed any of the date parse/format functions but these need checking as well. Maybe I have missed some essential point and these changes aren't needed (but probably not). Cheers Steve Cameron -- 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 -- 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 -- 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...> - 2009-09-27 12:54:08
|
My previous changes (see below) broke the datetime validation. The following single change seem to do the trick though. "dateTime" : { "patterns" : [ "^([12][0-9]{3})-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\\.[0-9]+)?(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])?$" ], "class" : "datetime", "displayLength" : 20, "format" : function(value) { //SC return I8N.format(I8N.parse(value, "yyyy-MM-ddThh:mm:ss")); return I8N.format(I8N.parse(value, "yyyy-MM-ddThh:mm:ss"),null,true); }, "parse" : function(value) { return I8N.format(I8N.parse(value), "yyyy-MM-ddThh:mm:ss"); } }, -------- Original Message -------- Subject: datetime change suggestions Date: Wed, 23 Sep 2009 20:39:46 +1000 From: Stephen Cameron <ste...@ut...> To: COUTHURES Alain <ala...@ag...>, xsl...@li... Hello Alain, I am back after a couple of weeks holiday. I have been looking at my datetime format problems today and have some change suggestions to make. It seems to be working now for me at least, but I am not sure of the implications of the changes. The changes are in two places but both relate to the use of the I8N.format function. This is as follows unchanged: format : function(date, pattern, loc) { if (!date) { return ""; } if (!pattern) { pattern = I8N.get("format.datetime"); } var str = I8N._format(pattern, date.getDate(), "dd"); str = I8N._format(str, (loc ? date.getMonth() : date.getUTCMonth()) + 1, "MM"); y = (loc ? date.getFullYear() : date.getUTCFullYear()); str = I8N._format(str, y < 1000? 1900 + y : y, "yyyy"); str = I8N._format(str, (loc ? date.getSeconds() : date.getUTCSeconds()), "ss"); str = I8N._format(str, (loc ? date.getMinutes() : date.getUTCMinutes()), "mm"); str = I8N._format(str, (loc ? date.getHours() : date.getUTCHours()), "hh"); o = date.getTimezoneOffset(); str = I8N._format(str, (loc ? (o < 0 ? "+" : "-")+zeros(Math.floor(Math.abs(o)/60),2)+":"+zeros(Math.abs(o) % 60,2) : "Z"), "zz"); return str; }, The "loc" parameter should by rights be boolean and determines if the time is local or not, if it is false or null then as you can see the UTC functions get called. In my case this subtracts 10 hours from the date that I entered. There is no adjustment for timezone made, probably as I don't have a timezone (zz) in my date format string. In general I want to the date entered to be considered a local time. Changes are as follows with my initials SC: 1. In the TypeDefs.Default object on about line 4731: "dateTime" : { "patterns" : [ "^([12][0-9]{3})-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\\.[0-9]+)?(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])?$" ], "class" : "datetime", "displayLength" : 20, "format" : function(value) { //SC return I8N.format(I8N.parse(value, "yyyy-MM-ddThh:mm:ss")); return I8N.format(value, null, true); }, "parse" : function(value) { //SC return I8N.format(I8N.parse(value), "yyyy-MM-ddThh:mm:ss"); return I8N.parse(value); } }, These force the datetime pattern to be taken from the messages.properties file and for the time to be considered local. 2. In the Calendar 'handler' function starting on about line 4042: if (cal.isTimestamp) { //SC added next line, not sure why it should be missing?? date.setSeconds(cal.inputSec.value); date.setMinutes(cal.inputMin.value); date.setHours(cal.inputHour.value); //SC cal.input.value = I8N.format(date); cal.input.value = I8N.format(date,null,true); } else { cal.input.value = I8N.formatDate(date); } I've not checked changed any of the date parse/format functions but these need checking as well. Maybe I have missed some essential point and these changes aren't needed (but probably not). Cheers Steve Cameron -- 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 -- 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...> - 2009-09-23 11:56:54
|
Hi Mark, Javascript interacting with XSLTForms is an important feature and I always try to be compatible with the Mozilla XForms extension. As you already know, the corresponding methods are not yet present in XSLTForms. Could you please list me the methods/attributes you need ? Are you in a hurry about them ? Cheers, -Alain Mark Seaborne a écrit : > Hi Alain, > > So, now you have the getInstanceDocument method, how can I modify an > instance in Javascript? > > I have been using the Firefox plug-in's Javascript integration to > replace nodesets within instances, as well as to set text values. > > My motivation for using Javascript to interact with XForms is that I a > m using an OpenLayers map to allow users interact with instance data. > > All the best > > Mark > |
From: Mark S. <m_s...@ma...> - 2009-09-23 11:40:51
|
Hi Alain, So, now you have the getInstanceDocument method, how can I modify an instance in Javascript? I have been using the Firefox plug-in's Javascript integration to replace nodesets within instances, as well as to set text values. My motivation for using Javascript to interact with XForms is that I a m using an OpenLayers map to allow users interact with instance data. All the best Mark On 22 Sep 2009, at 21:26, COUTHURES Alain wrote: > Hi Mark, >> I have just been experimenting with XSLTForms as distributed as >> part of the latest eXist build. Can you tell me if there is any >> support, or plan to support getInstanceDocument, or any >> alternative mechanism for providing access to XForms instance >> documents and Javascript? >> > Because of your question about getInstanceDocument support, I > decided to have a closer look at W3C XForms Test #4.8.1.a which is > non-normative : > > <?xml version="1.0" encoding="ISO-8859-1"?> > <xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml" > xmlns:ev="http://www.w3.org/2001/xml-events" > xmlns:xforms="http://www.w3.org/2002/xforms"> > <xhtml:head> > <xhtml:title>4.8.1.a getInstanceDocument() method (non- > normative)</xhtml:title> > <xhtml:link rel="stylesheet" href="../../../driverPages/forms/ > TestSuite11.css" type="text/css"/> > <xforms:model id="my_model1"> > <xforms:instance id="my_data1"> > <car> > <color>blue</color> > </car> > </xforms:instance> > </xforms:model> > </xhtml:head> > <xhtml:body> > <xforms:group> > <xforms:label class="title">4.8.1.a getInstanceDocument() > method (non-normative)</xforms:label> > </xforms:group> > <xforms:group> > <xforms:label> > This test case uses Javascript to execute the > getInstanceDocument() method. > You may have seen a message box with the value > "blue". > </xforms:label> > </xforms:group> > <xhtml:script type="text/javascript"> > var model = document.getElementById('my_model1'); > var inst1 = model.getInstanceDocument('my_data1'); > var my_color = inst1.getElementsByTagName('color')[0]; > alert(my_color.textContent); > </xhtml:script> > </xhtml:body> > </xhtml:html> > > Yes, it was already possible to manipulate instances managed by > XSLTForms directly with Javascript instructions but there were no > well-known function for that. So, I added, in the very latest SVN > version, the ones mentioned in this test (textContent attribute > having to be replaced by getTextContent()). I had to postpone the > specific Javascript calls so they are executed after the generated > init() function which is called from body onload. This is the > modified working test : > > <?xml version="1.0" encoding="ISO-8859-1"?> > <xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml" > xmlns:ev="http://www.w3.org/2001/xml-events" > xmlns:xforms="http://www.w3.org/2002/xforms"> > <xhtml:head> > <xhtml:title>4.8.1.a getInstanceDocument() method (non- > normative)</xhtml:title> > <xhtml:link rel="stylesheet" href="../../../driverPages/forms/ > TestSuite11.css" type="text/css"/> > <xforms:model id="my_model1"> > <xforms:instance id="my_data1"> > <car> > <color>blue</color> > </car> > </xforms:instance> > </xforms:model> > </xhtml:head> > <xhtml:body onload="f();"> > <xforms:group> > <xforms:label class="title">4.8.1.a getInstanceDocument() > method (non-normative)</xforms:label> > </xforms:group> > <xforms:group> > <xforms:label> > This test case uses Javascript to execute the > getInstanceDocument() method. > You may have seen a message box with the value > "blue". > </xforms:label> > </xforms:group> > <xhtml:script type="text/javascript"> > function f() { > var model = document.getElementById('my_model1'); > var inst1 = model.getInstanceDocument('my_data1'); > var my_color = inst1.getElementsByTagName('color')[0]; > alert(my_color.getTextContent()); > } > </xhtml:script> > </xhtml:body> > </xhtml:html> > > This is, for sure, just the minimal set of methods required for this > test but I needed less than two hours to add them... ;-) > > XSLTForms is easy to extend ! :-) > > Best regards, > > -Alain > > |
From: Stephen C. <Ste...@ut...> - 2009-09-23 10:40:16
|
Hello Alain, I am back after a couple of weeks holiday. I have been looking at my datetime format problems today and have some change suggestions to make. It seems to be working now for me at least, but I am not sure of the implications of the changes. The changes are in two places but both relate to the use of the I8N.format function. This is as follows unchanged: format : function(date, pattern, loc) { if (!date) { return ""; } if (!pattern) { pattern = I8N.get("format.datetime"); } var str = I8N._format(pattern, date.getDate(), "dd"); str = I8N._format(str, (loc ? date.getMonth() : date.getUTCMonth()) + 1, "MM"); y = (loc ? date.getFullYear() : date.getUTCFullYear()); str = I8N._format(str, y < 1000? 1900 + y : y, "yyyy"); str = I8N._format(str, (loc ? date.getSeconds() : date.getUTCSeconds()), "ss"); str = I8N._format(str, (loc ? date.getMinutes() : date.getUTCMinutes()), "mm"); str = I8N._format(str, (loc ? date.getHours() : date.getUTCHours()), "hh"); o = date.getTimezoneOffset(); str = I8N._format(str, (loc ? (o < 0 ? "+" : "-")+zeros(Math.floor(Math.abs(o)/60),2)+":"+zeros(Math.abs(o) % 60,2) : "Z"), "zz"); return str; }, The "loc" parameter should by rights be boolean and determines if the time is local or not, if it is false or null then as you can see the UTC functions get called. In my case this subtracts 10 hours from the date that I entered. There is no adjustment for timezone made, probably as I don't have a timezone (zz) in my date format string. In general I want to the date entered to be considered a local time. Changes are as follows with my initials SC: 1. In the TypeDefs.Default object on about line 4731: "dateTime" : { "patterns" : [ "^([12][0-9]{3})-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\\.[0-9]+)?(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])?$" ], "class" : "datetime", "displayLength" : 20, "format" : function(value) { //SC return I8N.format(I8N.parse(value, "yyyy-MM-ddThh:mm:ss")); return I8N.format(value, null, true); }, "parse" : function(value) { //SC return I8N.format(I8N.parse(value), "yyyy-MM-ddThh:mm:ss"); return I8N.parse(value); } }, These force the datetime pattern to be taken from the messages.properties file and for the time to be considered local. 2. In the Calendar 'handler' function starting on about line 4042: if (cal.isTimestamp) { //SC added next line, not sure why it should be missing?? date.setSeconds(cal.inputSec.value); date.setMinutes(cal.inputMin.value); date.setHours(cal.inputHour.value); //SC cal.input.value = I8N.format(date); cal.input.value = I8N.format(date,null,true); } else { cal.input.value = I8N.formatDate(date); } I've not checked changed any of the date parse/format functions but these need checking as well. Maybe I have missed some essential point and these changes aren't needed (but probably not). Cheers Steve Cameron -- 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 |