xsltforms-support Mailing List for XSLTForms (Page 16)
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: C. M. Sperberg-M. <cm...@bl...> - 2016-06-28 04:47:28
|
Consider the simple form at http://blackmesatech.com/2016/06/textnodetest/index.xhtml It has one document instance, which is a simple XML document with mixed content. <doc> <p>This is a <i>document</i> with <b>mixed content</b>. </p> </doc> It shows two ways of editing parts of the document: the first, which binds xf:input elements to the i and b elements, does appear to change the value of the document effectively. The second, which binds xf:input elements to the text nodes of the document, does not seem to work. I also notice that the read-only display of document structure shown at the end of the page does not change, even though the model seems to be being updated. I think that XForms allows controls to be bound to any node in the document, including text nodes. Am I doing something wrong? I would be grateful for any help any reader of this list can give me. -- **************************************************************** * C. M. Sperberg-McQueen, Black Mesa Technologies LLC * http://www.blackmesatech.com * http://cmsmcq.com/mib * http://balisage.net **************************************************************** |
From: C. M. Sperberg-M. <cm...@bl...> - 2016-06-20 18:32:36
|
I have a form that performs a query against a database back end, shows the results, and keeps the search box open so the user can issue a new search. http://tlrr.blackmesatech.com/2016/01/balbus.xhtml (Useful searches: "Alfenus", "Balbus" for fast searches, "Cicero" for a slower one.) In the current version of the form, nothing visual happens when the user issues a new search; if the search is slow, the user can think "something went wrong, the browser didn't notice the click, I'll click again". So I'd like the Search button to clear the old results, display the text "Query in progress ..." in some way (ideally in the work area where the results used to be), and issue the query submission to the back end. A first cut made the trigger look like this: <xf:trigger> <xf:label>Search</xf:label> <xf:action ev:event="DOMActivate"> <xf:delete nodeset="instance('results')/child::node()"/> <xf:insert context="instance('results')" origin="instance('ui')/query-in-progress"/> <xf:setvalue ref="instance('q')/startpos" value="1"/> <xf:send submission="send-query"/> </xf:action> </xf:trigger> And I added the 'Query in progress ...' display this way: <xf:group ref="instance('results')/query-in-progress"> <p>Query in progress ...</p> </xf:group> (It should be noted that the send-query submission replaces the 'results' instance entirely, so the empty 'query-in-progress' element there goes away when the results of the query are returned.) The trigger and group just shown, however, do not in fact make the old results disappear or the text "Query in progress ..." appear; there no change to the display until the results of the query come back. Consulting the spec, I see that my problem is apparently described in the section on 'deferred updates', near the beginning of section 10: > Deferred Updates: Sequences of one or more XForms Actions have a deferred effect on XForms model and user interface processing. Implementations are free to use any strategy to accomplish deferred updates, but the end result must be as follows: Instance data changes performed by a set of actions do not result in immediate computation dependency rebuilding, recalculation, revalidate and form control refreshing until the termination of the outermost action handler, as described here. OK, I think I can see the point of that rule. Later on in the same section, however, it says > Actions that directly invoke rebuild, recalculate, revalidate, or refresh always have an immediate effect, and clear the corresponding deferred update flag. The XForms Actions in this category are: > > rebuild > recalculate > revalidate > refresh So I tried inserting first one, then a different one, and finally all four of these actions into my trigger: <xf:trigger> <xf:label>Search</xf:label> <xf:action ev:event="DOMActivate"> <!--* <xf:message level="ephemeral">Query in progress</xf:message> *--> <xf:delete nodeset="instance('results')/child::node()"/> <xf:insert context="instance('results')" origin="instance('ui')/query-in-progress"/> <xf:rebuild/> <xf:recalculate/> <xf:revalidate/> <xf:refresh/> <xf:setvalue ref="instance('q')/startpos" value="1"/> <xf:send submission="send-query"/> </xf:action> </xf:trigger> The result is that the behavior is still unchanged. Have I misunderstood the spec? Am I doing something wrong? How can I cause a single button press to (a) clear the results and display a 'be patient' message, and (b) perform a submission which will automatically clear that be-patient message when the results come back? Thanks for any help. -- **************************************************************** * C. M. Sperberg-McQueen, Black Mesa Technologies LLC * http://www.blackmesatech.com * http://cmsmcq.com/mib * http://balisage.net **************************************************************** |
From: <bc...@sh...> - 2016-06-19 07:01:29
|
Thank you for the reply Alain. It will be interesting times when 'fleur' and XSLTForms 2 arrive. :-) For now, as I said, I am wanting to generate a xsd:duration content based on a start and end xsd:date and xsd:time elements entered via a xform. I have not got far enough yet to submit a working xform test case skeleton, as I am just trying to sort out the best way to generate the xsd:duration, however for instance: ... <datestart>20160510</datestart> <timestart>083000</timestart> <dateend>20160511</dateend> <timeend>104500</timeend> <duration>PT26H15M</duration> <------- calculate this, a duration showing hours and minutes, from the date and time elements ... What would be the best and/or efficient approach please? At the moment I am intending to use xf:bind calculations, using substring, floor and div functions etc on the date and time elements, to *eventually* get the desired content for the xsd:duration element. Perhaps there is a better approach ? As an aside, if I have understood it properly, the EXSLT template 'date:duration' provides this process, so perhaps it is possible to do a xslt transform within XSLTForms to produce the desired duration instance. I will keep on it and see what I come up with, but if you (or any one else) have any ideas/tips please let me know. Regards Habs On 18 June 2016 at 21:06, Alain Couthures <ala...@ag...> wrote: > Hello Habs, > > I am currently extending my new XPath engine (Fleur) into an XQuery engine > as well. Progressively, it will support XPath/XQuery 3.1 but there are > still missing functionalities such as durations. Because of functions such > as doc(), this engine is written in asynchronous Javascript so it will not > be possible to use it within XSLTForms v1 but within XSLTForms v2. > > Priorities are always hard to decide. Adding duration support in XSLTForms > v1 might reduce time required for adding it in Fleur... > > Maybe you don't need a full support yet? Can you post a test case?? > > --Alain > > > Le 18/06/2016 à 21:15, bc...@sh... a écrit : > > Hello all, good day > > Most likely this has been mentioned before and if so my apologies for not > finding anything on it by better searching 'discussion' or mailing lists. > > How easy (technically and time availability) would it be for maintainers > (Alain ?) to implement the xsd:duration type and associated functions (I > think they are XPath 2) ? > > For now, would some kind person assist (post a small code perhaps) by > suggesting how to best/efficiently process xsd:time elements 'time-from' > and 'time-to' in a repeat block, such that for each pair the duration in > minutes (seconds does not matter) is calculated and then a total for the > nodeset ? > > For now, as a descriptive, I am playing with implementing a <minutes/> > element for each repeat item and using a 'bind calculate' to get the value > by string splitting and using math functions to obtain the duration hours > (converting it to minutes) and minutes and adding the two. > > Then to create a <totalminutes/> element and using a 'bind calculate' to > get the value by using sum() on the <minutes/> nodeset. > > > Thank you for some info and comments. > Peace and best wishes > > Habs > > > > ------------------------------------------------------------------------------ > What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic > patterns at an interface-level. Reveals which users, apps, and protocols are > consuming the most bandwidth. Provides multi-vendor support for NetFlow, > J-Flow, sFlow and other flows. Make informed decisions using capacity planning > reports. http://sdm.link/zohomanageengine > > > > _______________________________________________ > Xsltforms-support mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/xsltforms-support > > > |
From: C. M. Sperberg-M. <cm...@bl...> - 2016-06-18 21:03:42
|
On Jun 18, 2016, at 1:44 PM, Alain Couthures wrote: > Michael, > > Subforms are loaded with the load action so any event can trigger it. If not, this would be an issue and I would be happy to have a test case if this happens. Thank you very much for this reply. I keep hoping to find a simple, clear description of how the event system works that will be less effort to read than the DOM2 events spec and the XML Events spec. But my hopes keep being disappointed. So I will need to read the specs, I guess. > Ids are to be considered with subforms: if no static id is used in the subform, generated ids include the generated subform id. But, yet, the load action has to copy the subform content according to an id (within a repeat, every static id is actually replaced by a generated one). Adding AVT support in the load action for the targetid attribute might do the trick... I will keep that in mind. I have been fortunate enough so far to be able to use subforms and repeats without ever fully understanding the black magic performed on IDs by XSLTForms in handling repeats and subforms. > > There is also the xf:include/@src control, which is an extension, just to include an external file at the XSLT step. That may be the simplest step forward for the two use cases I mentioned. > > What do you think? I think I am in your debt, is what I think. Thank you very much. Michael -- **************************************************************** * C. M. Sperberg-McQueen, Black Mesa Technologies LLC * http://www.blackmesatech.com * http://cmsmcq.com/mib * http://balisage.net **************************************************************** |
From: Alain C. <ala...@ag...> - 2016-06-18 20:07:13
|
Hello Habs, I am currently extending my new XPath engine (Fleur) into an XQuery engine as well. Progressively, it will support XPath/XQuery 3.1 but there are still missing functionalities such as durations. Because of functions such as doc(), this engine is written in asynchronous Javascript so it will not be possible to use it within XSLTForms v1 but within XSLTForms v2. Priorities are always hard to decide. Adding duration support in XSLTForms v1 might reduce time required for adding it in Fleur... Maybe you don't need a full support yet? Can you post a test case?? --Alain Le 18/06/2016 à 21:15, bc...@sh... a écrit : > Hello all, good day > > Most likely this has been mentioned before and if so my apologies for > not finding anything on it by better searching 'discussion' or mailing > lists. > > How easy (technically and time availability) would it be for > maintainers (Alain ?) to implement the xsd:duration type and > associated functions (I think they are XPath 2) ? > > For now, would some kind person assist (post a small code perhaps) by > suggesting how to best/efficiently process xsd:time elements > 'time-from' and 'time-to' in a repeat block, such that for each pair > the duration in minutes (seconds does not matter) is calculated and > then a total for the nodeset ? > > For now, as a descriptive, I am playing with implementing a > <minutes/> element for each repeat item and using a 'bind calculate' > to get the value by string splitting and using math functions to > obtain the duration hours (converting it to minutes) and minutes and > adding the two. > > Then to create a <totalminutes/> element and using a 'bind calculate' > to get the value by using sum() on the <minutes/> nodeset. > > > Thank you for some info and comments. > Peace and best wishes > > Habs > > > > ------------------------------------------------------------------------------ > What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic > patterns at an interface-level. Reveals which users, apps, and protocols are > consuming the most bandwidth. Provides multi-vendor support for NetFlow, > J-Flow, sFlow and other flows. Make informed decisions using capacity planning > reports. http://sdm.link/zohomanageengine > > > _______________________________________________ > Xsltforms-support mailing list > Xsl...@li... > https://lists.sourceforge.net/lists/listinfo/xsltforms-support |
From: Alain C. <ala...@ag...> - 2016-06-18 19:58:18
|
Michael, Subforms are loaded with the load action so any event can trigger it. If not, this would be an issue and I would be happy to have a test case if this happens. Ids are to be considered with subforms: if no static id is used in the subform, generated ids include the generated subform id. But, yet, the load action has to copy the subform content according to an id (within a repeat, every static id is actually replaced by a generated one). Adding AVT support in the load action for the targetid attribute might do the trick... There is also the xf:include/@src control, which is an extension, just to include an external file at the XSLT step. What do you think? Alain Le 18/06/2016 à 21:22, C. M. Sperberg-McQueen a écrit : > Apologies for an ignorant question; my knowledge and understanding > of the event model underlying XForms is incomplete (in the places > where it exists at all). This level of ignorance is compatible with a lot > of usage of XForms, as long as everything you want to happen is > triggered by a button press and you can catch it with ev:event > = "DOMActivate", but I find myself wanting something different for > the form I'm working on right now. > > Subforms can be loaded on a DOMActivate event; this is reasonably > straightforward. > > Can they be loaded on other events? in particular, can they be loaded > automatically when an element matches a group in the form? Or > when the main form itself is loaded? > > Consider two use cases: > > A. A user has done a search in a database and is paging through the > results. The back end has sent us $rows-in-page items in the results, > along with a $total-hit-count number telling us how many hits the > user's query actually produced, and a $start-row number telling us > where in the results this extract starts. For the first page of results, $start-row > will be 1, and $rows-in-page can be adjusted by the user. > > Both at the top of the results display and at the bottom, I want > two buttons: a Previous or Back button (iff $start-row > 1) > and a Next or Forward button (iff $start-row + $rows-in-page > < $total-hit-count). > > The logic, the markup structure, and the CSS styling of the two > buttons is just complicated enough that the handling of the buttons > takes up 42 lines in the example I just examined, and they get > tweaked repeatedly. > > Keeping two occurrences of a 42-line block in synch is boring and > error-prone, and having a full screen or more devoted to such > secondary concerns makes the form hard to read. At the moment, I > handle both of these problems by maintaining the re-used block as > an external entity, which gets inserted into the main form when I > run xmllint, rxp, an identity transform, or any other XML normalizer > to create form.xhtml out of form.xml and its external entities. > > But it might be nicer to handle the repeated code by means of a > sub-form. To make that work, I would need to have something > at the locations where the sub-form needs to be loaded which > causes the loading and which is triggered by an event generated > automatically when the search results are returned. > > Is there a suitable event in the XForms model? Can anyone point to > an example of its use? > > > B. In a form I'm writing now, the documents being edited by the user > consist of a series of top-level children of the document element, > in a relatively fixed order, each top-level child having a characteristic > intermal substructure. Some of the top-level elements have mixed > content (for which I am using a subform); others have element-only > content, but sometimes have children (or in some cases, distant > descendants) which have mixed content. > > I would like the user to be presented, on loading a document, with > read-only displays of each top-level element, and buttons offering > to edit (a) the top-level mixed-content elements, and (b) the > second-level elements, some of which have mixed content and > others of which have other specialized needs which will be handled > with other specialized sub-forms. > > Right now, the main structure of the form has the structure > > <xf:repeat nodeset="*"> > > <xf:group ref=".[ ... element has mixed content ...]"> > ... read/edit switch; read case shows the data; edit case loads > mixed-content subform ... > </xf:group> > > <xf:group ref=".[ ... element has element-only content ... ]> > <xf:repeat nodeset="*"> > > <xf:group ref=".[ ... element has mixed content ...]"> > ... read/edit switch; read case shows the data; edit > case loads mixed-content subform ... > </xf:group> > > <xf:group ref=".[ ... element has other specialized content ...]"> > ... read/edit switch; read case shows the data; edit > case loads suitable subform ... > </xf:group> > > ... > > </xf:repeat> > </xf:group> > </xf:repeat> > > Actually, in the current version of the form its worse than this: the > read/edit switch for mixed-content elements occurs three times, not just > twice. > > If I could (a) represent the read/edit switch for mixed content as a subform, > and (b) cause that subform to load automatically at the two different locations > where it's needed, then I would have less repetition in my code, fewer > opportunities for unintentional inconsistency, and smaller modules > which are (probably) easier to understand. > > If I can find a way to make this work (and especially if I can find a way > to make it work recursively), then it might be possible to write XForms > for documents with less repetition and in a way that feels more like > the template-driven style of XSLT. (Where I come from, that would be > a very good thing.) > > Any comments welcome. > > Michael Sperberg-McQueen > > |
From: <bc...@sh...> - 2016-06-18 19:40:38
|
Hello all, good day Most likely this has been mentioned before and if so my apologies for not finding anything on it by better searching 'discussion' or mailing lists. How easy (technically and time availability) would it be for maintainers (Alain ?) to implement the xsd:duration type and associated functions (I think they are XPath 2) ? For now, would some kind person assist (post a small code perhaps) by suggesting how to best/efficiently process xsd:time elements 'time-from' and 'time-to' in a repeat block, such that for each pair the duration in minutes (seconds does not matter) is calculated and then a total for the nodeset ? For now, as a descriptive, I am playing with implementing a <minutes/> element for each repeat item and using a 'bind calculate' to get the value by string splitting and using math functions to obtain the duration hours (converting it to minutes) and minutes and adding the two. Then to create a <totalminutes/> element and using a 'bind calculate' to get the value by using sum() on the <minutes/> nodeset. Thank you for some info and comments. Peace and best wishes Habs |
From: C. M. Sperberg-M. <cm...@bl...> - 2016-06-18 19:22:22
|
Apologies for an ignorant question; my knowledge and understanding of the event model underlying XForms is incomplete (in the places where it exists at all). This level of ignorance is compatible with a lot of usage of XForms, as long as everything you want to happen is triggered by a button press and you can catch it with ev:event = "DOMActivate", but I find myself wanting something different for the form I'm working on right now. Subforms can be loaded on a DOMActivate event; this is reasonably straightforward. Can they be loaded on other events? in particular, can they be loaded automatically when an element matches a group in the form? Or when the main form itself is loaded? Consider two use cases: A. A user has done a search in a database and is paging through the results. The back end has sent us $rows-in-page items in the results, along with a $total-hit-count number telling us how many hits the user's query actually produced, and a $start-row number telling us where in the results this extract starts. For the first page of results, $start-row will be 1, and $rows-in-page can be adjusted by the user. Both at the top of the results display and at the bottom, I want two buttons: a Previous or Back button (iff $start-row > 1) and a Next or Forward button (iff $start-row + $rows-in-page < $total-hit-count). The logic, the markup structure, and the CSS styling of the two buttons is just complicated enough that the handling of the buttons takes up 42 lines in the example I just examined, and they get tweaked repeatedly. Keeping two occurrences of a 42-line block in synch is boring and error-prone, and having a full screen or more devoted to such secondary concerns makes the form hard to read. At the moment, I handle both of these problems by maintaining the re-used block as an external entity, which gets inserted into the main form when I run xmllint, rxp, an identity transform, or any other XML normalizer to create form.xhtml out of form.xml and its external entities. But it might be nicer to handle the repeated code by means of a sub-form. To make that work, I would need to have something at the locations where the sub-form needs to be loaded which causes the loading and which is triggered by an event generated automatically when the search results are returned. Is there a suitable event in the XForms model? Can anyone point to an example of its use? B. In a form I'm writing now, the documents being edited by the user consist of a series of top-level children of the document element, in a relatively fixed order, each top-level child having a characteristic intermal substructure. Some of the top-level elements have mixed content (for which I am using a subform); others have element-only content, but sometimes have children (or in some cases, distant descendants) which have mixed content. I would like the user to be presented, on loading a document, with read-only displays of each top-level element, and buttons offering to edit (a) the top-level mixed-content elements, and (b) the second-level elements, some of which have mixed content and others of which have other specialized needs which will be handled with other specialized sub-forms. Right now, the main structure of the form has the structure <xf:repeat nodeset="*"> <xf:group ref=".[ ... element has mixed content ...]"> ... read/edit switch; read case shows the data; edit case loads mixed-content subform ... </xf:group> <xf:group ref=".[ ... element has element-only content ... ]> <xf:repeat nodeset="*"> <xf:group ref=".[ ... element has mixed content ...]"> ... read/edit switch; read case shows the data; edit case loads mixed-content subform ... </xf:group> <xf:group ref=".[ ... element has other specialized content ...]"> ... read/edit switch; read case shows the data; edit case loads suitable subform ... </xf:group> ... </xf:repeat> </xf:group> </xf:repeat> Actually, in the current version of the form its worse than this: the read/edit switch for mixed-content elements occurs three times, not just twice. If I could (a) represent the read/edit switch for mixed content as a subform, and (b) cause that subform to load automatically at the two different locations where it's needed, then I would have less repetition in my code, fewer opportunities for unintentional inconsistency, and smaller modules which are (probably) easier to understand. If I can find a way to make this work (and especially if I can find a way to make it work recursively), then it might be possible to write XForms for documents with less repetition and in a way that feels more like the template-driven style of XSLT. (Where I come from, that would be a very good thing.) Any comments welcome. Michael Sperberg-McQueen -- **************************************************************** * C. M. Sperberg-McQueen, Black Mesa Technologies LLC * http://www.blackmesatech.com * http://cmsmcq.com/mib * http://balisage.net **************************************************************** |
From: C. M. Sperberg-M. <cm...@bl...> - 2016-06-04 08:00:54
|
At the risk of abusing this list, I take the liberty of mentioning Balisage 2016 here. Readers of this list may be interested in the Balisage conference, which focuses on applications of markup. This year's program includes two talks which prominently feature XForms applications, one at the U.S. National Institute of Standards and Technology and one in a shoe-string academic project. I hope to see other XForms enthusiasts at Balisage this year! Balisage: The Markup Conference 2016 Program Now Available http://www.balisage.net/2016/Program.html Balisage: where serious markup practitioners and theoreticians meet every August. The 2016 program includes papers discussing reducing ambiguity in linked-open-data annotations, the visualization of XSLT execution patterns, automatic recognition of grant- and funding-related information in scientific papers, construction of an interactive interface to assist cybersecurity analysts, rules for graceful extension and customization of standard vocabularies, case studies of agile schema development, a report on XML encoding of subtitles for video, an extension of XPath to file systems, handling soft hyphens in historical texts, an automated validity checker for formatted pages, one no-angle-brackets editing interface for scholars of German family names and another for scholars of Roman legal history, and a survey of non-XML markup such as Markdown. XML In, Web Out: A one-day Symposium on the sub rosa XML that powers an increasing number of websites will be held on Monday, August 1. http://balisage.net/XML-In-Web-Out/ If you are interested in open information, reusable documents, and vendor and application independence, then you need descriptive markup, and Balisage is the conference you should attend. Balisage brings together document architects, librarians, archivists, computer scientists, XML practitioners, XSLT and XQuery programmers, implementers of XSLT and XQuery engines and other markup-related software, Topic-Map enthusiasts, semantic-Web evangelists, standards developers, academics, industrial researchers, government and NGO staff, industrial developers, practitioners, consultants, and the world's greatest concentration of markup theorists. Some participants are busy designing replacements for XML while other still use SGML (and know why they do). Discussion is open, candid, and unashamedly technical. Balisage 2016 Program: http://www.balisage.net/2016/Program.html Symposium Program: http://balisage.net/XML-In-Web-Out/symposiumProgram.html ====================================================================== Balisage: The Markup Conference 2016 mailto:in...@ba... August 2-5, 2016 http://www.balisage.net Preconference Symposium: August 1, 2016 +1 301 315 9631 ====================================================================== -- **************************************************************** * C. M. Sperberg-McQueen, Black Mesa Technologies LLC * http://www.blackmesatech.com * http://cmsmcq.com/mib * http://balisage.net **************************************************************** |
From: Winona S. <wsa...@gm...> - 2016-04-26 18:20:42
|
Yes, I am generating the forms server side. Here is my test case. Main form: <?xml-stylesheet href="xsl/xsltforms.xsl" type="text/xsl"?> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:tei=" http://www.tei-c.org/ns/1.0" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xf=" http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events"> <head> <title>Wrap Selection</title> <xf:model> <xf:instance xmlns="http://www.tei-c.org/ns/1.0" id="i-rec"> <TEI> <note> <quote> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dapibus quis lacus vitae lacinia. Donec sit amet mi at quam pellentesque faucibus. Lorem ipsum dolor sit amet, consectetur adipiscing elit. </quote> </note> <desc>Pellentesque at lacus efficitur, efficitur ligula nec, tincidunt nulla. Nunc nec porta urna, id tempor ipsum. Mauris id dolor id nisl vulputate facilisis.</desc> <desc> <quote>Vivamus risus metus, cursus sed auctor eu, rhoncus ut nunc.</quote> </desc> </TEI> </xf:instance> <xf:instance xmlns="http://www.tei-c.org/ns/1.0" id="i-add-name" > <name ref="http://syriaca.org/"></name> </xf:instance> </xf:model> </head> <body> <xf:repeat ref="instance('i-rec')/tei:note" id="new-note"> <xi:include href="quote-el.xml"></xi:include> <xf:group ref="self::*[not(tei:quote/@source)]"> <h3>Note, no quote</h3> <span class="input-group mixed-content"> <span class="form-control"> <xf:input ref="instance('i-add-name')/@ref" class= "input-md"> <xf:label>URI</xf:label> </xf:input> </span> <xf:trigger appearance="minimal" class="btn btn-default input-group-addon"> <xf:label><persName></xf:label> <xf:wrap ev:event="DOMActivate" control="n" pre="<persName ref="{instance('i-add-name')/@ref}">" post="</persName>"></xf:wrap> </xf:trigger> </span> <br /> <xf:textarea id="n" ref="." incremental="true" ></xf:textarea> </xf:group> </xf:repeat> <xf:repeat ref="instance('i-rec')//tei:desc" id="new-desc"> <xi:include href="quote-el.xml"></xi:include> <xf:group ref="self::*[not(tei:quote/@source)]"> <h3>Desc, no quote</h3> <span class="input-group mixed-content"> <span class="form-control"> <xf:input ref="instance('i-add-name')/@ref" class= "input-md"> <xf:label>URI</xf:label> </xf:input> </span> <xf:trigger appearance="minimal" class="btn btn-default input-group-addon"> <xf:label><persName></xf:label> <xf:wrap ev:event="DOMActivate" control="d" pre="<persName ref="{instance('i-add-name')/@ref}">" post="</persName>"></xf:wrap> </xf:trigger> </span> <br /> <xf:textarea id="d" ref="." incremental="true" ></xf:textarea> </xf:group> </xf:repeat> </body> </html> Nested quote element is in quote-el.xml <div xmlns="http://www.w3.org/1999/xhtml" xmlns:xi=" http://www.w3.org/2001/XInclude" xmlns:ev="http://www.w3.org/2001/xml-events " xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:xf=" http://www.w3.org/2002/xforms"> <xf:group ref="tei:quote"> <h3>Quote</h3> <span class="input-group mixed-content"> <span class="form-control"> <xf:input ref="instance('i-add-name')/@ref" class= "input-md"> <xf:label>URI</xf:label> </xf:input> </span> <xf:trigger appearance="minimal" class="btn btn-default input-group-addon"> <xf:label><persName></xf:label> <xf:wrap ev:event="DOMActivate" control="q" pre="<persName ref="{instance('i-add-name')/@ref}">" post="</persName>"/> </xf:trigger> </span> <br/> <xf:textarea id="q" ref="." incremental="true"/> </xf:group> </div> On Tue, Apr 26, 2016 at 1:56 PM, Alain Couthures < ala...@ag...> wrote: > Yes, a minimal test case is required. > > Ids are automatically generated by XSLTForms when missing. Are you > generating your forms at server side ? > > --Alain > > > Le 26/04/2016 à 19:49, Winona Salesky a écrit : > >> I am using the new wrap function (a great addition!) and am trying to >> simplify my forms as much as possible. This has led me to use a lot of >> xincludes for nested data structures. >> >> Example: tei:quote is a valid sub-element of tei:note and tei:desc. I >> want to use the wrap function on the tei:quote, and would like, if possible >> to only have one 'template' for the all the fields need for the tei:quote >> element, that is used by both tei:note and tei:desc. >> >> Currently I get a duplicate id error if I use both a tei:note and a >> tei:desc. Is there a way to generate ids based on parent element? Or do I >> just need to maintain two different templates with unique ids? >> >> Thanks for the help. And let me know if a code example would be useful. >> -Winona >> > > |
From: Alain C. <ala...@ag...> - 2016-04-26 17:56:55
|
Yes, a minimal test case is required. Ids are automatically generated by XSLTForms when missing. Are you generating your forms at server side ? --Alain Le 26/04/2016 à 19:49, Winona Salesky a écrit : > I am using the new wrap function (a great addition!) and am trying to > simplify my forms as much as possible. This has led me to use a lot of > xincludes for nested data structures. > > Example: tei:quote is a valid sub-element of tei:note and tei:desc. I > want to use the wrap function on the tei:quote, and would like, if > possible to only have one 'template' for the all the fields need for > the tei:quote element, that is used by both tei:note and tei:desc. > > Currently I get a duplicate id error if I use both a tei:note and a > tei:desc. Is there a way to generate ids based on parent element? Or > do I just need to maintain two different templates with unique ids? > > Thanks for the help. And let me know if a code example would be useful. > -Winona |
From: Winona S. <wsa...@gm...> - 2016-04-26 17:49:53
|
I am using the new wrap function (a great addition!) and am trying to simplify my forms as much as possible. This has led me to use a lot of xincludes for nested data structures. Example: tei:quote is a valid sub-element of tei:note and tei:desc. I want to use the wrap function on the tei:quote, and would like, if possible to only have one 'template' for the all the fields need for the tei:quote element, that is used by both tei:note and tei:desc. Currently I get a duplicate id error if I use both a tei:note and a tei:desc. Is there a way to generate ids based on parent element? Or do I just need to maintain two different templates with unique ids? Thanks for the help. And let me know if a code example would be useful. -Winona |
From: C. M. Sperberg-M. <cm...@bl...> - 2016-04-14 17:16:19
|
On Apr 14, 2016, at 10:55 AM, Alain Couthures wrote: > Michael, > > I have improved the XPath parser accordingly and I suggest you to patch 1.0RC2 for an XSLT template named "getLocationPath", at its end: Thank you very much!! Michael -- **************************************************************** * C. M. Sperberg-McQueen, Black Mesa Technologies LLC * http://www.blackmesatech.com * http://cmsmcq.com/mib * http://balisage.net **************************************************************** |
From: Alain C. <ala...@ag...> - 2016-04-14 16:55:26
|
Michael, I have improved the XPath parser accordingly and I suggest you to patch 1.0RC2 for an XSLT template named "getLocationPath", at its end: Please replace: <xsl:choose> <xsl:when test="$i = '0'"><xsl:value-of select="concat($l,'.',$r)"/></xsl:when> <xsl:otherwise> <xsl:variable name="s3" select="substring($s,number(substring-before($i,'.'))+1)"/> <xsl:variable name="p"> <xsl:choose> <xsl:when test="substring($s3,1,1) = '['"> <xsl:variable name="t"><xsl:call-template name="getPredicates"><xsl:with-param name="s" select="substring($s3,2)"/></xsl:call-template></xsl:variable> <xsl:value-of select="concat(substring-before($t,'.'),'.',substring-after($t,'.'),')')"/> </xsl:when> <xsl:when test="substring-after($i,'.') = ''">0.</xsl:when> <xsl:otherwise>0.)</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:call-template name="getLocationPath"> <xsl:with-param name="s" select="substring($s3,number(substring-before($p,'.'))+1)"/> <xsl:with-param name="r" select="concat($r,substring-after($i,'.'),substring-after($p,'.'))"/> <xsl:with-param name="l" select="$l+number(substring-before($i,'.'))+number(substring-before($p,'.'))"/> </xsl:call-template> </xsl:otherwise> </xsl:choose> by: <xsl:choose> <xsl:when test="$i = '0'"><xsl:value-of select="concat($l,'.',$r)"/></xsl:when> <xsl:otherwise> <xsl:variable name="s3" select="substring($s,number(substring-before($i,'.'))+1)"/> <xsl:variable name="c3" select="substring(normalize-space($s3),1,1)"/> <xsl:variable name="i3" select="string-length(substring-before($s3,$c3))"/> <xsl:variable name="s4" select="concat($c3,substring-after($s3,$c3))"/> <xsl:variable name="p"> <xsl:choose> <xsl:when test="$c3 = '['"> <xsl:variable name="t"><xsl:call-template name="getPredicates"><xsl:with-param name="s" select="substring($s4,2)"/></xsl:call-template></xsl:variable> <xsl:value-of select="concat(substring-before($t,'.'),'.',substring-after($t,'.'),')')"/> </xsl:when> <xsl:when test="substring-after($i,'.') = ''">0.</xsl:when> <xsl:otherwise>0.)</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:variable name="s5" select="substring($s4,number(substring-before($p,'.'))+1)"/> <xsl:variable name="c5" select="substring(normalize-space($s5),1,1)"/> <xsl:variable name="i5" select="string-length(substring-before($s5,$c5))"/> <xsl:call-template name="getLocationPath"> <xsl:with-param name="s" select="concat($c5,substring-after($s5,$c5))"/> <xsl:with-param name="r" select="concat($r,substring-after($i,'.'),substring-after($p,'.'))"/> <xsl:with-param name="l" select="$l+number(substring-before($i,'.'))+$i3+number(substring-before($p,'.'))+$i5"/> </xsl:call-template> </xsl:otherwise> </xsl:choose> Thank you for your feedback! --Alain Le 13/04/2016 01:33, C. M. Sperberg-McQueen a écrit : > Over the last few years, as I've used XSLTForms, I have occasionally > stumbled over the way whitespace appears to be handled in XPath > expressions. The XPath specs are not always as clear about it as they > might be (in the sense that if you just look at the EBNF rules, you'll > never discover the rule), but the general rule is that whitespace is > allowed between any two tokens of an XPath. > > The last paragraph of section 1 in XPath 1.0 [1] says > > Expressions are parsed by first dividing the character string to be > parsed into tokens and then parsing the resulting sequence of > tokens. Whitespace can be freely used between tokens. The > tokenization process is described in [3.7 Lexical Structure]. > > [1]http://www.w3.org/TR/xpath/#section-Introduction > > In XPath 2.0 [2], the clearest statement is in the definition of > 'ignorable whitespace': > > [Definition: Ignorable whitespace consists of any whitespace > characters that may occur between terminals, unless these characters > occur in the context of a production marked with aws:explicit > annotation, in which case they can occur only where explicitly > specified (see A.2.4.2 Explicit Whitespace Handling).] Ignorable > whitespace characters are not significant to the semantics of an > expression. Whitespace is allowed before the first terminal and > after the last terminal of a module. Whitespace is allowed between > any two terminals. Comments may also act as "whitespace" to prevent > two adjacent terminals from being recognized as one. > > [2]http://www.w3.org/TR/xpath20/#IgnorableWhitespace > > As I understand these rules, they have the consequence that > > .[not(instance('trial')/self::trial/*[name(.)=name(current())])] > ] > is grammatically the same as > > .[not( > instance('trial') > /self::trial > /* > [name(.) = name(current())] > ) > ] > > Since I found the first one a bit convoluted, as I was constructing > it, I really wanted to use the second form, which I find slightly > easier to check for correctness. > > But the XPath parser used in XSLTForms (at least through 1.0RC2) > seems to take the view that whitespace can be ignored only inside > predicates. So to make the expression just given work in a form, I end > up rewriting it without whitespace, or (if I insist on breaking the > expression into multiple lines) in some form like > > .[ not(instance('trial')/self::trial/*[ > name(.) = name(current())]) > ] > ] > > Is there any chance of an improvement in this situation? In > principle, it's easy to work around; in practice, I forget the > limitation again and again, when I'm working with long convoluted > binding expressions, and end up with mysterious failures until I > remember "oh, yes, I'm not allowed to have whitespace where I want". > So fixing this would definitely make XSLTForms easier to use, for at > least this one user. > > best, > > Michael Sperberg-McQueen > |
From: Alain C. <ala...@ag...> - 2016-04-13 16:54:36
|
Winona, I think that the "xforms-submit-done" event is what you are looking for. Please have a look at this example: https://en.wikibooks.org/wiki/XForms/Web_Service_Tester So, with one button, the submission is sent then, when it's done, the selected text is set to the new value. Thank you for your feedback! --Alain Le 13/04/2016 17:18, Winona Salesky a écrit : > I'm attempting to use the new wrap and or setselection functions to > pass a selected text block to a search function, and then pass the > results of the search function back to the selection, replacing the > selected text with the results from the lookup; namely a URI as an > attribute of the element specified in the wrap function. > > Any hints on how to do this in as few button clicks for the user as > possible? I can accomplish this with two buttons, one to look up the > name, store the value in the instance('uri') which is used by the > wrap function. And then with a second to button to wrap the selected > text with the correct element and attribute stroed in the > instance('uri'). Am I overlooking a way to do this in one click? > Thanks for the helps, > -Winona > > > > > ------------------------------------------------------------------------------ > Find and fix application performance issues faster with Applications Manager > Applications Manager provides deep performance insights into multiple tiers of > your business applications. It resolves application problems quickly and > reduces your MTTR. Get your free trial! > https://ad.doubleclick.net/ddm/clk/302982198;130105516;z > > > _______________________________________________ > Xsltforms-support mailing list > Xsl...@li... > https://lists.sourceforge.net/lists/listinfo/xsltforms-support |
From: Winona S. <wsa...@gm...> - 2016-04-13 15:18:52
|
I'm attempting to use the new wrap and or setselection functions to pass a selected text block to a search function, and then pass the results of the search function back to the selection, replacing the selected text with the results from the lookup; namely a URI as an attribute of the element specified in the wrap function. Any hints on how to do this in as few button clicks for the user as possible? I can accomplish this with two buttons, one to look up the name, store the value in the instance('uri') which is used by the wrap function. And then with a second to button to wrap the selected text with the correct element and attribute stroed in the instance('uri'). Am I overlooking a way to do this in one click? Thanks for the helps, -Winona |
From: C. M. Sperberg-M. <cm...@bl...> - 2016-04-13 09:40:52
|
A few weeks ago, I ran into an issue with the transform() function in an XForm I wrote; since I think I have now found a solution (or at least a workaround), it may be worth reporting here. With luck, anyone else who has this problem will find the posting via a Web search. Symptom: when the transform() function is invoked in Safari (or in older versions of Chrome), the form emits an error alert (a modal dialog box) reading "TypeError: null is not an object (evaluating 'resultDocument.documentElement')". No result from the transform is visible. This problem arises with all versions of Safari I have tested (5.1.10 on an old machine, 9.0.1 on a newer machine) and older versions of Chrome (30, on the old machine). It does not arise in Firefox, Opera, or newer versions of Chrome (49). It also does not arise if in another tab I visit another page that uses the same stylesheet on a static document. Nor does it arise with all uses of the transform() function. This turns out to be a clue. A few hours of experimentation eventually showed me that the stylesheet being used had an xsl:import instruction, and a comparable form that worked properly in Safari used a simpler stylesheet, with no imports or includes. When I suppressed the xsl:import, the stylesheet started to work properly. (Once I managed to persuade Safari to clear its cache, that is.) So it appears that: in Safari and older versions of Chrome, the transform() function does not deal well with XSLT stylesheets that import (or include, probably, but I didn't look into it) other stylesheets. The obvious workaround is: make any stylesheet used by transform() a standalone stylesheet. (Or I suppose you could forbid your users to use Safari. My user, on the other hand, refuses to stop using Safari, and since he shares my desk, I can't just ignore him.) I have added a note on this topic to the discussion of the transform() function in the XSLTForms wikibook [1]. [1] https://en.wikibooks.org/wiki/XSLTForms/The_transform_function Regards, Michael Sperberg-McQueen -- **************************************************************** * C. M. Sperberg-McQueen, Black Mesa Technologies LLC * http://www.blackmesatech.com * http://cmsmcq.com/mib * http://balisage.net **************************************************************** |
From: C. M. Sperberg-M. <cm...@bl...> - 2016-04-13 02:09:06
|
[This mail seems to have gone missing somewhere between my outbox and the mailing list, so I am sending it a second time. Apologies for any duplication.] A few weeks ago, I ran into an issue with the transform() function in an XForm I wrote; since I think I have now found a solution (or at least a workaround), it may be worth reporting here. With luck, anyone else who has this problem will find the posting via a Web search. Symptom: when the transform() function is invoked in Safari (or in older versions of Chrome), the form emits an error alert (a modal dialog box) reading "TypeError: null is not an object (evaluating 'resultDocument.documentElement')". No result from the transform is visible. This problem arises with all versions of Safari I have tested (5.1.10 on an old machine, 9.0.1 on a newer machine) and older versions of Chrome (30, on the old machine). It does not arise in Firefox, Opera, or newer versions of Chrome (49). It also does not arise if in another tab I visit another page that uses the same stylesheet on a static document. Nor does it arise with all uses of the transform() function. This turns out to be a clue. A few hours of experimentation eventually showed me that the stylesheet being used had an xsl:import instruction, and a comparable form that worked properly in Safari used a simpler stylesheet, with no imports or includes. When I suppressed the xsl:import, the stylesheet started to work properly. (Once I managed to persuade Safari to clear its cache, that is.) So it appears that: in Safari and older versions of Chrome, the transform() function does not deal well with XSLT stylesheets that import (or include, probably, but I didn't look into it) other stylesheets. The obvious workaround is: make any stylesheet used by transform() a standalone stylesheet. (Or I suppose you could forbid your users to use Safari. My user, on the other hand, refuses to stop using Safari, and since he shares my desk, I can't just ignore him.) I have added a note on this topic to the discussion of the transform() function in the XSLTForms wikibook [1]. [1] https://en.wikibooks.org/wiki/XSLTForms/The_transform_function Regards, Michael Sperberg-McQueen -- **************************************************************** * C. M. Sperberg-McQueen, Black Mesa Technologies LLC * http://www.blackmesatech.com * http://cmsmcq.com/mib * http://balisage.net **************************************************************** |
From: C. M. Sperberg-M. <cm...@bl...> - 2016-04-12 23:33:44
|
Over the last few years, as I've used XSLTForms, I have occasionally stumbled over the way whitespace appears to be handled in XPath expressions. The XPath specs are not always as clear about it as they might be (in the sense that if you just look at the EBNF rules, you'll never discover the rule), but the general rule is that whitespace is allowed between any two tokens of an XPath. The last paragraph of section 1 in XPath 1.0 [1] says Expressions are parsed by first dividing the character string to be parsed into tokens and then parsing the resulting sequence of tokens. Whitespace can be freely used between tokens. The tokenization process is described in [3.7 Lexical Structure]. [1] http://www.w3.org/TR/xpath/#section-Introduction In XPath 2.0 [2], the clearest statement is in the definition of 'ignorable whitespace': [Definition: Ignorable whitespace consists of any whitespace characters that may occur between terminals, unless these characters occur in the context of a production marked with a ws:explicit annotation, in which case they can occur only where explicitly specified (see A.2.4.2 Explicit Whitespace Handling).] Ignorable whitespace characters are not significant to the semantics of an expression. Whitespace is allowed before the first terminal and after the last terminal of a module. Whitespace is allowed between any two terminals. Comments may also act as "whitespace" to prevent two adjacent terminals from being recognized as one. [2] http://www.w3.org/TR/xpath20/#IgnorableWhitespace As I understand these rules, they have the consequence that .[not(instance('trial')/self::trial/*[name(.)=name(current())])] ] is grammatically the same as .[not( instance('trial') /self::trial /* [name(.) = name(current())] ) ] Since I found the first one a bit convoluted, as I was constructing it, I really wanted to use the second form, which I find slightly easier to check for correctness. But the XPath parser used in XSLTForms (at least through 1.0RC2) seems to take the view that whitespace can be ignored only inside predicates. So to make the expression just given work in a form, I end up rewriting it without whitespace, or (if I insist on breaking the expression into multiple lines) in some form like .[ not(instance('trial')/self::trial/*[ name(.) = name(current())]) ] ] Is there any chance of an improvement in this situation? In principle, it's easy to work around; in practice, I forget the limitation again and again, when I'm working with long convoluted binding expressions, and end up with mysterious failures until I remember "oh, yes, I'm not allowed to have whitespace where I want". So fixing this would definitely make XSLTForms easier to use, for at least this one user. best, Michael Sperberg-McQueen -- **************************************************************** * C. M. Sperberg-McQueen, Black Mesa Technologies LLC * http://www.blackmesatech.com * http://cmsmcq.com/mib * http://balisage.net **************************************************************** |
From: Mats E. <mat...@li...> - 2016-04-11 21:47:13
|
Hi Alain, Just for background, many of these enhancements were necessary to make it possible to run XSLTForms as offline forms (compare InfoPath). - Some deeper changes were required to make XSLTForms work in Chrome App context. Google Chrome imposes some unfortunate restrictions on browser apps, including 1) banning synchronous XMLHttpRequests and 2) forbidding inline scripts. To cope with the former, XSLTForms' init functions had to be rewritten as async functions with continuation callbacks, and for the latter, xsltforms.xsl had to be extended with an option to output scripts into separate resource files (I am using an XSLT 2.0 stylesheet that includes xsltforms.xsl), which in turn required some changes to XSLTForms' subform loading scripts for example. Maybe such extensive changes are not required for apps in other browsers, however, Chrome still offers significant advantages (speed, app deployment options, ...) which justified these efforts. File access, as well as local storage access, required extending the submission module to interface with the chrome.fileSystem and chrome.storage.local APIs. - I implemented a separate transform() function in the saxon namespace, however I agree that the solution you propose would be much more elegant. The trickiest thing with including the SaxonCE library was to tweak it such that it loads synchronously as a normal js library! Having access to XSLT 2.0 can be quite useful in offline forms where one cannot call upon a server to do transformations, schematron validation etc.! - True, in Web Worker context there is no access to the page document object. A few deeper changes were required to XSLTForms code to allow fairly arbitrary XPath expressions to be evaluated in Web Worker context. Some of the XPath function implementations in XSLTForms depend on the page document object which is not available in Web Worker context and also not sensible to serialize. I solved it by making sure functions access all their resources via the XPath evaluation context object (which had to be extended with a reference to the XForms model object), and serialized to a proper depth. - For XML schema validation, I am calling the following library: https://github.com/hubgit/xml.js/tree/dtd-validation. I think it works in all browsers! - Both validation functions are currently XPath extension functions (maybe they could be implemented as extension actions instead -- or as emulated web-service operations accessible via the submission element so as to keep things standard?). I use them in my offline forms to validate instance documents opened by the user from the file system, or for validating form entries with an approach similar to this: http://wiki.orbeon.com/forms/how-to/logic/external-validation, not requiring calling an external service. I have them evaluated in a non-blocking background thread using the @async='true' extension. - parse-xml() (which by the way seems to be a standard function in a more recent version of XPath) replaces xf:setnode in the following way: <xf:insert nodeset="instance('data')" origin="parse-xml(transform(...))"/> (for example) - Another often needed improvement I've implemented is the xf:select1/@selection="open" (i.e. combobox). It's a simple change that leverages the HTML 5 @datalist. I will think how to best share these extensions! Whatever makes it easier to potentially have some of these make it into the official version! :) Kind regards,Mats On Sun, 10 Apr 2016 21:45:52 +0200 ala...@ag... wrote: Hi Mats, - Allowing XSLTForms to be run as Chrome Apps, with file save/open functionality etc. Could you please write some documentation about how you succeeded? It might be added in XSLTForms Wikibook, for example.- Embedding SaxonCE library so that transform() function can run XSLT2 transforms Have you modified the transform() function so that it is looking at the version of the stylesheet? Could this better be considered as a global option to be added in config files?- Adding @async attribute to xf:setvalue/xf:insert elements for non-blocking evaluation of long running XPath expressions in Web Workers Web Workers are not available in old browsers but all recent ones do now! I did not try to use them yet (priorities...) and I still wonder how they can access the XML DOM in the main page: is it a problem??- Adding validate-with-xml-schema() function, using xmllint library Is it that Chrome Apps allow you to link C libraries?- Adding validate-with-schematron() function, using SaxonCE. Useful for doing more advanced form validations using SVRL. Is it an XPath function? When are you calling it? Before submission? XForms is based on validation at node level whenever a value has been modified: do you think that it is also compatible with SVRL?- Adding parse-xml() function, believe replacing need for xf:setnode xf:setvalue is there to set a value not to import nodes... That's why I added xf:setnode with the serialized XML string as parameter. In what context do you use parse-xml()? Which document/instance owns the resulting nodes? Would be glad to contribute these as well as some other extensions and performance optimizations. Will be glad to look at them in details!! Is it your intent to publish source files independently or to fork the repository? Thanks! Alain |
From: Mats E. <mat...@li...> - 2016-04-11 21:43:46
|
Hi Alain, Thanks for your feedback! The option of extending the xf:load action seemed to be the most natural option in the end. It's quite similar to how download actions are written in HTML 5, and basically corresponds to option #2 in my initial posting on the topic, however, leveraging the existing XForms xf:load element and the standard extensibility slots instead of inventing a non-standard download element. Both option #3 and #4 seemed unnatural for the task in the end. With the numerous other extensions I had to do in my project I (temporarily) gave up the ability to do easy upgrades in the future. I may try to recover it at some point. For this one I had to do slight modifications to both xsltforms.xsl and xsltforms.js. However, this particular extension could probably be implemented in more of plug-in manner if extension attributes were exposed to script methods, as you suggest. In my implementation I also allow the filename parameter to be specified via either an attribute or a child element (similar to the resource attribute), but I guess this could still be catered for in some generic way. My custom XPath function "create-object-url(string-object, mediatype, encoding, lifetime)", which basically mimics the URL.createObjectURL() Javascript function, was necessary to add in order to make this work. It came in handy to solve some other problems as well. Such extensions to XSLTForms' XPath functions library are currently easy to add/plug-in. Like it should be! Kind regards,Mats On Sun, 10 Apr 2016 20:53:01 +0200 ala...@ag... wrote : Hi Mats, From the XForms Recommendation point of view, it is already possible to write an instance to disk using the "file:" protocol. As you know, for security reasons, browser vendors have decided not to allow file writing. XSLTForms includes a small Java applet which can write a file but, again for security reasons, I chose to first display the "Save as" dialog to alert the user and allow him/her to cancel this. XForms submissions have many attributes which can modify the serialization, concerning validation, relevance, for example. I am still perplex about the pertinence of defining submissions within the model: it sounds declarative but it might as well be considered as an action (and the submit action, indeed, has no parameter except the submission id...). Actions are written with an XML notation and I am not, also, that much convinced that a script notation would be worse. Because I am now implementing XQuery 3.1 in Javascript for XSLTForms v2, I am thinking of actions being written in XQuery syntax and annotations to bind XQuery functions to Javascript ones. Different XML-DB implementations already have their own XQuery library modules for standard purposes such as file management. Anyway, I am happy to see that you succeeded in implementing what you need and my current concern is now how new XSLTForms v1 releases might not disturb this... First, you added an attribute to the action: it means you had to modify xsltforms.xsl for generating the corresponding Javascript object. To prevent this, I should better expose all action attributes in the Javascript part not as separate parameters but as named properties (without namespace prefix...) within a unique Javascript object. What do you think? Of course, the load Javascript object in xsltforms.js has been extended... Do you have any idea about how to help you to manage this with next builds? Second, you are using your own functions in expressions. Are they pure Javascript functions or are they added to standard XPath functions. Actually, in both cases, you don't have to modify xsltforms.js, is that correct? Best regards, Alain Le 07/04/2016 23:08, Mats Eklund a écrit :Hi Alain, Thought I should share with you the solution I arrived at in the end for the problem how best to implement downloading of instances to disk: <xf:load target=”xsltforms:download” xsltforms:filename="data.xml"> <xf:resource value="create-object-url(serialize(instance('data')),'text/xml')"/></xf:load> Regards,Mats Date: Mon, 21 Sep 2015 09:09:13 +0000 Hi Alain, Somewhat related to my previous question how best leverage HTML 5 Web Workers for async processing in XForms/XsltForms, I now have a similar question, this time related to how best to leverage browsers' capability to allow downloading of resources client-side utilizing the HTML 5 @download attribute on the <a/> element combined with the URL.createObjectURL() method of the File API (http://www.w3.org/TR/FileAPI/#dfn-createObjectURL), and am interested to get your opinion on possible options of extending XsltForms. Obviously it is possible already now to leverage these features in XsltForms via the <xf:load resource="javascript:..."/> or <xf:script/> elements, but I'm thinking this functionality should rather be exposed through and encapsulated in a proper XForms extension element. I was first figuring around the following options: <xf:download ref/value=""/> as a control element, "mirroring" the <xf:upload/> control already part of the XForms specification<xf:download ref/value=""/> as an _action_ element, allowing it to be used in event handlers for the <xf:trigger/> element for example, similar to the <xf:load/> action element. (I'm wondering why the <xf:upload/> wasn't made an action element in XForms as well...?!) At the same time, other options also exist: A custom @appearance attribute on the <xf:output/> element (as in Orbeon Forms: http://wiki.orbeon.com/forms/doc/developer-guide/xforms-controls/output-control?pli=1#TOC-Appearance-xxforms:download)Extended behavior of the <xf:submission resource="file://" method="get/put".../> element... ... What are your thoughts here? Which option would make most sense in your view? Regards,Mats ------------------------------------------------------------------------------ _______________________________________________Xsltforms-support mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/xsltforms-support |
From: <bc...@sh...> - 2016-04-11 08:56:47
|
Hi Alain Pragmatism is an interesting concept at times :-) Any way, I was in no way suggesting stifling development if that is how you read my comment; it was just a high level point of principle consideration, to exercise trusted approaches and principles and ensure agreed standards and consistency (whatever that all means) and to avoid pitfalls. As I stated, I am not insinuating XSLTForms currently is any of what I said; nor was I doing any comparison. It is all good. Peace and good will. Regards Habs On 10 April 2016 at 22:06, Alain Couthures <ala...@ag...> wrote: > Hello Habs, > > A pragmatic approach is important: XForms recommendation cannot be seen as > a definitive solution for everything. It is important to know what is > missing in it, thanks to authors feedback. > > Comparing to Orbeon, XSLTForms has much less extensions... Each of them > have been analyzed in details in recommendation spirit. > > The main point is how to standardize approaches. Contributions are welcome > in XForms Users Community Group (https://www.w3.org/community/xformsusers/ > )! > > Regards, > > Alain > > Le 10/04/2016 22:14, bc...@sh... a écrit : > > Hello everyone > > I've been reading these enhancement suggestions (and others) and I realise > that the XForms specification allows for extensions and leaves things open > for implementation choices in some areas. > > My concern -- and I am saying the following (and perhaps with no great > qualification to do so) without insinuation that XSLTForms is going this > way -- is to ask that careful consideration be paid to sticking to XForms > published standards/specification and to watch carefully that the > implementation in XSLTForms does not grow into some application full of > non-standard and/or deviated approaches to meet a perceived shortcoming. > > What are your views ? > > Regards > Habs > > On 10 April 2016 at 20:45, Alain Couthures <ala...@ag...> > wrote: > >> Hi Mats, >> >> - Allowing XSLTForms to be run as Chrome Apps, with file save/open >> functionality etc. >> >> Could you please write some documentation about how you succeeded? It >> might be added in XSLTForms Wikibook, for example. >> >> - Embedding SaxonCE library so that transform() function can run XSLT2 >> transforms >> >> Have you modified the transform() function so that it is looking at the >> version of the stylesheet? Could this better be considered as a global >> option to be added in config files? >> >> - Adding @async attribute to xf:setvalue/xf:insert elements for >> non-blocking evaluation of long running XPath expressions in Web Workers >> >> Web Workers are not available in old browsers but all recent ones do now! >> I did not try to use them yet (priorities...) and I still wonder how they >> can access the XML DOM in the main page: is it a problem?? >> >> - Adding validate-with-xml-schema() function, using xmllint library >> >> Is it that Chrome Apps allow you to link C libraries? >> >> - Adding validate-with-schematron() function, using SaxonCE. Useful for >> doing more advanced form validations using SVRL. >> >> Is it an XPath function? When are you calling it? Before submission? >> XForms is based on validation at node level whenever a value has been >> modified: do you think that it is also compatible with SVRL? >> >> - Adding parse-xml() function, believe replacing need for xf:setnode >> >> xf:setvalue is there to set a value not to import nodes... That's why I >> added xf:setnode with the serialized XML string as parameter. In what >> context do you use parse-xml()? Which document/instance owns the resulting >> nodes? >> >> >> Would be glad to contribute these as well as some other extensions and >> performance optimizations. >> >> Will be glad to look at them in details!! Is it your intent to publish >> source files independently or to fork the repository? >> >> Thanks! >> >> Alain >> >> >> ------------------------------------------------------------------------------ >> Find and fix application performance issues faster with Applications >> Manager >> Applications Manager provides deep performance insights into multiple >> tiers of >> your business applications. It resolves application problems quickly and >> reduces your MTTR. Get your free trial! >> <http://pubads.g.doubleclick.net/%0Agampad/clk?id=1444514301&iu=/ca-pub-7940484522588532> >> http://pubads.g.doubleclick.net/ >> gampad/clk?id=1444514301&iu=/ca-pub-7940484522588532 >> _______________________________________________ >> Xsltforms-support mailing list >> Xsl...@li... >> https://lists.sourceforge.net/lists/listinfo/xsltforms-support >> >> > > |
From: Alain C. <ala...@ag...> - 2016-04-10 21:06:24
|
Hello Habs, A pragmatic approach is important: XForms recommendation cannot be seen as a definitive solution for everything. It is important to know what is missing in it, thanks to authors feedback. Comparing to Orbeon, XSLTForms has much less extensions... Each of them have been analyzed in details in recommendation spirit. The main point is how to standardize approaches. Contributions are welcome in XForms Users Community Group (https://www.w3.org/community/xformsusers/)! Regards, Alain Le 10/04/2016 22:14, bc...@sh... a écrit : > Hello everyone > > I've been reading these enhancement suggestions (and others) and I > realise that the XForms specification allows for extensions and leaves > things open for implementation choices in some areas. > > My concern -- and I am saying the following (and perhaps with no great > qualification to do so) without insinuation that XSLTForms is going > this way -- is to ask that careful consideration be paid to sticking > to XForms published standards/specification and to watch carefully > that the implementation in XSLTForms does not grow into some > application full of non-standard and/or deviated approaches to meet a > perceived shortcoming. > > What are your views ? > > Regards > Habs > > On 10 April 2016 at 20:45, Alain Couthures > <ala...@ag... <mailto:ala...@ag...>> > wrote: > > Hi Mats, > >> - Allowing XSLTForms to be run as Chrome Apps, with file >> save/open functionality etc. > Could you please write some documentation about how you succeeded? > It might be added in XSLTForms Wikibook, for example. >> - Embedding SaxonCE library so that transform() function can run >> XSLT2 transforms > Have you modified the transform() function so that it is looking > at the version of the stylesheet? Could this better be considered > as a global option to be added in config files? >> - Adding @async attribute to xf:setvalue/xf:insert elements for >> non-blocking evaluation of long running XPath expressions in Web >> Workers > Web Workers are not available in old browsers but all recent ones > do now! I did not try to use them yet (priorities...) and I still > wonder how they can access the XML DOM in the main page: is it a > problem?? >> - Adding validate-with-xml-schema() function, using xmllint library > Is it that Chrome Apps allow you to link C libraries? >> - Adding validate-with-schematron() function, using SaxonCE. >> Useful for doing more advanced form validations using SVRL. > Is it an XPath function? When are you calling it? Before > submission? XForms is based on validation at node level whenever a > value has been modified: do you think that it is also compatible > with SVRL? >> - Adding parse-xml() function, believe replacing need for xf:setnode > xf:setvalue is there to set a value not to import nodes... That's > why I added xf:setnode with the serialized XML string as > parameter. In what context do you use parse-xml()? Which > document/instance owns the resulting nodes? >> >> Would be glad to contribute these as well as some other >> extensions and performance optimizations. >> > Will be glad to look at them in details!! Is it your intent to > publish source files independently or to fork the repository? > > Thanks! > > Alain > > ------------------------------------------------------------------------------ > Find and fix application performance issues faster with > Applications Manager > Applications Manager provides deep performance insights into > multiple tiers of > your business applications. It resolves application problems > quickly and > reduces your MTTR. Get your free trial! > http://pubads.g.doubleclick.net/ > gampad/clk?id=1444514301&iu=/ca-pub-7940484522588532 > <http://pubads.g.doubleclick.net/%0Agampad/clk?id=1444514301&iu=/ca-pub-7940484522588532> > _______________________________________________ > Xsltforms-support mailing list > Xsl...@li... > <mailto:Xsl...@li...> > https://lists.sourceforge.net/lists/listinfo/xsltforms-support > > |
From: <bc...@sh...> - 2016-04-10 20:46:17
|
Hello everyone I've been reading these enhancement suggestions (and others) and I realise that the XForms specification allows for extensions and leaves things open for implementation choices in some areas. My concern -- and I am saying the following (and perhaps with no great qualification to do so) without insinuation that XSLTForms is going this way -- is to ask that careful consideration be paid to sticking to XForms published standards/specification and to watch carefully that the implementation in XSLTForms does not grow into some application full of non-standard and/or deviated approaches to meet a perceived shortcoming. What are your views ? Regards Habs On 10 April 2016 at 20:45, Alain Couthures <ala...@ag...> wrote: > Hi Mats, > > - Allowing XSLTForms to be run as Chrome Apps, with file save/open > functionality etc. > > Could you please write some documentation about how you succeeded? It > might be added in XSLTForms Wikibook, for example. > > - Embedding SaxonCE library so that transform() function can run XSLT2 > transforms > > Have you modified the transform() function so that it is looking at the > version of the stylesheet? Could this better be considered as a global > option to be added in config files? > > - Adding @async attribute to xf:setvalue/xf:insert elements for > non-blocking evaluation of long running XPath expressions in Web Workers > > Web Workers are not available in old browsers but all recent ones do now! > I did not try to use them yet (priorities...) and I still wonder how they > can access the XML DOM in the main page: is it a problem?? > > - Adding validate-with-xml-schema() function, using xmllint library > > Is it that Chrome Apps allow you to link C libraries? > > - Adding validate-with-schematron() function, using SaxonCE. Useful for > doing more advanced form validations using SVRL. > > Is it an XPath function? When are you calling it? Before submission? > XForms is based on validation at node level whenever a value has been > modified: do you think that it is also compatible with SVRL? > > - Adding parse-xml() function, believe replacing need for xf:setnode > > xf:setvalue is there to set a value not to import nodes... That's why I > added xf:setnode with the serialized XML string as parameter. In what > context do you use parse-xml()? Which document/instance owns the resulting > nodes? > > > Would be glad to contribute these as well as some other extensions and > performance optimizations. > > Will be glad to look at them in details!! Is it your intent to publish > source files independently or to fork the repository? > > Thanks! > > Alain > > > ------------------------------------------------------------------------------ > Find and fix application performance issues faster with Applications > Manager > Applications Manager provides deep performance insights into multiple > tiers of > your business applications. It resolves application problems quickly and > reduces your MTTR. Get your free trial! http://pubads.g.doubleclick.net/ > gampad/clk?id=1444514301&iu=/ca-pub-7940484522588532 > _______________________________________________ > Xsltforms-support mailing list > Xsl...@li... > https://lists.sourceforge.net/lists/listinfo/xsltforms-support > > |
From: Alain C. <ala...@ag...> - 2016-04-10 19:46:04
|
Hi Mats, > - Allowing XSLTForms to be run as Chrome Apps, with file save/open > functionality etc. Could you please write some documentation about how you succeeded? It might be added in XSLTForms Wikibook, for example. > - Embedding SaxonCE library so that transform() function can run XSLT2 > transforms Have you modified the transform() function so that it is looking at the version of the stylesheet? Could this better be considered as a global option to be added in config files? > - Adding @async attribute to xf:setvalue/xf:insert elements for > non-blocking evaluation of long running XPath expressions in Web Workers Web Workers are not available in old browsers but all recent ones do now! I did not try to use them yet (priorities...) and I still wonder how they can access the XML DOM in the main page: is it a problem?? > - Adding validate-with-xml-schema() function, using xmllint library Is it that Chrome Apps allow you to link C libraries? > - Adding validate-with-schematron() function, using SaxonCE. Useful > for doing more advanced form validations using SVRL. Is it an XPath function? When are you calling it? Before submission? XForms is based on validation at node level whenever a value has been modified: do you think that it is also compatible with SVRL? > - Adding parse-xml() function, believe replacing need for xf:setnode xf:setvalue is there to set a value not to import nodes... That's why I added xf:setnode with the serialized XML string as parameter. In what context do you use parse-xml()? Which document/instance owns the resulting nodes? > > Would be glad to contribute these as well as some other extensions and > performance optimizations. > Will be glad to look at them in details!! Is it your intent to publish source files independently or to fork the repository? Thanks! Alain |