xsltforms-support Mailing List for XSLTForms (Page 58)
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: Conal C. T. <con...@ve...> - 2011-07-22 13:08:13
|
Hi Philip It would be nice if XSLTForms had a complete implementation of XForms 1.1, and if I could use the xf:header feature it would solve my problem, but I think for a 1.0 implementation it does still make sense not to accept a content-type of "text/html" or "*/*" or in general anything other than XML. Unless XSLTForms provides an explicit Accept header when loading an instance, it may accidentally pass on the browser's default Accept header, and for resources which support content negotiation, that not ideal. On the theoretical point; I think it's an interesting point, but personally do tend to think that an XForm editor for a resource is a perfectly good "representation" of that resource. I don't really see that it's relevant whether the XHTML+XForms document includes an editable XML instance by inclusion or by URI reference. I see it as analogous to a situation where you might get a representation of an image using an Accept header of "image/*" and retrieve e.g. a PNG file, or get a representation with Accept: text/html and retrieve a web page containing a reference to that same PNG representation. I agree that from a theoretical point of view the HTML XForm should not be seen as an HTML representation of an "XML resource". In the web architecture the "resource" itself is something abstract (it's information about a person or information, in this case), and the XML instance is just a representation of that resource. The XForm is also a representation of that same abstract information resource: it's a two-tiered representation in that it transcludes another representation (a RIF-CS XML record), but that pattern is not unusual on the web, actually. I'm keen to continue discussing the web-architecture aspect of this, though ... I wonder if the new xforms-users list is a more appropriate form, since it's not really specific to XSLTForms. Regards Con ________________________________________ From: Philip Fennell [Phi...@ma...] Sent: Friday, 22 July 2011 7:12 PM To: Conal Christopher Tuohy; xsl...@li... Subject: RE: [Xsltforms-support] Content negotiation problem: HTTP "Accept" header specifies non-XML content types Conal, Firstly, to my knowledge, the xf:submission element's xf:header element is not currently supported by XSLTForms. This would be the way to specify the Accept header for your requests, but, more importantly, there is a refinement to the use of the xf:header element that affects how they are set by the client. The 'combine' attribute is created to deal with the situation where you want to either add or override the existing header sent by the client. In your case, you would have to use combine="replace" to ensure only the requested content-type is sent. The other options are 'append' and 'prepend' so that you can define how your value is added to an existing header. Secondly, and I know this might sound a bit nit-picky but, from the way I tend to look at things, I would regard an XForm application and the instance data it loads as two separate resources. The XForm is not an HTML representation of the XML instance data resource it loads. Also, for XSLTForms, the response has to be application/xml in order that the browser will act upon the xml-stylesheet processing instruction. Now, the server is not bound to honour the request's Accept header, it can give either the best it can or say 'Not Acceptable' so just because it asks for HTML doesn't mean it will receive it. A document, transformed into an HTML Form, that contains the data from the document might be regarded as a text/html representation of that data, but I'm not convinced that you can argue the same for an XForm document that references the document. I think there is potential ambiguity in the design that you are using which could lead people to say that it is not truly RESTful. Some people suggest using a type attribute on the Accept header value to extend its meaning. For example, an Atom Feed has a content type of application/atom+xml where as a single Atom Entry is application/atom+xml;type=entry Maybe, you could use a content type of application/xml;type=edit. This might be a more flexible solution as it would still give you the possibility of requesting an HTML representation that wasn't editable. I'd be interested in your thoughts on this as it is potentially a common problem with developing for XForms. Regards Philip -----Original Message----- From: Conal Tuohy [mailto:con...@ve...] Sent: Friday, July 22, 2011 7:08 AM To: xsl...@li... Subject: [Xsltforms-support] Content negotiation problem: HTTP "Accept" header specifies non-XML content types I have been using XSLTForms recently, for editing XML metadata records. In our project, we have a RESTful web service (based on a Fedora repository) which uses HTTP Content Negotiation to publish different representations of a resource (i.e. using the same HTTP URL, but in response to different HTTP Accept headers). Each resource may be represented as an XML metadata record or as an XForm, depending on the content-type requested. If a browser sends a request for an HTML page, we want to return an XForm embedded in HTML, but if the browser doesn't want HTML, then we send the "raw" XML record. If the browser accepts HTML, then it receives an XForm, and the XForm itself then issues a request (to the same URL!) to retrieve the XML instance. The problem is that XSLTForms doesn't specify an HTTP Accept header, and the browser (Firefox 5 for example) sends its default Accept header, which includes "text/html", etc. Hence the instance document retrieved is not the "raw" XML representation, but rather an XForm (i.e. the XForm has loaded itself as a model instance!) I think it's a bug for XSLTForms to say that it accepts "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" (which is the default Accept header in Firefox). It seems sensible to me to set an Accept header listing "text/xml" and "application/xml", so that XSLTForms can be used with services such as ours, which use content negotiation. I found I could fix the problem by explicitly setting the Accept header in xsltforms.js, in two places (there is a case for Internet Explorer and a case for other browsers). See below: > if (window.XMLHttpRequest) { > Core.openRequest = function(method, uri, async) { > // > netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead"); > var req = new XMLHttpRequest(); > try { > req.open(method, Core.constructURI(uri), async); > } catch (e) { > try { > req = new > ActiveXObject("Msxml2.XMLHTTP.3.0"); > } catch (e) { > try { > req = new > ActiveXObject("Msxml2.XMLHTTP"); > } catch (e) { > throw new Error("This > browser does not support XHRs(Ajax)! \n Cause: " + (e.message || > e.description || e) + " \n Enable Javascript or ActiveX controls (on > IE) or lower security restrictions."); > } > } > req.open(method, Core.constructURI(uri), async); > } > // Added by con...@ve... so xsltforms > doesn't accept "text/html" (so that HTTP content negotiation can be used) > req.setRequestHeader("Accept", > "text/xml;q=0.5,application/xml;q=0.6,application/xhtml+xml;q=0.4"); > if (Core.isMozilla) { > req.overrideMimeType("text/xml"); > } > return req; > }; > } else if (window.ActiveXObject) { > Core.openRequest = function(method, uri, async) { > try { > req = new ActiveXObject("Msxml2.XMLHTTP.3.0"); > } catch (e) { > try { > req = new ActiveXObject("Msxml2.XMLHTTP"); > } catch (e) { > throw new Error("This browser does not > support XHRs(Ajax)! \n Cause: " + (e.message || e.description || e) + > " \n Enable Javascript or ActiveX controls (on IE) or lower security > restrictions."); > } > } > req.open(method, Core.constructURI(uri), async); > // Added by con...@ve... so xsltforms > doesn't accept "text/html" (so that HTTP content negotiation can be used) > req.setRequestHeader("Accept", > "text/xml;q=0.5,application/xml;q=0.6,application/xhtml+xml;q=0.4"); > return req; > }; > } else { > throw new Error("This browser does not support XHRs(Ajax)! \n > Enable Javascript or ActiveX controls (on IE) or lower security > restrictions."); > } -- Conal Tuohy eResearch Business Analyst Victorian eResearch Strategic Initiative +61-466324297 ------------------------------------------------------------------------------ 10 Tips for Better Web Security Learn 10 ways to better secure your business today. Topics covered include: Web security, SSL, hacker attacks & Denial of Service (DoS), private keys, security Microsoft Exchange, secure Instant Messaging, and much more. http://www.accelacomm.com/jaw/sfnl/114/51426210/ _______________________________________________ Xsltforms-support mailing list Xsl...@li... https://lists.sourceforge.net/lists/listinfo/xsltforms-support |
From: Philip F. <Phi...@ma...> - 2011-07-22 09:12:19
|
Conal, Firstly, to my knowledge, the xf:submission element's xf:header element is not currently supported by XSLTForms. This would be the way to specify the Accept header for your requests, but, more importantly, there is a refinement to the use of the xf:header element that affects how they are set by the client. The 'combine' attribute is created to deal with the situation where you want to either add or override the existing header sent by the client. In your case, you would have to use combine="replace" to ensure only the requested content-type is sent. The other options are 'append' and 'prepend' so that you can define how your value is added to an existing header. Secondly, and I know this might sound a bit nit-picky but, from the way I tend to look at things, I would regard an XForm application and the instance data it loads as two separate resources. The XForm is not an HTML representation of the XML instance data resource it loads. Also, for XSLTForms, the response has to be application/xml in order that the browser will act upon the xml-stylesheet processing instruction. Now, the server is not bound to honour the request's Accept header, it can give either the best it can or say 'Not Acceptable' so just because it asks for HTML doesn't mean it will receive it. A document, transformed into an HTML Form, that contains the data from the document might be regarded as a text/html representation of that data, but I'm not convinced that you can argue the same for an XForm document that references the document. I think there is potential ambiguity in the design that you are using which could lead people to say that it is not truly RESTful. Some people suggest using a type attribute on the Accept header value to extend its meaning. For example, an Atom Feed has a content type of application/atom+xml where as a single Atom Entry is application/atom+xml;type=entry Maybe, you could use a content type of application/xml;type=edit. This might be a more flexible solution as it would still give you the possibility of requesting an HTML representation that wasn't editable. I'd be interested in your thoughts on this as it is potentially a common problem with developing for XForms. Regards Philip -----Original Message----- From: Conal Tuohy [mailto:con...@ve...] Sent: Friday, July 22, 2011 7:08 AM To: xsl...@li... Subject: [Xsltforms-support] Content negotiation problem: HTTP "Accept" header specifies non-XML content types I have been using XSLTForms recently, for editing XML metadata records. In our project, we have a RESTful web service (based on a Fedora repository) which uses HTTP Content Negotiation to publish different representations of a resource (i.e. using the same HTTP URL, but in response to different HTTP Accept headers). Each resource may be represented as an XML metadata record or as an XForm, depending on the content-type requested. If a browser sends a request for an HTML page, we want to return an XForm embedded in HTML, but if the browser doesn't want HTML, then we send the "raw" XML record. If the browser accepts HTML, then it receives an XForm, and the XForm itself then issues a request (to the same URL!) to retrieve the XML instance. The problem is that XSLTForms doesn't specify an HTTP Accept header, and the browser (Firefox 5 for example) sends its default Accept header, which includes "text/html", etc. Hence the instance document retrieved is not the "raw" XML representation, but rather an XForm (i.e. the XForm has loaded itself as a model instance!) I think it's a bug for XSLTForms to say that it accepts "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" (which is the default Accept header in Firefox). It seems sensible to me to set an Accept header listing "text/xml" and "application/xml", so that XSLTForms can be used with services such as ours, which use content negotiation. I found I could fix the problem by explicitly setting the Accept header in xsltforms.js, in two places (there is a case for Internet Explorer and a case for other browsers). See below: > if (window.XMLHttpRequest) { > Core.openRequest = function(method, uri, async) { > // > netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead"); > var req = new XMLHttpRequest(); > try { > req.open(method, Core.constructURI(uri), async); > } catch (e) { > try { > req = new > ActiveXObject("Msxml2.XMLHTTP.3.0"); > } catch (e) { > try { > req = new > ActiveXObject("Msxml2.XMLHTTP"); > } catch (e) { > throw new Error("This > browser does not support XHRs(Ajax)! \n Cause: " + (e.message || > e.description || e) + " \n Enable Javascript or ActiveX controls (on > IE) or lower security restrictions."); > } > } > req.open(method, Core.constructURI(uri), async); > } > // Added by con...@ve... so xsltforms > doesn't accept "text/html" (so that HTTP content negotiation can be used) > req.setRequestHeader("Accept", > "text/xml;q=0.5,application/xml;q=0.6,application/xhtml+xml;q=0.4"); > if (Core.isMozilla) { > req.overrideMimeType("text/xml"); > } > return req; > }; > } else if (window.ActiveXObject) { > Core.openRequest = function(method, uri, async) { > try { > req = new ActiveXObject("Msxml2.XMLHTTP.3.0"); > } catch (e) { > try { > req = new ActiveXObject("Msxml2.XMLHTTP"); > } catch (e) { > throw new Error("This browser does not > support XHRs(Ajax)! \n Cause: " + (e.message || e.description || e) + > " \n Enable Javascript or ActiveX controls (on IE) or lower security > restrictions."); > } > } > req.open(method, Core.constructURI(uri), async); > // Added by con...@ve... so xsltforms > doesn't accept "text/html" (so that HTTP content negotiation can be used) > req.setRequestHeader("Accept", > "text/xml;q=0.5,application/xml;q=0.6,application/xhtml+xml;q=0.4"); > return req; > }; > } else { > throw new Error("This browser does not support XHRs(Ajax)! \n > Enable Javascript or ActiveX controls (on IE) or lower security > restrictions."); > } -- Conal Tuohy eResearch Business Analyst Victorian eResearch Strategic Initiative +61-466324297 ------------------------------------------------------------------------------ 10 Tips for Better Web Security Learn 10 ways to better secure your business today. Topics covered include: Web security, SSL, hacker attacks & Denial of Service (DoS), private keys, security Microsoft Exchange, secure Instant Messaging, and much more. http://www.accelacomm.com/jaw/sfnl/114/51426210/ _______________________________________________ Xsltforms-support mailing list Xsl...@li... https://lists.sourceforge.net/lists/listinfo/xsltforms-support |
From: Conal T. <con...@ve...> - 2011-07-22 06:07:53
|
I have been using XSLTForms recently, for editing XML metadata records. In our project, we have a RESTful web service (based on a Fedora repository) which uses HTTP Content Negotiation to publish different representations of a resource (i.e. using the same HTTP URL, but in response to different HTTP Accept headers). Each resource may be represented as an XML metadata record or as an XForm, depending on the content-type requested. If a browser sends a request for an HTML page, we want to return an XForm embedded in HTML, but if the browser doesn't want HTML, then we send the "raw" XML record. If the browser accepts HTML, then it receives an XForm, and the XForm itself then issues a request (to the same URL!) to retrieve the XML instance. The problem is that XSLTForms doesn't specify an HTTP Accept header, and the browser (Firefox 5 for example) sends its default Accept header, which includes "text/html", etc. Hence the instance document retrieved is not the "raw" XML representation, but rather an XForm (i.e. the XForm has loaded itself as a model instance!) I think it's a bug for XSLTForms to say that it accepts "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" (which is the default Accept header in Firefox). It seems sensible to me to set an Accept header listing "text/xml" and "application/xml", so that XSLTForms can be used with services such as ours, which use content negotiation. I found I could fix the problem by explicitly setting the Accept header in xsltforms.js, in two places (there is a case for Internet Explorer and a case for other browsers). See below: > if (window.XMLHttpRequest) { > Core.openRequest = function(method, uri, async) { > // > netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead"); > var req = new XMLHttpRequest(); > try { > req.open(method, Core.constructURI(uri), async); > } catch (e) { > try { > req = new > ActiveXObject("Msxml2.XMLHTTP.3.0"); > } catch (e) { > try { > req = new > ActiveXObject("Msxml2.XMLHTTP"); > } catch (e) { > throw new Error("This > browser does not support XHRs(Ajax)! \n Cause: " + (e.message || > e.description || e) + " \n Enable Javascript or ActiveX controls (on > IE) or lower security restrictions."); > } > } > req.open(method, Core.constructURI(uri), async); > } > // Added by con...@ve... so xsltforms > doesn't accept "text/html" (so that HTTP content negotiation can be used) > req.setRequestHeader("Accept", > "text/xml;q=0.5,application/xml;q=0.6,application/xhtml+xml;q=0.4"); > if (Core.isMozilla) { > req.overrideMimeType("text/xml"); > } > return req; > }; > } else if (window.ActiveXObject) { > Core.openRequest = function(method, uri, async) { > try { > req = new ActiveXObject("Msxml2.XMLHTTP.3.0"); > } catch (e) { > try { > req = new ActiveXObject("Msxml2.XMLHTTP"); > } catch (e) { > throw new Error("This browser does not > support XHRs(Ajax)! \n Cause: " + (e.message || e.description || e) + > " \n Enable Javascript or ActiveX controls (on IE) or lower security > restrictions."); > } > } > req.open(method, Core.constructURI(uri), async); > // Added by con...@ve... so xsltforms > doesn't accept "text/html" (so that HTTP content negotiation can be used) > req.setRequestHeader("Accept", > "text/xml;q=0.5,application/xml;q=0.6,application/xhtml+xml;q=0.4"); > return req; > }; > } else { > throw new Error("This browser does not support XHRs(Ajax)! \n > Enable Javascript or ActiveX controls (on IE) or lower security > restrictions."); > } -- Conal Tuohy eResearch Business Analyst Victorian eResearch Strategic Initiative +61-466324297 |
From: Alain C. <ala...@ag...> - 2011-07-21 19:02:53
|
Hi Steve, > I've discovered that when dates are typed manually into an input then > it is possible to enter invalid dates which the code converts to other > valid values. For example, the number '3' becomes 03/03/2003 and > '32/01/2011' becomes 01/02/2011. The problem seems to lie in the > method I8N. parse which is too tolerant! > Yes, I know this method for being perfectible, it is now just based on Javascript Date class. Contributions are welcome ;-) -Alain |
From: Steve B. <ste...@co...> - 2011-07-21 16:20:24
|
Hi I've discovered that when dates are typed manually into an input then it is possible to enter invalid dates which the code converts to other valid values. For example, the number '3' becomes 03/03/2003 and '32/01/2011' becomes 01/02/2011. The problem seems to lie in the method I8N. parse which is too tolerant! Regards Steve Steve Brown Senior Developer Corelogic Limited www.corelogic.co.uk Tel: 01550 740655 Email: ste...@co... <mailto:ste...@bt...> |
From: Alain C. <ala...@ag...> - 2011-07-20 18:53:12
|
Hello William, It is very important to add xmlns="" at your instances because latest releases of FireFox are capitalizing attribute names when in the xhtml namespace. I clearly see a difference with this and it seems OK for me now. Can you please confirm? Thanks! -Alain Le 20/07/2011 15:32, William Velasquez a écrit : > Hello everybody, > > Below in this message is a simplified example of form for editing a > bug in a bug tracking system based on XForms. > > The idea is having a separate instance (id=states) with the rules of > the bug tracking system indicating which fields should be read-only, > relevant and/or required according to the current state of the bug. > > Is it possible to do this in xsltforms? As you can see with the > example, neither the conditions or even the xforms:output can handle > xpath expressions like this: > instance('states')/State[@id=instance('bug')/State]/@require-commen > > <?xml version="1.0" encoding="UTF-8"?> > <?xml-stylesheet href="xsltforms/xsltforms.xsl" type="text/xsl" ?> > <?xsltforms-options debug="yes" lang="es" ?> > <html xmlns="http://www.w3.org/1999/xhtml" > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > xmlns:xforms="http://www.w3.org/2002/xforms" > xmlns:ev="http://www.w3.org/2001/xml-events"> > <head> > <title>Conditional Relevant and Required Test</title> > <style type="text/css"> > @namespace xforms url("http://www.w3.org/2002/xforms"); > body { font-family: Helvetica;sans-serif;} > label.xforms-label { display:block;} > </style> > <xforms:model id="xmod"> > <xforms:instance id="bug"> > <Bug> > <ID/> > <Date/> > <CurrentState>new</CurrentState> > <Subject/> > <Description/> > <Comment/> > </Bug> > </xforms:instance> > <xforms:instance id="states"> > <States> > <State id="new" can-edit="true" require-comment="false" > show-comment="false"/> > <State id="assigned" can-edit="true" require-comment="false" > show-comment="true"/> > <State id="solved" can-edit="true" require-comment="true" > show-comment="true"/> > <State id="verified" can-edit="true" require-comment="false" > show-comment="true"/> > <State id="tested" can-edit="true" require-comment="false" > show-comment="true"/> > <State id="closed" can-edit="false" require-comment="false" > show-comment="false"/> > </States> > </xforms:instance> > <xforms:bind nodeset="/Bug/Date" type="xsd:date" required="true()"/> > <xforms:bind nodeset="/Bug/State" type="xsd:string" required="true()"/> > <xforms:bind nodeset="/Bug/Subject" type="xsd:string" > readonly="not(instance('states')/State[@id=instance('bug')/State]/@can-edit)"/> > <xforms:bind nodeset="/Bug/Description" type="xsd:string" > readonly="not(instance('states')/State[@id=instance('bug')/State]/@can-edit)" > /> > <xforms:bind nodeset="/Bug/Comment" type="xsd:string" > relevant="instance('states')/State[@id=instance('bug')/State]/@show-comment" > required="instance('states')/State[@id=instance('bug')/State]/@require-comment"/> > </xforms:model> > </head> > <body> > <xforms:group ref="/Bug" model="xmod"> > <xforms:input ref="ID" model="xmod"> > <xforms:label>Bug ID</xforms:label> > </xforms:input> > <xforms:input ref="Date" model="xmod"> > <xforms:label>Bug Date</xforms:label> > </xforms:input> > <xforms:select1 ref="CurrentState" model="xmod"> > <xforms:label>State</xforms:label> > <xforms:itemset model="xmod" nodeset="instance('states')/State"> > <xforms:label ref="@id"/> > <xforms:value ref="@id"/> > </xforms:itemset> > </xforms:select1> > <xforms:input ref="Subject" model="xmod"> > <xforms:label>Subject</xforms:label> > </xforms:input> > <xforms:textarea ref="Description" model="xmod"> > <xforms:label>Bug Description</xforms:label> > </xforms:textarea> > <xforms:textarea ref="Comment" model="xmod"> > <xforms:label>Comments</xforms:label> > </xforms:textarea> > </xforms:group> > <xforms:group ref="" model="xmod"> > <xforms:label>Rules for this State</xforms:label> > <xforms:output ref="instance('bug')/CurrentState" model="xmod"> > <xforms:label>Current State</xforms:label> > </xforms:output> > <xforms:output > ref="instance('states')/State[@id=instance('bug')/CurrentState]/@can-edit" > model="xmod"> > <xforms:label>Can edit Bug</xforms:label> > </xforms:output> > <xforms:output > ref="instance('states')/State[@id=instance('bug')/CurrentState]/@show-comment" > model="xmod"> > <xforms:label>Show comment field</xforms:label> > </xforms:output> > <xforms:output > ref="instance('states')/State[@id=instance('bug')/CurrentState]/@require-comment" > model="xmod"> > <xforms:label>Comment Required</xforms:label> > </xforms:output> > </xforms:group> > </body> > </html> > > > > ------------------------------------------------------------------------------ > 10 Tips for Better Web Security > Learn 10 ways to better secure your business today. Topics covered include: > Web security, SSL, hacker attacks& Denial of Service (DoS), private keys, > security Microsoft Exchange, secure Instant Messaging, and much more. > http://www.accelacomm.com/jaw/sfnl/114/51426210/ > _______________________________________________ > Xsltforms-support mailing list > Xsl...@li... > https://lists.sourceforge.net/lists/listinfo/xsltforms-support > |
From: Alain C. <ala...@ag...> - 2011-07-20 18:46:07
|
Hello Thorsten, I have been testing with XSLTForms r508 on Windows with FireFox 6.0 Beta and Chrome latest release and I didn't see a problem... First, it would be better to add xmlns="" at your instance. Could you please check with a Javascript debugger that you get the following line in the second script element within the head element? new XFInstance("xf-instance-0",xf_model_0,false,"application/xml",null,'<CMD xmlns="http://www.w3.org/1999/xhtml" someattribute="somevalue"><ResourceName>My Tool</ResourceName></CMD>'); or, better, new XFInstance("xf-instance-0",xf_model_0,false,"application/xml",null,'<CMD xmlns="" someattribute="somevalue"><ResourceName>My Tool</ResourceName></CMD>'); Thanks! -Alain Le 20/07/2011 11:23, Thorsten Trippel a écrit : > Hi, > > first of all: XSLTForms is great fun to work with. Thanks for providing it. > > Some extremely awkward behavior can be experienced if my data models > contain attributes: the content of the forms will not show for these > subtrees, nor the input fields. > > I am using XSLTForms Beta 3 r508, tested with Firefox 5.01 and Chrome > 12.0.742.122 on Mac OS X (Snow Leopard), tested with Apache access > (XAMPP) and file access. > > Extremely simplified example (does not work, attribute at CMD element at > the model, output and input will not display): > > <?xml version="1.0" encoding="UTF-8"?> > <?xml-stylesheet href="xsltforms/xsltforms.xsl" type="text/xsl"?> > <?xsltforms-options debug="yes"?> > <html xmlns="http://www.w3.org/1999/xhtml" > xmlns:xs="http://www.w3.org/2001/XMLSchema" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns:xf="http://www.w3.org/2002/xforms" > xmlns:ev="http://www.w3.org/2001/xml-events" > xmlns:xml="http://www.w3.org/XML/1998/namespace"> > <head> > <title>Some title</title> > <xf:model> > <xf:instance> > <CMD someattribute="somevalue"> > <ResourceName>My Tool</ResourceName> > </CMD> > </xf:instance> > </xf:model> > </head> > <body> > <h1>ResourceName:<xf:output > ref="/CMD/ResourceName"></xf:output></h1> > <xf:input ref="/CMD/ResourceName"> > <xf:label>ResourceName</xf:label> > </xf:input> > </body> > </html> > > > Extremely simplified example (Does work, no attribute at CMD element in > the model): > > <?xml version="1.0" encoding="UTF-8"?> > <?xml-stylesheet href="xsltforms/xsltforms.xsl" type="text/xsl"?> > <?xsltforms-options debug="yes"?> > <html xmlns="http://www.w3.org/1999/xhtml" > xmlns:xs="http://www.w3.org/2001/XMLSchema" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns:xf="http://www.w3.org/2002/xforms" > xmlns:ev="http://www.w3.org/2001/xml-events" > xmlns:xml="http://www.w3.org/XML/1998/namespace"> > <head> > <title>Some title</title> > <xf:model> > <xf:instance> > <CMD> > <ResourceName>My Tool</ResourceName> > </CMD> > </xf:instance> > </xf:model> > </head> > <body> > <h1>ResourceName:<xf:output > ref="/CMD/ResourceName"></xf:output></h1> > <xf:input ref="/CMD/ResourceName"> > <xf:label>ResourceName</xf:label> > </xf:input> > </body> > </html> > > This behavior is reproducible, also for "exotic" attributes such as > xml:lang or xmlns="...", etc. As my data model is not fully under my > control (and I certainly cannot get rid of attributes in general) I > wonder if anybody experienced something similar or if there is a way > around that. > > Thorsten > > > ------------------------------------------------------------------------------ > 10 Tips for Better Web Security > Learn 10 ways to better secure your business today. Topics covered include: > Web security, SSL, hacker attacks& Denial of Service (DoS), private keys, > security Microsoft Exchange, secure Instant Messaging, and much more. > http://www.accelacomm.com/jaw/sfnl/114/51426210/ > _______________________________________________ > Xsltforms-support mailing list > Xsl...@li... > https://lists.sourceforge.net/lists/listinfo/xsltforms-support > |
From: William V. <wi...@bi...> - 2011-07-20 13:32:35
|
Hello everybody, Below in this message is a simplified example of form for editing a bug in a bug tracking system based on XForms. The idea is having a separate instance (id=states) with the rules of the bug tracking system indicating which fields should be read-only, relevant and/or required according to the current state of the bug. Is it possible to do this in xsltforms? As you can see with the example, neither the conditions or even the xforms:output can handle xpath expressions like this: instance('states')/State[@id=instance('bug')/State]/@require-commen <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet href="xsltforms/xsltforms.xsl" type="text/xsl" ?> <?xsltforms-options debug="yes" lang="es" ?> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events"> <head> <title>Conditional Relevant and Required Test</title> <style type="text/css"> @namespace xforms url("http://www.w3.org/2002/xforms"); body { font-family: Helvetica;sans-serif;} label.xforms-label { display:block;} </style> <xforms:model id="xmod"> <xforms:instance id="bug"> <Bug> <ID/> <Date/> <CurrentState>new</CurrentState> <Subject/> <Description/> <Comment/> </Bug> </xforms:instance> <xforms:instance id="states"> <States> <State id="new" can-edit="true" require-comment="false" show-comment="false"/> <State id="assigned" can-edit="true" require-comment="false" show-comment="true"/> <State id="solved" can-edit="true" require-comment="true" show-comment="true"/> <State id="verified" can-edit="true" require-comment="false" show-comment="true"/> <State id="tested" can-edit="true" require-comment="false" show-comment="true"/> <State id="closed" can-edit="false" require-comment="false" show-comment="false"/> </States> </xforms:instance> <xforms:bind nodeset="/Bug/Date" type="xsd:date" required="true()"/> <xforms:bind nodeset="/Bug/State" type="xsd:string" required="true()"/> <xforms:bind nodeset="/Bug/Subject" type="xsd:string" readonly="not(instance('states')/State[@id=instance('bug')/State]/@can-edit)"/> <xforms:bind nodeset="/Bug/Description" type="xsd:string" readonly="not(instance('states')/State[@id=instance('bug')/State]/@can-edit)" /> <xforms:bind nodeset="/Bug/Comment" type="xsd:string" relevant="instance('states')/State[@id=instance('bug')/State]/@show-comment" required="instance('states')/State[@id=instance('bug')/State]/@require-comment"/> </xforms:model> </head> <body> <xforms:group ref="/Bug" model="xmod"> <xforms:input ref="ID" model="xmod"> <xforms:label>Bug ID</xforms:label> </xforms:input> <xforms:input ref="Date" model="xmod"> <xforms:label>Bug Date</xforms:label> </xforms:input> <xforms:select1 ref="CurrentState" model="xmod"> <xforms:label>State</xforms:label> <xforms:itemset model="xmod" nodeset="instance('states')/State"> <xforms:label ref="@id"/> <xforms:value ref="@id"/> </xforms:itemset> </xforms:select1> <xforms:input ref="Subject" model="xmod"> <xforms:label>Subject</xforms:label> </xforms:input> <xforms:textarea ref="Description" model="xmod"> <xforms:label>Bug Description</xforms:label> </xforms:textarea> <xforms:textarea ref="Comment" model="xmod"> <xforms:label>Comments</xforms:label> </xforms:textarea> </xforms:group> <xforms:group ref="" model="xmod"> <xforms:label>Rules for this State</xforms:label> <xforms:output ref="instance('bug')/CurrentState" model="xmod"> <xforms:label>Current State</xforms:label> </xforms:output> <xforms:output ref="instance('states')/State[@id=instance('bug')/CurrentState]/@can-edit" model="xmod"> <xforms:label>Can edit Bug</xforms:label> </xforms:output> <xforms:output ref="instance('states')/State[@id=instance('bug')/CurrentState]/@show-comment" model="xmod"> <xforms:label>Show comment field</xforms:label> </xforms:output> <xforms:output ref="instance('states')/State[@id=instance('bug')/CurrentState]/@require-comment" model="xmod"> <xforms:label>Comment Required</xforms:label> </xforms:output> </xforms:group> </body> </html> |
From: Thorsten T. <tho...@un...> - 2011-07-20 09:23:21
|
Hi, first of all: XSLTForms is great fun to work with. Thanks for providing it. Some extremely awkward behavior can be experienced if my data models contain attributes: the content of the forms will not show for these subtrees, nor the input fields. I am using XSLTForms Beta 3 r508, tested with Firefox 5.01 and Chrome 12.0.742.122 on Mac OS X (Snow Leopard), tested with Apache access (XAMPP) and file access. Extremely simplified example (does not work, attribute at CMD element at the model, output and input will not display): <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet href="xsltforms/xsltforms.xsl" type="text/xsl"?> <?xsltforms-options debug="yes"?> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xml="http://www.w3.org/XML/1998/namespace"> <head> <title>Some title</title> <xf:model> <xf:instance> <CMD someattribute="somevalue"> <ResourceName>My Tool</ResourceName> </CMD> </xf:instance> </xf:model> </head> <body> <h1>ResourceName: <xf:output ref="/CMD/ResourceName"></xf:output></h1> <xf:input ref="/CMD/ResourceName"> <xf:label>ResourceName</xf:label> </xf:input> </body> </html> Extremely simplified example (Does work, no attribute at CMD element in the model): <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet href="xsltforms/xsltforms.xsl" type="text/xsl"?> <?xsltforms-options debug="yes"?> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xml="http://www.w3.org/XML/1998/namespace"> <head> <title>Some title</title> <xf:model> <xf:instance> <CMD> <ResourceName>My Tool</ResourceName> </CMD> </xf:instance> </xf:model> </head> <body> <h1>ResourceName: <xf:output ref="/CMD/ResourceName"></xf:output></h1> <xf:input ref="/CMD/ResourceName"> <xf:label>ResourceName</xf:label> </xf:input> </body> </html> This behavior is reproducible, also for "exotic" attributes such as xml:lang or xmlns="...", etc. As my data model is not fully under my control (and I certainly cannot get rid of attributes in general) I wonder if anybody experienced something similar or if there is a way around that. Thorsten |
From: Philip F. <Phi...@ma...> - 2011-07-18 06:12:04
|
William, I can't remember whether I've run into this problem or not but you can work around your problem by using the xforms-ready event to trigger the requests for the other instances: <xf:model> <xf:action ev:event="xforms-ready"> <xf:submit submission="get-tipos_ins"/> <xf:submit submission="get-reglas_ins"/> <xf:action> <xf:submission id="get-tipos_ins" method="get" resource="tipos.xml" instance="tipos_ins" replace="instance" serialization="none" /> <xf:submission id="get-reglas_ins" method="get" resource="reglas_contacto.xml" instance="tipos_ins" replace="instance" serialization="none" /> ... </xf:model> Have a look at the exsltforms extensions: <http://extxsltforms.sourceforge.net/sitKubera/index/index.xml> they include a debugging tool 'the data instances viewer' that allows you to see the contents of instances. It may show that they have loaded but there's some other issue, like namespaces, that's causing your problems. > is possible to use xpath expressions between different models? There is a model attribute that is available on many XForms instructions that allows you to declare the model that will be the context in which an XPath expression is evaluated. Regards Philip Fennell Consultant MarkLogic Corporation Phi...@ma... Phone: +44 (0) 203 402 3619 Mobile: +44 (0) 7824 830 866 www.marklogic.com<http://www.marklogic.com/> This e-mail and any accompanying attachments are confidential. The information is intended solely for the use of the individual to whom it is addressed. Any review, disclosure, copying, distribution, or use of this e-mail communication by others is strictly prohibited. If you are not the intended recipient, please notify us immediately by returning this message to the sender and delete all copies. Thank you for your cooperation. From: William David Velasquez [mailto:wi...@bi...] Sent: Friday, July 15, 2011 6:12 PM To: xsl...@li... Subject: [Xsltforms-support] Multiple external instances in a model Hi, I´m trying to put three instances in the xform model which from external request: <xforms:instance id="ins" src="/siclho/pdserver.dll/doc/new? template=Actividad"/> <xforms:instance id="tipos_ins" src="tipos.xml"/> <xforms:instance id="reglas_ins" src="reglas_contacto.xml"/> But it looks like only the first instance is loaded. If I put every instance in a different model it works, but I have some validations to do between the instances, but this is only possible if the instances belongs to the same model. Can XSLTForms load many instances in a model? Or just one? If the answer is no, is possible to use xpath expressions between different models? Thank you very much. I really love XSLTForms! William David Velasquez Consultor en Tecnología Bitlab Cel 315 488 77 98 |
From: Dan M. <dan...@gm...> - 2011-07-15 22:42:15
|
> Can XSLTForms load many instances in a model? Or just one? Many. I typically load 3-10 instances in a model depending on the complexity of the form. A typical form many have the data to be saved/updated in once instance, the code tables for selection lists in another instance, the a-sync send and response data in other instance pairs etc. You can see examples of this here: http://en.wikibooks.org/wiki/XForms We are very glad you like XSLTForms! - Dan On Fri, Jul 15, 2011 at 12:12 PM, William David Velasquez < wi...@bi...> wrote: > Hi, **** > > ** ** > > I´m trying to put three instances in the xform model which from external > request:**** > > ** ** > > <xforms:instance id="ins" src="/siclho/pdserver.dll/doc/new? > template=Actividad"/>**** > > <xforms:instance id="tipos_ins" src=" > tipos.xml"/>**** > > <xforms:instance id="reglas_ins" src=" > reglas_contacto.xml"/>**** > > ** ** > > But it looks like only the first instance is loaded. If I put every > instance in a different model it works, but I have some validations to do > between the instances, but this is only possible if the instances belongs to > the same model.**** > > ** ** > > Can XSLTForms load many instances in a model? Or just one?**** > > If the answer is no, is possible to use xpath expressions between different > models?**** > > ** ** > > Thank you very much. I really love XSLTForms!**** > > ** ** > > ** ** > > William David Velasquez**** > > Consultor en Tecnología**** > > Bitlab **** > > Cel 315 488 77 98**** > > ** ** > > > ------------------------------------------------------------------------------ > AppSumo Presents a FREE Video for the SourceForge Community by Eric > Ries, the creator of the Lean Startup Methodology on "Lean Startup > Secrets Revealed." This video shows you how to validate your ideas, > optimize your ideas and identify your business strategy. > http://p.sf.net/sfu/appsumosfdev2dev > _______________________________________________ > Xsltforms-support mailing list > Xsl...@li... > https://lists.sourceforge.net/lists/listinfo/xsltforms-support > > -- Dan McCreary Semantic Solutions Architect office: (952) 931-9198 cell: (612) 986-1552 |
From: William D. V. <wi...@bi...> - 2011-07-15 22:09:12
|
Hi, I´m trying to put three instances in the xform model which from external request: <xforms:instance id="ins" src="/siclho/pdserver.dll/doc/new? template=Actividad"/> <xforms:instance id="tipos_ins" src="tipos.xml"/> <xforms:instance id="reglas_ins" src="reglas_contacto.xml"/> But it looks like only the first instance is loaded. If I put every instance in a different model it works, but I have some validations to do between the instances, but this is only possible if the instances belongs to the same model. Can XSLTForms load many instances in a model? Or just one? If the answer is no, is possible to use xpath expressions between different models? Thank you very much. I really love XSLTForms! William David Velasquez Consultor en Tecnología Bitlab Cel 315 488 77 98 |
From: Sachin G. <sac...@co...> - 2011-07-13 16:45:59
|
Hi, I am having issues while I am trying to disable a trigger in XSLTForms: Binding: <xf:bind nodeset="instance(''i0'')/@hasSubject" readonly="not(boolean-from-string(.))" id="findPersonButtonBinding"/> Trigger: <xf:trigger bind="findPersonButtonBinding" appearance="full"> <xf:label>Find</xf:label> <xf:load resource="javascript:MOSAIC.util.showFindPerson()" ev:event="DOMActivate"/> </xf:trigger> It doesn't disable the button. So I did following: XFTrigger.prototype.changeReadonly = function() { if(this.readonly) { var button = Core.isXhtml ? (this.element.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "a")[0] || this.element.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "button")[0]) : (this.element.getElementsByTagName("a")[0] || this.element.getElementsByTagName("button")[0]); if(typeof button.disabled != "undefined") { button.disabled = "disabled"; } else if(button.href) { button.removeAttribute("href"); } } }; It seems to disable the button, is it the right approach? Cheers Sachin Sachin Goyal Java Developer Corelogic Limited www.corelogic.co.uk <http://www.corelogic.co.uk> Tel: 0131 550 0445 Mobile: 07779 393 392 Email sac...@co... <mailto:sac...@co...> This document should only be read by those persons to whom it is intended, and its contents are private and confidential. If you receive this email message in error, notify the sender immediately and do not disclose, copy or distribute this message, or open any attachments Please consider the environment - do you really need to print this? |
From: Sachin G. <sac...@co...> - 2011-07-12 08:10:26
|
Hi Alain, Thanks for replying. 1). Yes I checked this with debugger. Regards, Sachin From: Alain Couthures [mailto:ala...@ag...] Sent: 11 July 2011 20:49 To: Sachin Goyal Cc: xsl...@li...; Steve Brown Subject: Re: [Xsltforms-support] XSLTForms and IE8 issues Hi Sachin, Thank you very much for sharing! 1). When the page is loaded, it loads config_en.xsl in Core loadProperties. (for i18). So when the ajax call is made to load this resource, it should return back the XML in the XMLHttpRequest.responseXML but it doesn't in IE. The work around was to load the responseXML from responseText as follows: if(Core.isIE) { req.responseXML.loadXML(req.responseText); } Your proposed workaround is interesting. I suspect that there might be a content type problem so IE doesn't see the response as XML. Did you already check this with a debugger? 2). All the triggers and submit controls are converted in to links and their href="javascript:void(0)" <javascript:void(0)> . In IE it was somehow changing the state of the window, and was triggering beforeunload event. In other browsers it doesn't. So should xsltforms.xsl be changed to set the href="#"? Good suggestion! I don't have my own opinion about it yet and I need some testing. I would also be happy to know the point of view of other XSLTForms users. 3). When we submit the form (PUT), the response is returned with status code 204. In IE it is converted to 1223. So we had to handle this status code in XFSubmission.prototype.submit. Otherwise submission-error was being thrown. Yes! I just discovered that there are many web pages discussing about that strange IE behavior. I will integrate it in XSLTForms as soon as possible. Regards, -Alain |
From: Alain C. <ala...@ag...> - 2011-07-11 19:45:41
|
Hi Sachin, Thank you very much for sharing! > 1). When the page is loaded, it loads config_en.xsl in Core > loadProperties. (for i18). > > So when the ajax call is made to load this resource, it should return > back the XML in the XMLHttpRequest.responseXML but it doesn't in IE. > > The work around was to load the responseXML from responseText as follows: > > if(Core.isIE) { > > req.responseXML.loadXML(req.responseText); > > } > Your proposed workaround is interesting. I suspect that there might be a content type problem so IE doesn't see the response as XML. Did you already check this with a debugger? > > 2). All the triggers and submit controls are converted in to links and > their href="javascript:void(0)". In IE it was somehow changing the > state of the window, and was triggering *beforeunload* event. > > In other browsers it doesn't. > > So should xsltforms.xsl be changed to set the href="#"? > Good suggestion! I don't have my own opinion about it yet and I need some testing. I would also be happy to know the point of view of other XSLTForms users. > > 3). When we submit the form (PUT), the response is returned with > status code 204. In IE it is converted to 1223. > > So we had to handle this status code in XFSubmission.prototype.submit. > Otherwise submission-error was being thrown. > Yes! I just discovered that there are many web pages discussing about that strange IE behavior. I will integrate it in XSLTForms as soon as possible. Regards, -Alain |
From: Sachin G. <sac...@co...> - 2011-07-11 09:04:29
|
Hi, I have been trying to get XSLTForms working with IE8, during testing I found following issues: 1). When the page is loaded, it loads config_en.xsl in Core loadProperties. (for i18). So when the ajax call is made to load this resource, it should return back the XML in the XMLHttpRequest.responseXML but it doesn't in IE. The work around was to load the responseXML from responseText as follows: if(Core.isIE) { req.responseXML.loadXML(req.responseText); } 2). All the triggers and submit controls are converted in to links and their href="javascript:void(0)". In IE it was somehow changing the state of the window, and was triggering beforeunload event. In other browsers it doesn't. So should xsltforms.xsl be changed to set the href="#"? 3). When we submit the form (PUT), the response is returned with status code 204. In IE it is converted to 1223. So we had to handle this status code in XFSubmission.prototype.submit. Otherwise submission-error was being thrown. Regards, Sachin Goyal Java Developer Corelogic Limited www.corelogic.co.uk <http://www.corelogic.co.uk> Tel: 0131 550 0445 Mobile: 07779 393 392 Email sac...@co... <mailto:sac...@co...> This document should only be read by those persons to whom it is intended, and its contents are private and confidential. If you receive this email message in error, notify the sender immediately and do not disclose, copy or distribute this message, or open any attachments Please consider the environment - do you really need to print this? |
From: Leigh L K. Jr <lei...@xe...> - 2011-07-08 23:22:28
|
If you have an xforms-value-changed handler on an input which is in a repeat, and you click in another iteration of the repeat, the xforms-value-changed handler is run with the context of the iteration which has gained focus, not the iteration which had the xforms-value-changed. Please see the attached test case. Leigh. |
From: Steve B. <ste...@co...> - 2011-06-23 15:00:20
|
Hi Alain Many thanks for your swift response. Your suggestion to use xforms types has given me all I needed so I didn't initially try using xsd types with xsi:nil and thereby test your code. When I did test your fix it didn't seem to work as I expected. My understanding is that a value of "" and xsi:nil means that validation against the schema type should not happen: so the code should look like this - this.setProperty_(node, "notvalid", !Core.getBoolMeta(node, "notrelevant") && !(!(Core.getBoolMeta(node, "required") && (!value || value == "")) && (!schtyp || (value == "" && Core.getNil(node)) || schtyp.validate(value)) && (!bind.constraint || booleanValue(bind.constraint.evaluate(ctx))))); However, I see now that xsi:nil could never be made to do what I was trying to do. To work, the script would have to be inserting and removing the xsi:nil attributes from elements depending on whether they are empty or not. As you say, only xforms types should be used! Steve Steve Brown Senior Developer Corelogic Limited Email: ste...@co... <mailto:ste...@bt...> From: Alain Couthures [mailto:ala...@ag...] Sent: 22 June 2011 21:04 To: Steve Brown Cc: xsl...@li... Subject: Re: [Xsltforms-support] No support for xsi:nil Hello Steve, As you suggested, I have modified the setting of the "notvalid" property in the XFInstance.prototype.validate_() method to support xsi:nil. Please have a look at rev. 508 It is my understanding that xsi:nil will not allow any value at all. For allowing both empty values and typed values, you have to use xforms types instead of xsd types. Thank you for your feedbacks! -Alain Le 21/06/2011 21:03, Steve Brown a écrit : Hello I am trying to get a sample form working which should allow numeric inputs that also allow nulls. The model looks like this: <xf:model> <xf:instance id="i0" src="formmodel/99"> <XFAnswers submitUri="formmodel/99"> <XFAnswer questionUserCode="firstNames"><Value>Fred</Value></XFAnswer> <XFAnswer questionUserCode="numberOfSiblings"><Value xsi:nil="true"></Value></XFAnswer> <XFAnswer questionUserCode="weightInKg"><Value xsi:nil="true"></Value></XFAnswer> </XFAnswers> </xf:instance> <xf:submission id="s01" method="put"> <xf:resource value="//XFAnswers/@submitUri"/> <xf:message ev:event="xforms-submit-error">A submission error (<output value="event('error-type')"/>) occurred.</xf:message> </xf:submission> <xf:bind nodeset="//XFAnswer[@questionUserCode='firstNames']/Value" type="xs:string" id="firstNames"/> <xf:bind nodeset="//XFAnswer[@questionUserCode='numberOfSiblings']/Value" type="xs:long" id="numberOfSiblings"/> <xf:bind nodeset="//XFAnswer[@questionUserCode='weightInKg']/Value" type="xs:decimal" id="weightInKg"/> </xf:model> Submission errors occur until the controls bound to the numeric types have numeric values, despite the model starting with nil attributes. I'm wondering, in the method XFInstance.prototype.validate_, should the "notvalid" property really be set for bound nodes when schema validation fails - if the field is empty and nillable? Regards Steve Brown Senior Developer Corelogic Limited Email: ste...@co... <mailto:ste...@bt...> ------------------------------------------------------------------------------ EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev _______________________________________________ Xsltforms-support mailing list Xsl...@li... https://lists.sourceforge.net/lists/listinfo/xsltforms-support |
From: Alain C. <ala...@ag...> - 2011-06-22 20:01:07
|
Hello Steve, As you suggested, I have modified the setting of the "notvalid" property in the XFInstance.prototype.validate_() method to support xsi:nil. Please have a look at rev. 508 It is my understanding that xsi:nil will not allow any value at all. For allowing both empty values and typed values, you have to use xforms types instead of xsd types. Thank you for your feedbacks! -Alain Le 21/06/2011 21:03, Steve Brown a écrit : > > Hello > > I am trying to get a sample form working which should allow numeric > inputs that also allow nulls. > > The model looks like this: > > <xf:model> > > <xf:instance id="i0" src="formmodel/99"> > > <XFAnswers submitUri="formmodel/99"> > > <XFAnswer questionUserCode="firstNames"><Value>Fred</Value></XFAnswer> > > <XFAnswer questionUserCode="numberOfSiblings"><Value > xsi:nil="true"></Value></XFAnswer> > > <XFAnswer questionUserCode="weightInKg"><Value > xsi:nil="true"></Value></XFAnswer> > > </XFAnswers> > > </xf:instance> > > <xf:submission id="s01" method="put"> > > <xf:resource value="//XFAnswers/@submitUri"/> > > <xf:message ev:event="xforms-submit-error">A submission error (<output > value="event('error-type')"/>) occurred.</xf:message> > > </xf:submission> > > <xf:bind nodeset="//XFAnswer[@questionUserCode='firstNames']/Value" > type="xs:string" id="firstNames"/> > > <xf:bind > nodeset="//XFAnswer[@questionUserCode='numberOfSiblings']/Value" > type="xs:long" id="numberOfSiblings"/> > > <xf:bind nodeset="//XFAnswer[@questionUserCode='weightInKg']/Value" > type="xs:decimal" id="weightInKg"/> > > </xf:model> > > Submission errors occur until the controls bound to the numeric types > have numeric values, despite the model starting with nil attributes. > I'm wondering, in the method > > XFInstance.prototype.validate_, should the "notvalid" property really > be set for bound nodes when schema validation fails - if the field is > empty and nillable? > > Regards > > *Steve Brown* > > Senior Developer > > Corelogic Limited > > Email: ste...@co... <mailto:ste...@bt...> > > > ------------------------------------------------------------------------------ > EditLive Enterprise is the world's most technically advanced content > authoring tool. Experience the power of Track Changes, Inline Image > Editing and ensure content is compliant with Accessibility Checking. > http://p.sf.net/sfu/ephox-dev2dev > > > _______________________________________________ > Xsltforms-support mailing list > Xsl...@li... > https://lists.sourceforge.net/lists/listinfo/xsltforms-support |
From: Steve B. <ste...@co...> - 2011-06-21 19:15:37
|
Hello I am trying to get a sample form working which should allow numeric inputs that also allow nulls. The model looks like this: <xf:model> <xf:instance id="i0" src="formmodel/99"> <XFAnswers submitUri="formmodel/99"> <XFAnswer questionUserCode="firstNames"><Value>Fred</Value></XFAnswer> <XFAnswer questionUserCode="numberOfSiblings"><Value xsi:nil="true"></Value></XFAnswer> <XFAnswer questionUserCode="weightInKg"><Value xsi:nil="true"></Value></XFAnswer> </XFAnswers> </xf:instance> <xf:submission id="s01" method="put"> <xf:resource value="//XFAnswers/@submitUri"/> <xf:message ev:event="xforms-submit-error">A submission error (<output value="event('error-type')"/>) occurred.</xf:message> </xf:submission> <xf:bind nodeset="//XFAnswer[@questionUserCode='firstNames']/Value" type="xs:string" id="firstNames"/> <xf:bind nodeset="//XFAnswer[@questionUserCode='numberOfSiblings']/Value" type="xs:long" id="numberOfSiblings"/> <xf:bind nodeset="//XFAnswer[@questionUserCode='weightInKg']/Value" type="xs:decimal" id="weightInKg"/> </xf:model> Submission errors occur until the controls bound to the numeric types have numeric values, despite the model starting with nil attributes. I'm wondering, in the method XFInstance.prototype.validate_, should the "notvalid" property really be set for bound nodes when schema validation fails - if the field is empty and nillable? Regards Steve Brown Senior Developer Corelogic Limited Email: ste...@co... <mailto:ste...@bt...> |
From: Efraim F. <efr...@gm...> - 2011-06-20 06:24:02
|
Ignore this one. It looks like one of the changes I made slipped in an xf:send call to a nonexistent submission, which silently fails. Thanks, Efraim On 06/19/2011 05:39 PM, Efraim Feinstein wrote: > Hi, > > Is it possible that r507 is missing a call to xforms-recalculate or > xforms-rebuild after a submission? I had a form that relied on a > structure like > <xf:trigger ref="instance('x')/y[.='']">... > > where the value of the instance is being changed by an action handler > in following submission. The action handler is happening and the value > has been set, but the trigger didn't disappear. > > Thanks, > -- --- Efraim Feinstein Lead Developer Open Siddur Project http://opensiddur.net http://wiki.jewishliturgy.org |
From: Efraim F. <efr...@gm...> - 2011-06-19 21:39:53
|
Hi, Is it possible that r507 is missing a call to xforms-recalculate or xforms-rebuild after a submission? I had a form that relied on a structure like <xf:trigger ref="instance('x')/y[.='']">... where the value of the instance is being changed by an action handler in following submission. The action handler is happening and the value has been set, but the trigger didn't disappear. Thanks, -- --- Efraim Feinstein Lead Developer Open Siddur Project http://opensiddur.net http://wiki.jewishliturgy.org |
From: Efraim F. <efr...@gm...> - 2011-06-19 19:13:07
|
Hi Alain, I just did a basic test and it looks like it's working. Thanks for quickly adding this feature! It makes it possible to use non-XML (text/JSON) services through XSLTForms and makes it one step more conformant to XForms 1.1. -Efraim On 06/19/2011 08:41 AM, Alain Couthures wrote: > Hello Efraim, > > It is now implemented in r507. > > As specified, you have to use replace="text" with a web service > returning plain text. > > Thank you for your feedbacks! > > -Alain > > Le 17/06/2011 04:46, Efraim Feinstein a écrit : >> Hi, >> >> If a web service returns plain text, is there any way to get it into an >> instance in XSLTForms? XForms 1.1 supports xf:submission/@targetref, but >> it doesn't look like it's supported by XSLTForms. Loading text into an >> instance causes an (entirely reasonable) error to be entered into the >> instance: "This page contains the following errors:error on line 1 at >> column 1: Extra content at the end of the document Below is a rendering >> of the page up to the first error." >> >> Thanks, >> > > -- --- Efraim Feinstein Lead Developer Open Siddur Project http://opensiddur.net http://wiki.jewishliturgy.org |
From: Alain C. <ala...@ag...> - 2011-06-19 12:38:44
|
Hello Efraim, It is now implemented in r507. As specified, you have to use replace="text" with a web service returning plain text. Thank you for your feedbacks! -Alain Le 17/06/2011 04:46, Efraim Feinstein a écrit : > Hi, > > If a web service returns plain text, is there any way to get it into an > instance in XSLTForms? XForms 1.1 supports xf:submission/@targetref, but > it doesn't look like it's supported by XSLTForms. Loading text into an > instance causes an (entirely reasonable) error to be entered into the > instance: "This page contains the following errors:error on line 1 at > column 1: Extra content at the end of the document Below is a rendering > of the page up to the first error." > > Thanks, > |
From: Efraim F. <efr...@gm...> - 2011-06-17 02:46:58
|
Hi, If a web service returns plain text, is there any way to get it into an instance in XSLTForms? XForms 1.1 supports xf:submission/@targetref, but it doesn't look like it's supported by XSLTForms. Loading text into an instance causes an (entirely reasonable) error to be entered into the instance: "This page contains the following errors:error on line 1 at column 1: Extra content at the end of the document Below is a rendering of the page up to the first error." Thanks, -- --- Efraim Feinstein Lead Developer Open Siddur Project http://opensiddur.net http://wiki.jewishliturgy.org |