xsltforms-support Mailing List for XSLTForms (Page 14)
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: Tim T. <tim...@gm...> - 2017-03-15 15:51:30
|
Hello, I have a conditional select1 that pulls values from a vocabulary loaded into an instance. It works well in Chrome and (reasonably) well in IE, although much more slowly. However, when I insert new repeated elements and trigger a setvalue action on xforms-value-changed, I run into an issue with Firefox. It's somewhat tricky to reproduce, but if I add new elements and change the conditional value (in the second select1) several times in quick succession (usually three or four times), Firefox crashes without warning. This is Firefox 52.0 on Windows 7. Attached is a sample test case and associated data file. Thanks in advance, Tim -- Tim A. Thompson Metadata Librarian (Spanish/Portuguese Specialty) Princeton University Library www.linkedin.com/in/timathompson ta...@pr... |
From: C. M. Sperberg-M. <cm...@bl...> - 2017-02-12 16:35:51
|
> On Feb 12, 2017, at 9:21 AM, Alain Couthures <ala...@ag...> wrote: > > Thank you very much for all these explanations! > > The proposed patch will be integrated in rev. 640. Thank you! You should have a pull request in your queue for xphoneforms at github, which may (or may not) simplify the change. > I have been able to build my own test form (I first forgot to add the > custom button names in "toolbar" and I had to replace the 2 "&lt;" > with "<" in the "insertElem" function). Thank you again. I was confused for a while over how fully one had to escape the angle brackets in that function to make things work, and then I was confused later over how fully one had to escape them to make the wik display them correctly. (I find wiki markup confusing — it’s like traveling back to text processing in the 1980s.) And I’ve added a ‘toolbar’ property to the init object in the example in the wiki. Michael > > --Alain > > Le 2/7/2017 à 3:58 AM, C. M. Sperberg-McQueen a écrit : >> I’ve written down what I think I have learned in the last few days >> about using TinyMCE from XSLTForms, in the XSLTForms wikibook: >> >> https://en.wikibooks.org/wiki/XSLTForms/TinyMCE >> >> If any readers find errors there, please fix them or tell me so I can >> fix them. >> >> The section on custom buttons may explain the changes I needed to make >> in XSLTForms 638 better than my earlier mails to the XSLTForms support >> list. (Or maybe not.) >> >> >> ******************************************** >> C. M. Sperberg-McQueen >> Black Mesa Technologies LLC >> cm...@bl... >> http://www.blackmesatech.com >> ******************************************** >> >> > > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, SlashDot.org! http://sdm.link/slashdot > _______________________________________________ > Xsltforms-support mailing list > Xsl...@li... > https://lists.sourceforge.net/lists/listinfo/xsltforms-support ******************************************** C. M. Sperberg-McQueen Black Mesa Technologies LLC cm...@bl... http://www.blackmesatech.com ******************************************** |
From: Alain C. <ala...@ag...> - 2017-02-12 16:21:21
|
Thank you very much for all these explanations! The proposed patch will be integrated in rev. 640. I have been able to build my own test form (I first forgot to add the custom button names in "toolbar" and I had to replace the 2 "&lt;" with "<" in the "insertElem" function). --Alain Le 2/7/2017 à 3:58 AM, C. M. Sperberg-McQueen a écrit : > I’ve written down what I think I have learned in the last few days > about using TinyMCE from XSLTForms, in the XSLTForms wikibook: > > https://en.wikibooks.org/wiki/XSLTForms/TinyMCE > > If any readers find errors there, please fix them or tell me so I can > fix them. > > The section on custom buttons may explain the changes I needed to make > in XSLTForms 638 better than my earlier mails to the XSLTForms support > list. (Or maybe not.) > > > ******************************************** > C. M. Sperberg-McQueen > Black Mesa Technologies LLC > cm...@bl... > http://www.blackmesatech.com > ******************************************** > > |
From: Alain C. <ala...@ag...> - 2017-02-12 16:17:34
|
The current version of TinyMCE is now 4.5.3 and I have succeeded in integrating it in XSLTForms. It appears that, with this version, the editor is not initialized enough when XSLTForms first tries to set its content. I had to add a try/catch statement to support this new behavior. This will be committed as soon as possible. Alain Le 1/9/2017 à 3:40 AM, C. M. Sperberg-McQueen a écrit : > Short summary: the current version of TinyMCE (4.5.2) > appears not to work with XSLTForms; the most > recent version of TinyMCE to work with XSLTForms (638) > appears to be 4.3.12 of 10 May 2016. > > Details: when I copy the demo file at [1] and point it to > a local copy of XSLTForms version 638, into which I > have installed TinyMCE 4.5.2 in the scripts/ subdirectory, > I get an error message along the lines of > > TypeError: undefined is not an object (evaluating ‘r.getRng()’) > > Both Safari 10.0 and Firefox 50.1.0 (under OS X 10.11.6) > exhibit this problem and complain about the same thing. > > TinyMCE 4.0.21, which is used by [1], does work, but is > not listed among the downloadable versions of TinyMCE > at [2]. > > A binary search through the versions between the two > suggests that versions up through 4.3.12 work with XSLTForms > 638, and versions from 4.3.13 onward fail. (Of course, > I haven’t tried them all, but 4.10, 4.2.7, 4.3.9, and 4.3.12 > all worked; 4.5.2, 4.5.1, 4.4.0, and 4.3.13 all failed.) The > testing done was very shallow: in all the ‘failure’ cases, > the ‘Loading’ message never went away, and the error > console showed an error (not always the one given above); > in the ‘success’ cases, the message went away and I > was successfully able to bold and unbold some characters. > > If at some point Alain tries to make XSLTForms work with > current versions of TinyMCE, perhaps knowing when things > broke will help. (And in the meantime, for users of XSLTForms > who use TinyMCE, it may be helpful to know which versions > work and which don’t.) > > In the meantime, if anyone has experience customizing > TinyMCE and using the customization in XSLTForms, and > has written up their experiences, I’d be grateful for a link > to the writeup. > > -C. M. Sperberg-McQueen > > [1] http://www.agencexml.com/xsltforms/tinymce.xml > [2] https://www.tinymce.com/download/older-releases/ > > ******************************************** > C. M. Sperberg-McQueen > Black Mesa Technologies LLC > cm...@bl... > http://www.blackmesatech.com > ******************************************** > > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, SlashDot.org! http://sdm.link/slashdot > _______________________________________________ > Xsltforms-support mailing list > Xsl...@li... > https://lists.sourceforge.net/lists/listinfo/xsltforms-support |
From: Conal T. <con...@gm...> - 2017-02-11 04:26:52
|
BTW if anyone's in a particular hurry for a version of XSLTForms that does "form-data-post" submissions, try https://github.com/Conal-Tuohy/Muscovy/tree/master/xsltforms On 11 February 2017 at 14:12, Conal Tuohy <con...@gm...> wrote: > > > On 11 February 2017 at 00:46, C. M. Sperberg-McQueen < > cm...@bl...> wrote: > >> >> What version of XSLTForms are you using? >> > > I am using XSLTForms rev.639 ... my fork of https://github.com/ > AlainCouthures/xsltforms > > The current draft of XForms 2.0 does define a serialize() function, and >> the snapshot of XSLTForms I downloaded last month from SourceForge >> does have an implementation of it. (Hmm. For that matter, so does >> 1.0RC2 — at least, the array XsltForms_xpathCoreFunctions defined >> in xsltforms.js has an entry for serialize.) >> > > Argh! How did I miss that? Thanks for the tip! I had been thinking > XSLTForms was XForms 1.1, and working from the XForms 1.1 spec, though I > did see the table of functions and simply missed serialize() even though it > was exactly what I was looking for! D'oh! > > I've used serialize() and it's perfect. > > You may need to serialize into another instance using xf:setvalue, just >> because >> > XForms isn’t always ready to accept values instead of references to values. >> > > This is exactly what I've done. I should be away laughing, now, I think. > >> >> And on another note — if you have just spent time figuring out how >> xf:upload >> works out of the box in XSLTForms, and how to modify XSLTForms to make it >> do what you actually needed, could you be persuaded to add a page to the >> XSLTForms wikibook describing what you learned? >> > > Yes I will ... first I will need to contribute the xsltforms changes back > to Alain somehow. I have (unwittingly) forked the wrong repository, it > seems, and because I couldn't get the build process going I simply edited > the xsltforms.js file directly, so I have a bit of work to do first. It's > still not a complete implementation of "form-data-post" since it only works > with instance elements whose type is "xsd:anyURI" and not the binary > content types. But still, it's enough I think. > > Alain, is it best for you if I fork https://github.com/ > AlainCouthures/xphoneforms repository, and make a pull request? > > Once I've contributed the patch to xsltforms.js, I will get onto wikibook > and document the process of using <xf:upload> to upload a binary file, and > the trick of using serialize() to upload XML instances as > multipart/form-data parameters. > > If every time a serious user of XSLTForms had trouble making something >> work, we made it a practice to write up what we learned and put it into >> the >> XSLTForms wikibook, to help the next user, the wikibook would soon be >> much more useful than it has been. (Even in a purely self-interested way, >> this can pay off. Every time I come back to using transform() after a >> long >> period of not thinking about it, I find myself trying to remember how it >> works, >> and so the time I spent writing a page on it in the wikibook a couple of >> years ago has now been paid back two or three times.) >> > > I know! I have only just got back to using XForms after a break of about 4 > years, so I've been consulting it a lot; it's been a very useful resource. > > Conal > > > > -- > Conal Tuohy > http://conaltuohy.com/ > @conal_tuohy > +61-466-324297 <0466%20324%20297> > -- Conal Tuohy http://conaltuohy.com/ @conal_tuohy +61-466-324297 |
From: Conal T. <con...@gm...> - 2017-02-11 04:13:01
|
On 11 February 2017 at 00:46, C. M. Sperberg-McQueen < cm...@bl...> wrote: > > What version of XSLTForms are you using? > I am using XSLTForms rev.639 ... my fork of https://github.com/AlainCouthures/xsltforms The current draft of XForms 2.0 does define a serialize() function, and > the snapshot of XSLTForms I downloaded last month from SourceForge > does have an implementation of it. (Hmm. For that matter, so does > 1.0RC2 — at least, the array XsltForms_xpathCoreFunctions defined > in xsltforms.js has an entry for serialize.) > Argh! How did I miss that? Thanks for the tip! I had been thinking XSLTForms was XForms 1.1, and working from the XForms 1.1 spec, though I did see the table of functions and simply missed serialize() even though it was exactly what I was looking for! D'oh! I've used serialize() and it's perfect. You may need to serialize into another instance using xf:setvalue, just > because > XForms isn’t always ready to accept values instead of references to values. > This is exactly what I've done. I should be away laughing, now, I think. > > And on another note — if you have just spent time figuring out how > xf:upload > works out of the box in XSLTForms, and how to modify XSLTForms to make it > do what you actually needed, could you be persuaded to add a page to the > XSLTForms wikibook describing what you learned? > Yes I will ... first I will need to contribute the xsltforms changes back to Alain somehow. I have (unwittingly) forked the wrong repository, it seems, and because I couldn't get the build process going I simply edited the xsltforms.js file directly, so I have a bit of work to do first. It's still not a complete implementation of "form-data-post" since it only works with instance elements whose type is "xsd:anyURI" and not the binary content types. But still, it's enough I think. Alain, is it best for you if I fork https://github.com/AlainCouthures/xphoneforms repository, and make a pull request? Once I've contributed the patch to xsltforms.js, I will get onto wikibook and document the process of using <xf:upload> to upload a binary file, and the trick of using serialize() to upload XML instances as multipart/form-data parameters. If every time a serious user of XSLTForms had trouble making something > work, we made it a practice to write up what we learned and put it into the > XSLTForms wikibook, to help the next user, the wikibook would soon be > much more useful than it has been. (Even in a purely self-interested way, > this can pay off. Every time I come back to using transform() after a long > period of not thinking about it, I find myself trying to remember how it > works, > and so the time I spent writing a page on it in the wikibook a couple of > years ago has now been paid back two or three times.) > I know! I have only just got back to using XForms after a break of about 4 years, so I've been consulting it a lot; it's been a very useful resource. Conal -- Conal Tuohy http://conaltuohy.com/ @conal_tuohy +61-466-324297 |
From: Tim T. <tim...@gm...> - 2017-02-10 17:30:33
|
Conal, I was also going to suggest using the transform() function with an identity template. Here's a working example that uses it with your fork of XSLTForms: http://timathom.github.io/xforms/upload.xhtml The service seems to require the filename in the Content-Disposition, so I just hard-coded in a temporary name (line 2001 of xsltforms.js). XSLTForms nicely provides access to the "response-body" object for the "xforms-submit-done" event (even though the spec only includes it for the xforms-submit-error event), so it's easy to insert that (assuming it's XML) into an XForms instance. I second Michael's suggestion of documenting your work in the Wikibook :) I've referred several times myself to the page he created to document the transform() function. -- Tim A. Thompson Metadata Librarian (Spanish/Portuguese Specialty) Princeton University Library www.linkedin.com/in/timathompson ta...@pr... On Fri, Feb 10, 2017 at 9:46 AM, C. M. Sperberg-McQueen < cm...@bl...> wrote: > > > On Feb 10, 2017, at 3:01 AM, Conal Tuohy <con...@gm...> wrote: > > ... > > > > So It seems to me, in order to send my XML as a form parameter, I need > to serialize the XML first, and then submit the serialization. I was hoping > that XForms would provide a custom "serialize()" function that would escape > my XML as text, or that there'd be some other obvious way to fix this, but > I haven't found anything. > > What version of XSLTForms are you using? > > The current draft of XForms 2.0 does define a serialize() function, and > the snapshot of XSLTForms I downloaded last month from SourceForge > does have an implementation of it. (Hmm. For that matter, so does > 1.0RC2 — at least, the array XsltForms_xpathCoreFunctions defined > in xsltforms.js has an entry for serialize.) > > The transform() function also produces a string (with the serialized form > of the XML in question), so the expression transform(instance(‘thisone’), > ’identity.xsl’,false) > should produce the string you want. > > > > > The only solution I can see is to use a recursive <xf:action> to walk my > XML instance's tree, gradually serializing it into a text node in another > instance, and then submit THAT instance. This seems awkward, but I'm sure > it's possible, and I'll do it if no-one can suggest anything better! > > Ooof! Well, that would work, I guess. But try serialize() and > transform() first. > You may need to serialize into another instance using xf:setvalue, just > because > XForms isn’t always ready to accept values instead of references to values. > > And on another note — if you have just spent time figuring out how > xf:upload > works out of the box in XSLTForms, and how to modify XSLTForms to make it > do what you actually needed, could you be persuaded to add a page to the > XSLTForms wikibook describing what you learned? > > If every time a serious user of XSLTForms had trouble making something > work, we made it a practice to write up what we learned and put it into the > XSLTForms wikibook, to help the next user, the wikibook would soon be > much more useful than it has been. (Even in a purely self-interested way, > this can pay off. Every time I come back to using transform() after a long > period of not thinking about it, I find myself trying to remember how it > works, > and so the time I spent writing a page on it in the wikibook a couple of > years ago has now been paid back two or three times.) > > ******************************************** > C. M. Sperberg-McQueen > Black Mesa Technologies LLC > cm...@bl... > http://www.blackmesatech.com > ******************************************** > > |
From: C. M. Sperberg-M. <cm...@bl...> - 2017-02-10 14:47:03
|
> On Feb 10, 2017, at 3:01 AM, Conal Tuohy <con...@gm...> wrote: > ... > > So It seems to me, in order to send my XML as a form parameter, I need to serialize the XML first, and then submit the serialization. I was hoping that XForms would provide a custom "serialize()" function that would escape my XML as text, or that there'd be some other obvious way to fix this, but I haven't found anything. What version of XSLTForms are you using? The current draft of XForms 2.0 does define a serialize() function, and the snapshot of XSLTForms I downloaded last month from SourceForge does have an implementation of it. (Hmm. For that matter, so does 1.0RC2 — at least, the array XsltForms_xpathCoreFunctions defined in xsltforms.js has an entry for serialize.) The transform() function also produces a string (with the serialized form of the XML in question), so the expression transform(instance(‘thisone’),’identity.xsl’,false) should produce the string you want. > > The only solution I can see is to use a recursive <xf:action> to walk my XML instance's tree, gradually serializing it into a text node in another instance, and then submit THAT instance. This seems awkward, but I'm sure it's possible, and I'll do it if no-one can suggest anything better! Ooof! Well, that would work, I guess. But try serialize() and transform() first. You may need to serialize into another instance using xf:setvalue, just because XForms isn’t always ready to accept values instead of references to values. And on another note — if you have just spent time figuring out how xf:upload works out of the box in XSLTForms, and how to modify XSLTForms to make it do what you actually needed, could you be persuaded to add a page to the XSLTForms wikibook describing what you learned? If every time a serious user of XSLTForms had trouble making something work, we made it a practice to write up what we learned and put it into the XSLTForms wikibook, to help the next user, the wikibook would soon be much more useful than it has been. (Even in a purely self-interested way, this can pay off. Every time I come back to using transform() after a long period of not thinking about it, I find myself trying to remember how it works, and so the time I spent writing a page on it in the wikibook a couple of years ago has now been paid back two or three times.) ******************************************** C. M. Sperberg-McQueen Black Mesa Technologies LLC cm...@bl... http://www.blackmesatech.com ******************************************** |
From: Conal T. <con...@gm...> - 2017-02-10 10:01:42
|
Thanks Tim, for your help! I have successfully added support for "form-data-post" submissions to XSLTForms and I've moved on to my next problem, which is this: The web service my form deals with expects me to post an XML document as a named parameter in the "multipart/form-data" format (which means using XForms submissions with method="form-data-post"). It expects a form-data parameter called "fileToConvert", containing my XML document (which I have in an XForms instance). I can do this when using an <xf:upload> to populate the submitted instance; I have an instance like this: <xf:instance id="uploaded-odd" xmlns=""> <ege-webservice-call> <fileToConvert xsi:type="xsd:anyURI"/> </ege-webservice-call> </xf:instance> ... and I have an <xf:upload> that is bound to the <fileToConvert> element. When the user selects a file to upload, the "file://" URI of that file is inserted into the fileToConvert element, and when the submission takes place, the CONTENT of that file is submitted in place of the URI. That all works sweetly. But that only works for content which has been set by an <xf:upload>. If I have an instance that contains the XML document I want to submit, I can't submit that entire document as a parameter, because the XForms specification says that only the "leaf" elements of my XML will be serialized as distinct parameters. I want to submit not the leaves, but the root (and the entire tree), of the document. It works with the <xf:upload> because <fileToConvert> contains only a text node (the file:// URI) and hence is a leaf. In general it seems to me that XForms' design is based on an expectation that you are either sending and receiving XML entities, or alternatively you are sending form parameters to legacy servers, but not a combination of both. So It seems to me, in order to send my XML as a form parameter, I need to serialize the XML first, and then submit the serialization. I was hoping that XForms would provide a custom "serialize()" function that would escape my XML as text, or that there'd be some other obvious way to fix this, but I haven't found anything. The only solution I can see is to use a recursive <xf:action> to walk my XML instance's tree, gradually serializing it into a text node in another instance, and then submit THAT instance. This seems awkward, but I'm sure it's possible, and I'll do it if no-one can suggest anything better! Ideas? Conal On 1 February 2017 at 06:57, Conal Tuohy <con...@gm...> wrote: > thanks Tim! > > What submission method did you use in ypur test? > > On 01/02/2017 3:20 am, "Tim Thompson" <tim...@gm...> wrote: > >> Hi, Conal, >> >> I'm not sure about the support for different serialization formats, but I >> did just test <xf:upload> with rev.638, and it worked for me (on Ubuntu): >> >> <xf:upload incremental="true" >> mediatype="application/xml" >> ref="instance('file-upload')/upload/file"> >> <xf:label>Select</xf:label> >> <xf:filename >> ref="instance('file-upload')/upload/file/@filename"/> <!-- >> Relative XPath doesn't seem to work here. --> >> </xf:upload> >> >> When I upload a file, the file contents are inserted into the <file> >> element in my "file-upload" instance, and I am able to POST the contents to >> a server. When I do an upload, I get a relative file name (no file:///). >> >> Hope this helps, >> Tim >> >> -- >> Tim A. Thompson >> Metadata Librarian (Spanish/Portuguese Specialty) >> Princeton University Library >> >> www.linkedin.com/in/timathompson >> ta...@pr... >> >> >> On Sun, Jan 29, 2017 at 9:02 AM, Conal Tuohy <con...@gm...> >> wrote: >> >>> I have had a lot of difficulty in getting a file upload to work, in >>> XSLTForms rev.638, on either Firefox 50.1.0 or Chrome 55.0.2883.87 on >>> Linux Mint. >>> >>> What I am trying to do is use an <xf:upload> to load a local XML file, >>> and submit it to a web service which will convert it into some other >>> format. The web service expects an HTTP POST, but I believe it is happy >>> with a serialization of "application/xml" or "multipart/form-data" and >>> possibly it may work with "multipart/related". I have tried the various >>> XForms methods "post", "form-data-post", and "multipart-post" without >>> success. >>> >>> I have tried a number of things. >>> >>> It appears to me that the "form-data-post" submission method is not >>> supported by XsltForms at all >>> >>> It seems (from reading the JS code) that the "multipart-post" IS >>> supported, however, it fails to correctly serialize my instance containing >>> the file:/// URI set by my xf:upload (the XML containing the URI is sent >>> instead of the content which the URI refers to, even though I have set the >>> xsi:type="xsd:anyURI"). The same problem happens with the "post" method. >>> >>> Is this known behaviour? I am puzzled because the W3 XForms 1.1 test >>> suite results at http://www.agencexml.com/xf >>> orms-tests/testsuite/XForms1.1/Edition1/driverPages/forms/XF >>> 11_TestSuite.xhtml indicate that "form-data-post" should work. >>> >>> I would appreciate any clarification about this is supposed to work, or >>> advice as to what functionality is missing. >>> >>> Thanks! >>> >>> >>> Conal >>> >>> >>> >>> -- >>> Conal Tuohy >>> http://conaltuohy.com/ >>> @conal_tuohy >>> +61-466-324297 <+61%20466%20324%20297> >>> >>> ------------------------------------------------------------ >>> ------------------ >>> Check out the vibrant tech community on one of the world's most >>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot >>> _______________________________________________ >>> Xsltforms-support mailing list >>> Xsl...@li... >>> https://lists.sourceforge.net/lists/listinfo/xsltforms-support >>> >>> >> -- Conal Tuohy http://conaltuohy.com/ @conal_tuohy +61-466-324297 |
From: Tim T. <tim...@gm...> - 2017-02-07 15:32:22
|
Thank you, Michael. You've done us a great service by documenting this in an exemplary fashion. The metadata department at my library is currently planning a markup project for which this should come in quite handy. I look forward to making use of your work. Tim -- Tim A. Thompson Metadata Librarian (Spanish/Portuguese Specialty) Princeton University Library www.linkedin.com/in/timathompson ta...@pr... On Tue, Feb 7, 2017 at 10:23 AM, C. M. Sperberg-McQueen < cm...@bl...> wrote: > > > On Feb 6, 2017, at 8:04 PM, Conal Tuohy <con...@gm...> wrote: > > > > I noticed this para seemed odd: https://en.wikibooks.org/w/ > index.php?title=XSLTForms/TinyMCE&action=edit§ion=14 > > > > XSLTForms 638 supports both version 3 and version 4 of TinyMCE; the > minimal example of TinyMCE given on the AgenceXML web site uses XSLTForms > 4.0.28. > > > > Did you mean, at the end of that sentence, to refer to TinyMCE 4.0.28? > > > > I did; fixed now. Thanks! > > ******************************************** > C. M. Sperberg-McQueen > Black Mesa Technologies LLC > cm...@bl... > http://www.blackmesatech.com > ******************************************** > > > ------------------------------------------------------------ > ------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, SlashDot.org! http://sdm.link/slashdot > _______________________________________________ > Xsltforms-support mailing list > Xsl...@li... > https://lists.sourceforge.net/lists/listinfo/xsltforms-support > |
From: C. M. Sperberg-M. <cm...@bl...> - 2017-02-07 15:23:39
|
> On Feb 6, 2017, at 8:04 PM, Conal Tuohy <con...@gm...> wrote: > > I noticed this para seemed odd: https://en.wikibooks.org/w/index.php?title=XSLTForms/TinyMCE&action=edit§ion=14 > > XSLTForms 638 supports both version 3 and version 4 of TinyMCE; the minimal example of TinyMCE given on the AgenceXML web site uses XSLTForms 4.0.28. > > Did you mean, at the end of that sentence, to refer to TinyMCE 4.0.28? > I did; fixed now. Thanks! ******************************************** C. M. Sperberg-McQueen Black Mesa Technologies LLC cm...@bl... http://www.blackmesatech.com ******************************************** |
From: Conal T. <con...@gm...> - 2017-02-07 03:04:55
|
I noticed this para seemed odd: https://en.wikibooks.org/w/index.php?title=XSLTForms/TinyMCE&action=edit§ion=14 XSLTForms 638 supports both version 3 and version 4 of TinyMCE; the minimal > example of TinyMCE given on the AgenceXML web site uses XSLTForms 4.0.28. Did you mean, at the end of that sentence, to refer to *TinyMCE* 4.0.28? On 7 February 2017 at 12:58, C. M. Sperberg-McQueen < cm...@bl...> wrote: > I’ve written down what I think I have learned in the last few days > about using TinyMCE from XSLTForms, in the XSLTForms wikibook: > > https://en.wikibooks.org/wiki/XSLTForms/TinyMCE > > If any readers find errors there, please fix them or tell me so I can > fix them. > -- Conal Tuohy http://conaltuohy.com/ @conal_tuohy +61-466-324297 |
From: C. M. Sperberg-M. <cm...@bl...> - 2017-02-07 02:58:41
|
I’ve written down what I think I have learned in the last few days about using TinyMCE from XSLTForms, in the XSLTForms wikibook: https://en.wikibooks.org/wiki/XSLTForms/TinyMCE If any readers find errors there, please fix them or tell me so I can fix them. The section on custom buttons may explain the changes I needed to make in XSLTForms 638 better than my earlier mails to the XSLTForms support list. (Or maybe not.) ******************************************** C. M. Sperberg-McQueen Black Mesa Technologies LLC cm...@bl... http://www.blackmesatech.com ******************************************** |
From: C. M. Sperberg-M. <cm...@bl...> - 2017-02-06 21:31:21
|
> On Feb 6, 2017, at 1:30 PM, Alain Couthures <ala...@ag...> wrote: > > Customizing TinyMCE with XSLTForms is based on the definition of a data > type with corresponding parameters. > > Please have a look at http://www.agencexml.com/xsltforms/tinymce.xml I have studied it in some detail, thank you! It was where I started my current attempt to use TinyMCE. > <schema xmlns="http://www.w3.org/2001/XMLSchema" > targetNamespace="http://www.agencexml.com/xsltforms/rte"> > <simpleType name="standardHTML"> > <restriction base="xforms:HTMLFragment" xsltforms:rte="TinyMCE"/> > <annotation> > <appinfo> > { > plugins: [ > "advlist autolink lists link image charmap > print preview anchor", > "searchreplace visualblocks code fullscreen", > "insertdatetime media table contextmenu paste" > ], > toolbar: "insertfile undo redo | styleselect | bold > italic | alignleft aligncenter alignright alignjustify | bullist numlist > outdent indent | link image" > } > </appinfo> > </annotation> > </simpleType> > </schema> > … > As you can guess, the appinfo content is copied with the following > instruction in the initInput method: eval("initinfo = " + (type.appinfo > ? type.appinfo.replace(/(\r\n|\n|\r)/gm, " ") : "{}")); > > Is it what you are looking for? Thank you for your feedback! It’s close, but the problem is that it does not quite do what I need. Consider the following appinfo element: <xsd:appinfo> { /* These customizations all work as expected … */ plugins: [ "code" ], toolbar: 'undo redo | insertperson insertprocedure italic | bullist', content_css: 'test-mce.css', custom_elements: "charge,~person,~procedure,en", valid_elements: "charge,p,i,person[pid],procedure[pid],en”, /* The following customization does not work as expected */ setup: function(editor) { function insertPerson () { insertElem('person'); } function insertProc () { insertElem('procedure'); } function insertElem(gi) { var s = '&lt;' + gi + '>' + editor.selection.getContent() + '&lt;/' + gi + '>'; editor.insertContent(s); } editor.addButton('insertperson', { text: "Person", onclick: insertPerson, tooltip: "Insert person element" }); editor.addButton('insertprocedure', { text: "Procedure", onclick: insertProc, tooltip: "Insert procedure element" }); } }</xsd:appinfo> This appinfo defines an object to be passed to the TinyMCE init() function; it customizes the selection of plugins, adjusts the toolbar, gives a stylesheet for elements within the TinyMCE editor, and declares a few custom elements, using the properties ‘plugins’, ’toolbar’, etc. These properties all work here in the same way as they do when TinyMCE is used directly (without XSLTForms). But the appinfo above also attempts to customize the editor by providing a ’setup’ property, whose value is a function. TinyMCE calls the setup() function during initialization, passing the editor object as an argument, so the setup function can do things like adding buttons (as shown above). The setup() function shown above has the expected effect (it adds buttons labeled ‘Person’ and ‘Procedure’ to the toolbar) in a native TinyMCE example [1]. But it does not have the desired effect with XSLTForms 638 [2], because the function XsltForms_input.prototype.initInput overwrites the ‘setup’ property with a different function. The user-specified ‘setup’ function is lost. [1] http://tlrr.blackmesatech.com/2017/02/tests/tinymce.xhtml [2] http://tlrr.blackmesatech.com/2017/02/tests/xsltforms.xhtml If the user’s appinfo element cannot specify a setup() function, then (as far as I can tell from the TinyMCE documentation) the user cannot add custom buttons to the editor. The code changes shown below illustrate one possible modification to xsltforms.js, to allow the user to specify setup code. We want to execute both the user’s setup code and XSLTForms’ setup code (which sets functions for events KeyUp, Change, Undo, and Redo). So we make the setup() function we supply to TinyMCE call a user callback function (placed in property Xsltforms_usersetup) and then run the XSLTForms setup code. For TinyMCE 4.*.*, the setup() function will look like this: initinfo.setup = function(ed) { initinfo.Xsltforms_usersetup(ed); ed.on("KeyUp", function() { XsltForms_control.getXFElement(document.getElementById(this.id)).valueChanged(this.getContent() || ""); }); ed.on("Change", function(ed) { XsltForms_control.getXFElement(document.getElementById(this.id)).valueChanged(ed.target.getContent() || ""); }); ed.on("Undo", function(ed) { XsltForms_control.getXFElement(document.getElementById(this.id)).valueChanged(ed.target.getContent() || ""); }); ed.on("Redo", function(ed) { XsltForms_control.getXFElement(document.getElementById(this.id)).valueChanged(ed.target.getContent() || ""); }); }; The only change here vis-a-vis XSLTForms 638 is the insertion of the first line: initinfo.Xsltforms_usersetup(ed); If the user supplies a function as the value of property Xsltforms_usersetup, then it's executed when setup() is executed. Otherwise, we need to supply a default function. So before the setup() function is defined, we insert the assignment initinfo.Xsltforms_usersetup = (initinfo.Xsltforms_usersetup ? initinfo.Xsltforms_usersetup : function (ed) {} ); So that if the user does NOT supply a value for the property, a vacuous function is called instead. There may be better ways to allow the user to specify code to be executed at setup time, and if you find one I'll be happy. I have modified xsltforms.js (version 638) on my server in the way described above (and below), and can confirm that the resulting form functions as expected [3], provided that in the appinfo element the property name ‘setup’ is replaced by the name ‘Xsltforms_usersetup’. [3] http://tlrr.blackmesatech.com/2017/02/tests/xsltforms.userexit.xhtml I hope this helps clarify my proposal. —Michael p.s. Working through the code again now, it occurs to me that it might be less surprising for users if the user’s appinfo element could use the name ‘setup’ instead of a different name. Then the user who reads the description of setup() in the TinyMCE documentation would not have to learn a different name for it. If after the line 'initinfo.mode = "none”;’ the default user exit were defined not as shown above but in the following way, the user could suppy a ‘setup’ property and things would work as the user might expect. initinfo.Xsltforms_usersetup = (initinfo.setup ? initinfo.setup : function (ed) {} ); > > --Alain > > Le 2/6/2017 à 8:18 PM, C. M. Sperberg-McQueen a écrit : >>> On Feb 6, 2017, at 9:15 AM, C. M. Sperberg-McQueen <cm...@bl...> wrote: >>> >>> >>>> On Feb 5, 2017, at 2:38 PM, C. M. Sperberg-McQueen <cm...@bl...> wrote: >>>> >>>> Short description: I don't seem to be having any luck making custom >>>> buttons work with TinyMCE in XSLTForms. Can anyone help? >>> ... >>> It might be cleaner to add a user hook to the default setup() >>> function. That is, if the user supplies a property named (say) >>> ‘Xsltforms_usersetup’ in the TinyMCE initialization object, then >>> the default setup function calls that user-supplied function. >> A preliminary test suggests that this modification will work. >> >> I made the following changes to xsltforms.js, all to the function >> XsltForms_input.prototype.initinput. >> >> 1 After the line reading 'initinfo.mode = “none”;’, I inserted >> >> /* MSM 20170206 add initinfo.Xsltforms_usersetup property to allow user contributions to setup() */ >> initinfo.Xsltforms_usersetup = (initinfo.Xsltforms_usersetup ? initinfo.Xsltforms_usersetup : function (ed) {} ); >> >> 2 In each of the two versions of initinfo.setup I added a call to >> initinfo.xsltforms_usersetup(), so the first lines of the assignment >> read >> >> initinfo.setup = function(ed) { >> /* MSM 20170206 user exit for setup() */ >> initinfo.Xsltforms_usersetup(ed); >> >> In addition, in the XForm itself, I changed the content of >> the xsd:appinfo element for simple type ‘standardHTML’, >> so that instead of supplying a setup property, it supplies >> a property named Xsltforms_usersetup. >> >> The result can be seen at [1]. There is a great deal of room >> for improvement, but the buttons are showing up, and the >> functions associated with them are executing. (I have not >> attempted any thorough testing.) >> >> [1] http://tlrr.blackmesatech.com/2017/02/tests/xsltforms.userexit.xhtml >> >> Alain, is it feasible to integrate this (or a better) way of allowing >> user input to the TinyMCE setup() function in the production version >> of XSLTForms? What do you think? ******************************************** C. M. Sperberg-McQueen Black Mesa Technologies LLC cm...@bl... http://www.blackmesatech.com ******************************************** |
From: Alain C. <ala...@ag...> - 2017-02-06 20:44:23
|
Customizing TinyMCE with XSLTForms is based on the definition of a data type with corresponding parameters. Please have a look at http://www.agencexml.com/xsltforms/tinymce.xml <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.agencexml.com/xsltforms/rte"> <simpleType name="standardHTML"> <restriction base="xforms:HTMLFragment" xsltforms:rte="TinyMCE"/> <annotation> <appinfo> { plugins: [ "advlist autolink lists link image charmap print preview anchor", "searchreplace visualblocks code fullscreen", "insertdatetime media table contextmenu paste" ], toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image" } </appinfo> </annotation> </simpleType> </schema> <instance id="main"> <data xmlns=""> <richtext><p>Paragraph <i>number one</i></p></richtext> </data> </instance> <bind nodeset="richtext" type="rte:standardHTML"/> As you can guess, the appinfo content is copied with the following instruction in the initInput method: eval("initinfo = " + (type.appinfo ? type.appinfo.replace(/(\r\n|\n|\r)/gm, " ") : "{}")); Is it what you are looking for? Thank you for your feedback! --Alain Le 2/6/2017 à 8:18 PM, C. M. Sperberg-McQueen a écrit : >> On Feb 6, 2017, at 9:15 AM, C. M. Sperberg-McQueen <cm...@bl...> wrote: >> >> >>> On Feb 5, 2017, at 2:38 PM, C. M. Sperberg-McQueen <cm...@bl...> wrote: >>> >>> Short description: I don't seem to be having any luck making custom >>> buttons work with TinyMCE in XSLTForms. Can anyone help? >> Perhaps I see the source of the problem. >> >> Looking at xsltforms.js this morning, I see that the function >> XsltForms_input.prototype.initInput unconditionally assigns a >> value to initinfo.setup; ... >> It might be cleaner to add a user hook to the default setup() >> function. That is, if the user supplies a property named (say) >> ‘Xsltforms_usersetup’ in the TinyMCE initialization object, then >> the default setup function calls that user-supplied function. > A preliminary test suggests that this modification will work. > > I made the following changes to xsltforms.js, all to the function > XsltForms_input.prototype.initinput. > > 1 After the line reading 'initinfo.mode = “none”;’, I inserted > > /* MSM 20170206 add initinfo.Xsltforms_usersetup property to allow user contributions to setup() */ > initinfo.Xsltforms_usersetup = (initinfo.Xsltforms_usersetup ? initinfo.Xsltforms_usersetup : function (ed) {} ); > > 2 In each of the two versions of initinfo.setup I added a call to > initinfo.xsltforms_usersetup(), so the first lines of the assignment > read > > initinfo.setup = function(ed) { > /* MSM 20170206 user exit for setup() */ > initinfo.Xsltforms_usersetup(ed); > > In addition, in the XForm itself, I changed the content of > the xsd:appinfo element for simple type ‘standardHTML’, > so that instead of supplying a setup property, it supplies > a property named Xsltforms_usersetup. > > The result can be seen at [1]. There is a great deal of room > for improvement, but the buttons are showing up, and the > functions associated with them are executing. (I have not > attempted any thorough testing.) > > [1] http://tlrr.blackmesatech.com/2017/02/tests/xsltforms.userexit.xhtml > > Alain, is it feasible to integrate this (or a better) way of allowing > user input to the TinyMCE setup() function in the production version > of XSLTForms? What do you think? > > best, > > Michael > > ******************************************** > C. M. Sperberg-McQueen > Black Mesa Technologies LLC > cm...@bl... > http://www.blackmesatech.com > ******************************************** > > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, SlashDot.org! http://sdm.link/slashdot > _______________________________________________ > Xsltforms-support mailing list > Xsl...@li... > https://lists.sourceforge.net/lists/listinfo/xsltforms-support |
From: C. M. Sperberg-M. <cm...@bl...> - 2017-02-06 19:18:17
|
> On Feb 6, 2017, at 9:15 AM, C. M. Sperberg-McQueen <cm...@bl...> wrote: > > >> On Feb 5, 2017, at 2:38 PM, C. M. Sperberg-McQueen <cm...@bl...> wrote: >> >> Short description: I don't seem to be having any luck making custom >> buttons work with TinyMCE in XSLTForms. Can anyone help? > > Perhaps I see the source of the problem. > > Looking at xsltforms.js this morning, I see that the function > XsltForms_input.prototype.initInput unconditionally assigns a > value to initinfo.setup; ... > It might be cleaner to add a user hook to the default setup() > function. That is, if the user supplies a property named (say) > ‘Xsltforms_usersetup’ in the TinyMCE initialization object, then > the default setup function calls that user-supplied function. A preliminary test suggests that this modification will work. I made the following changes to xsltforms.js, all to the function XsltForms_input.prototype.initinput. 1 After the line reading 'initinfo.mode = “none”;’, I inserted /* MSM 20170206 add initinfo.Xsltforms_usersetup property to allow user contributions to setup() */ initinfo.Xsltforms_usersetup = (initinfo.Xsltforms_usersetup ? initinfo.Xsltforms_usersetup : function (ed) {} ); 2 In each of the two versions of initinfo.setup I added a call to initinfo.xsltforms_usersetup(), so the first lines of the assignment read initinfo.setup = function(ed) { /* MSM 20170206 user exit for setup() */ initinfo.Xsltforms_usersetup(ed); In addition, in the XForm itself, I changed the content of the xsd:appinfo element for simple type ‘standardHTML’, so that instead of supplying a setup property, it supplies a property named Xsltforms_usersetup. The result can be seen at [1]. There is a great deal of room for improvement, but the buttons are showing up, and the functions associated with them are executing. (I have not attempted any thorough testing.) [1] http://tlrr.blackmesatech.com/2017/02/tests/xsltforms.userexit.xhtml Alain, is it feasible to integrate this (or a better) way of allowing user input to the TinyMCE setup() function in the production version of XSLTForms? What do you think? best, Michael ******************************************** C. M. Sperberg-McQueen Black Mesa Technologies LLC cm...@bl... http://www.blackmesatech.com ******************************************** |
From: C. M. Sperberg-M. <cm...@bl...> - 2017-02-06 16:15:16
|
> On Feb 5, 2017, at 2:38 PM, C. M. Sperberg-McQueen <cm...@bl...> wrote: > > Short description: I don't seem to be having any luck making custom > buttons work with TinyMCE in XSLTForms. Can anyone help? Perhaps I see the source of the problem. Looking at xsltforms.js this morning, I see that the function XsltForms_input.prototype.initInput unconditionally assigns a value to initinfo.setup; unless I am even more confused than usual, this will have the side effect of ignoring any value supplied by the user for the ’setup’ property of the TinyMCE initialization object. (That would explain why my buttons aren’t showing up.) I suppose one could simply say “If the user has supplied a setup() function, use it”, and make it the user’s responsibility to define the appropriate actions for the KeyUp, Change, Undo, and Redo events (by copying what’s in those lines of xsltforms.js). It might be cleaner to add a user hook to the default setup() function. That is, if the user supplies a property named (say) ‘Xsltforms_usersetup’ in the TinyMCE initialization object, then the default setup function calls that user-supplied function. What do you think? ******************************************** C. M. Sperberg-McQueen Black Mesa Technologies LLC cm...@bl... http://www.blackmesatech.com ******************************************** |
From: C. M. Sperberg-M. <cm...@bl...> - 2017-02-05 21:38:38
|
Short description: I don't seem to be having any luck making custom buttons work with TinyMCE in XSLTForms. Can anyone help? Details: I am trying to use TinyMCE as an embedded editor for the mixed-content elements in a project. So far, I seem to have gotten partway to where I want to be -- but not all the way. I have managed to - identify what appears to be the most version of TinyMCE 4 that does not freeze the form (version 4.3.12); - add the appropriate XML elements to the editor as 'custom elements'; - customize the list of 'valid elements' to include only my custom elements and the XHTML elements which have the same local names as elements in the project's XML vocabulary; - style the new phrase-level elements, so the user can see that a given sequence of characters is or is not tagged as a person's name or as another phrase-level element. The next step I'd like to take is to add custom buttons and menu items for tagging and untagging phrase-level elements. The sample page at [1] illustrates the addition of two buttons to a TinyMCE editor instance, for tagging phrases as 'person' or (legal) 'procedure'. They could work better (they could be used to untag the phrase, as the 'I' button can), but they manage to insert tags into the data. The sample page at [2] shows the same customization of the same version of TinyMCE, called through XSLTForms; the buttons don't appear in the interface. [1] http://tlrr.blackmesatech.com/2017/02/tests/tinymce.xhtml [2] http://tlrr.blackmesatech.com/2017/02/tests/xsltforms.xhtml Apparently I'm doing something wrong. Undying gratitude and as much beer as you can drink, the next time we are at a conference together, await the reader of this list who can help me find and fix the problem. Michael Sperberg-McQueen ******************************************** C. M. Sperberg-McQueen Black Mesa Technologies LLC cm...@bl... http://www.blackmesatech.com ******************************************** |
From: Tim T. <tim...@gm...> - 2017-01-31 21:29:53
|
I just used POST, without specifying a serialization format (so I guess it defaults to application/xml). The submission has an XML wrapper element that contains the unparsed XML string content of the file I uploaded. Any luck with it? Tim -- Tim A. Thompson Metadata Librarian (Spanish/Portuguese Specialty) Princeton University Library www.linkedin.com/in/timathompson ta...@pr... On Tue, Jan 31, 2017 at 3:57 PM, Conal Tuohy <con...@gm...> wrote: > thanks Tim! > > What submission method did you use in ypur test? > > On 01/02/2017 3:20 am, "Tim Thompson" <tim...@gm...> wrote: > >> Hi, Conal, >> >> I'm not sure about the support for different serialization formats, but I >> did just test <xf:upload> with rev.638, and it worked for me (on Ubuntu): >> >> <xf:upload incremental="true" >> mediatype="application/xml" >> ref="instance('file-upload')/upload/file"> >> <xf:label>Select</xf:label> >> <xf:filename >> ref="instance('file-upload')/upload/file/@filename"/> <!-- >> Relative XPath doesn't seem to work here. --> >> </xf:upload> >> >> When I upload a file, the file contents are inserted into the <file> >> element in my "file-upload" instance, and I am able to POST the contents to >> a server. When I do an upload, I get a relative file name (no file:///). >> >> Hope this helps, >> Tim >> >> -- >> Tim A. Thompson >> Metadata Librarian (Spanish/Portuguese Specialty) >> Princeton University Library >> >> www.linkedin.com/in/timathompson >> ta...@pr... >> >> >> On Sun, Jan 29, 2017 at 9:02 AM, Conal Tuohy <con...@gm...> >> wrote: >> >>> I have had a lot of difficulty in getting a file upload to work, in >>> XSLTForms rev.638, on either Firefox 50.1.0 or Chrome 55.0.2883.87 on >>> Linux Mint. >>> >>> What I am trying to do is use an <xf:upload> to load a local XML file, >>> and submit it to a web service which will convert it into some other >>> format. The web service expects an HTTP POST, but I believe it is happy >>> with a serialization of "application/xml" or "multipart/form-data" and >>> possibly it may work with "multipart/related". I have tried the various >>> XForms methods "post", "form-data-post", and "multipart-post" without >>> success. >>> >>> I have tried a number of things. >>> >>> It appears to me that the "form-data-post" submission method is not >>> supported by XsltForms at all >>> >>> It seems (from reading the JS code) that the "multipart-post" IS >>> supported, however, it fails to correctly serialize my instance containing >>> the file:/// URI set by my xf:upload (the XML containing the URI is sent >>> instead of the content which the URI refers to, even though I have set the >>> xsi:type="xsd:anyURI"). The same problem happens with the "post" method. >>> >>> Is this known behaviour? I am puzzled because the W3 XForms 1.1 test >>> suite results at http://www.agencexml.com/xf >>> orms-tests/testsuite/XForms1.1/Edition1/driverPages/forms/XF >>> 11_TestSuite.xhtml indicate that "form-data-post" should work. >>> >>> I would appreciate any clarification about this is supposed to work, or >>> advice as to what functionality is missing. >>> >>> Thanks! >>> >>> >>> Conal >>> >>> >>> >>> -- >>> Conal Tuohy >>> http://conaltuohy.com/ >>> @conal_tuohy >>> +61-466-324297 <+61%20466%20324%20297> >>> >>> ------------------------------------------------------------ >>> ------------------ >>> Check out the vibrant tech community on one of the world's most >>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot >>> _______________________________________________ >>> Xsltforms-support mailing list >>> Xsl...@li... >>> https://lists.sourceforge.net/lists/listinfo/xsltforms-support >>> >>> >> |
From: Conal T. <con...@gm...> - 2017-01-31 20:57:59
|
thanks Tim! What submission method did you use in ypur test? On 01/02/2017 3:20 am, "Tim Thompson" <tim...@gm...> wrote: > Hi, Conal, > > I'm not sure about the support for different serialization formats, but I > did just test <xf:upload> with rev.638, and it worked for me (on Ubuntu): > > <xf:upload incremental="true" > mediatype="application/xml" > ref="instance('file-upload')/upload/file"> > <xf:label>Select</xf:label> > <xf:filename > ref="instance('file-upload')/upload/file/@filename"/> <!-- > Relative XPath doesn't seem to work here. --> > </xf:upload> > > When I upload a file, the file contents are inserted into the <file> > element in my "file-upload" instance, and I am able to POST the contents to > a server. When I do an upload, I get a relative file name (no file:///). > > Hope this helps, > Tim > > -- > Tim A. Thompson > Metadata Librarian (Spanish/Portuguese Specialty) > Princeton University Library > > www.linkedin.com/in/timathompson > ta...@pr... > > > On Sun, Jan 29, 2017 at 9:02 AM, Conal Tuohy <con...@gm...> > wrote: > >> I have had a lot of difficulty in getting a file upload to work, in >> XSLTForms rev.638, on either Firefox 50.1.0 or Chrome 55.0.2883.87 on >> Linux Mint. >> >> What I am trying to do is use an <xf:upload> to load a local XML file, >> and submit it to a web service which will convert it into some other >> format. The web service expects an HTTP POST, but I believe it is happy >> with a serialization of "application/xml" or "multipart/form-data" and >> possibly it may work with "multipart/related". I have tried the various >> XForms methods "post", "form-data-post", and "multipart-post" without >> success. >> >> I have tried a number of things. >> >> It appears to me that the "form-data-post" submission method is not >> supported by XsltForms at all >> >> It seems (from reading the JS code) that the "multipart-post" IS >> supported, however, it fails to correctly serialize my instance containing >> the file:/// URI set by my xf:upload (the XML containing the URI is sent >> instead of the content which the URI refers to, even though I have set the >> xsi:type="xsd:anyURI"). The same problem happens with the "post" method. >> >> Is this known behaviour? I am puzzled because the W3 XForms 1.1 test >> suite results at http://www.agencexml.com/xforms-tests/testsuite/XForms1. >> 1/Edition1/driverPages/forms/XF11_TestSuite.xhtml indicate that >> "form-data-post" should work. >> >> I would appreciate any clarification about this is supposed to work, or >> advice as to what functionality is missing. >> >> Thanks! >> >> >> Conal >> >> >> >> -- >> Conal Tuohy >> http://conaltuohy.com/ >> @conal_tuohy >> +61-466-324297 <+61%20466%20324%20297> >> >> ------------------------------------------------------------ >> ------------------ >> Check out the vibrant tech community on one of the world's most >> engaging tech sites, SlashDot.org! http://sdm.link/slashdot >> _______________________________________________ >> Xsltforms-support mailing list >> Xsl...@li... >> https://lists.sourceforge.net/lists/listinfo/xsltforms-support >> >> > |
From: Tim T. <tim...@gm...> - 2017-01-31 17:20:58
|
Hi, Conal, I'm not sure about the support for different serialization formats, but I did just test <xf:upload> with rev.638, and it worked for me (on Ubuntu): <xf:upload incremental="true" mediatype="application/xml" ref="instance('file-upload')/upload/file"> <xf:label>Select</xf:label> <xf:filename ref="instance('file-upload')/upload/file/@filename"/> <!-- Relative XPath doesn't seem to work here. --> </xf:upload> When I upload a file, the file contents are inserted into the <file> element in my "file-upload" instance, and I am able to POST the contents to a server. When I do an upload, I get a relative file name (no file:///). Hope this helps, Tim -- Tim A. Thompson Metadata Librarian (Spanish/Portuguese Specialty) Princeton University Library www.linkedin.com/in/timathompson ta...@pr... On Sun, Jan 29, 2017 at 9:02 AM, Conal Tuohy <con...@gm...> wrote: > I have had a lot of difficulty in getting a file upload to work, in > XSLTForms rev.638, on either Firefox 50.1.0 or Chrome 55.0.2883.87 on > Linux Mint. > > What I am trying to do is use an <xf:upload> to load a local XML file, and > submit it to a web service which will convert it into some other format. > The web service expects an HTTP POST, but I believe it is happy with a > serialization of "application/xml" or "multipart/form-data" and possibly it > may work with "multipart/related". I have tried the various XForms methods > "post", "form-data-post", and "multipart-post" without success. > > I have tried a number of things. > > It appears to me that the "form-data-post" submission method is not > supported by XsltForms at all > > It seems (from reading the JS code) that the "multipart-post" IS > supported, however, it fails to correctly serialize my instance containing > the file:/// URI set by my xf:upload (the XML containing the URI is sent > instead of the content which the URI refers to, even though I have set the > xsi:type="xsd:anyURI"). The same problem happens with the "post" method. > > Is this known behaviour? I am puzzled because the W3 XForms 1.1 test suite > results at http://www.agencexml.com/xforms-tests/testsuite/ > XForms1.1/Edition1/driverPages/forms/XF11_TestSuite.xhtml indicate that > "form-data-post" should work. > > I would appreciate any clarification about this is supposed to work, or > advice as to what functionality is missing. > > Thanks! > > > Conal > > > > -- > Conal Tuohy > http://conaltuohy.com/ > @conal_tuohy > +61-466-324297 <+61%20466%20324%20297> > > ------------------------------------------------------------ > ------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, SlashDot.org! http://sdm.link/slashdot > _______________________________________________ > Xsltforms-support mailing list > Xsl...@li... > https://lists.sourceforge.net/lists/listinfo/xsltforms-support > > |
From: Conal T. <con...@gm...> - 2017-01-29 14:03:09
|
I have had a lot of difficulty in getting a file upload to work, in XSLTForms rev.638, on either Firefox 50.1.0 or Chrome 55.0.2883.87 on Linux Mint. What I am trying to do is use an <xf:upload> to load a local XML file, and submit it to a web service which will convert it into some other format. The web service expects an HTTP POST, but I believe it is happy with a serialization of "application/xml" or "multipart/form-data" and possibly it may work with "multipart/related". I have tried the various XForms methods "post", "form-data-post", and "multipart-post" without success. I have tried a number of things. It appears to me that the "form-data-post" submission method is not supported by XsltForms at all It seems (from reading the JS code) that the "multipart-post" IS supported, however, it fails to correctly serialize my instance containing the file:/// URI set by my xf:upload (the XML containing the URI is sent instead of the content which the URI refers to, even though I have set the xsi:type="xsd:anyURI"). The same problem happens with the "post" method. Is this known behaviour? I am puzzled because the W3 XForms 1.1 test suite results at http://www.agencexml.com/xforms-tests/testsuite/XForms1.1/Edition1/driverPages/forms/XF11_TestSuite.xhtml indicate that "form-data-post" should work. I would appreciate any clarification about this is supposed to work, or advice as to what functionality is missing. Thanks! Conal -- Conal Tuohy http://conaltuohy.com/ @conal_tuohy +61-466-324297 |
From: C. M. Sperberg-M. <cm...@bl...> - 2017-01-09 14:41:46
|
Short summary: the current version of TinyMCE (4.5.2) appears not to work with XSLTForms; the most recent version of TinyMCE to work with XSLTForms (638) appears to be 4.3.12 of 10 May 2016. Details: when I copy the demo file at [1] and point it to a local copy of XSLTForms version 638, into which I have installed TinyMCE 4.5.2 in the scripts/ subdirectory, I get an error message along the lines of TypeError: undefined is not an object (evaluating ‘r.getRng()’) Both Safari 10.0 and Firefox 50.1.0 (under OS X 10.11.6) exhibit this problem and complain about the same thing. TinyMCE 4.0.21, which is used by [1], does work, but is not listed among the downloadable versions of TinyMCE at [2]. A binary search through the versions between the two suggests that versions up through 4.3.12 work with XSLTForms 638, and versions from 4.3.13 onward fail. (Of course, I haven’t tried them all, but 4.10, 4.2.7, 4.3.9, and 4.3.12 all worked; 4.5.2, 4.5.1, 4.4.0, and 4.3.13 all failed.) The testing done was very shallow: in all the ‘failure’ cases, the ‘Loading’ message never went away, and the error console showed an error (not always the one given above); in the ‘success’ cases, the message went away and I was successfully able to bold and unbold some characters. If at some point Alain tries to make XSLTForms work with current versions of TinyMCE, perhaps knowing when things broke will help. (And in the meantime, for users of XSLTForms who use TinyMCE, it may be helpful to know which versions work and which don’t.) In the meantime, if anyone has experience customizing TinyMCE and using the customization in XSLTForms, and has written up their experiences, I’d be grateful for a link to the writeup. -C. M. Sperberg-McQueen [1] http://www.agencexml.com/xsltforms/tinymce.xml [2] https://www.tinymce.com/download/older-releases/ ******************************************** C. M. Sperberg-McQueen Black Mesa Technologies LLC cm...@bl... http://www.blackmesatech.com ******************************************** |
From: Alain C. <ala...@ag...> - 2016-11-19 21:37:38
|
Hello Habs, You should have a look at this example to associate a schema to a model: https://www.w3.org/TR/xforms/#xforms-in-xhtml-00 In your dummy schema, you should try defining co:book, co:magazine as xsd:string with empty restriction. Thank you for your feedback! --Alain Le 31/10/2016 à 23:02, bc...@sh... a écrit : > Hello Alain - thank you for taking the time to reply. > > I haven't tried anything as yet as I did not have any clue as to how > to proceed. With your suggestion, please could you provide me with a > quick example of what you mean to get me underway ? > > Regards > Habs > > > On 31 October 2016 at 21:17, Alain Couthures > <ala...@ag... <mailto:ala...@ag...>> > wrote: > > Hello Habs, > > Because "xsd:string" is the default type, did you try to define a > dummy schema with every complex type considered as atomic string > so XSLTForms cannot complain about missing type declarations? > > Thank you for your feedback! > > --Alain > > > Le 31/10/2016 à 10:01, bc...@sh... > <mailto:bc...@sh...> a écrit : >> Good morning everyone >> >> I am looking for clarification on how XSLTForms handles instance >> documents where elements may contain xsi:type attributes (see >> snippet below), with regards to the requirement for and location >> of schemas. >> >> Currently I pull in an instance document where this is the case >> and XSLTForms is throwing up the error: "Schema for namespace >> undefined not defined for type co" >> >> - followed by an exception: "Error dispatching event >> 'xforms-model-construct' :" >> >> Which has a check box to prevent creating additional dialogues. >> >> >> If the error dialogue is closed etc, then it goes away the form >> continues to load, however if any other action is taken (in my >> case I noticed it when moving amongst a repeated set), then the >> error occurs again and again. If I check the box to prevent >> creating additional dialogues the form stops responding. >> >> (Please accept that I have all the namespaces present and correct.) >> >> Now this error is most likely due to the fact that the instance >> document does not refer to a schema and neither does the xform >> have a scheme attribute on the 'model' element (or have an inline >> schema reference for that matter). >> >> I believe, though I am not sure, that in any case complex types >> (elements with child elements etc) are not checked when referring >> to schemas in xforms. Only simple types are validated. >> >> For my use it does not matter to check and in any case they are >> complex types I am referring to, so I would like to know if the >> XSLTForms behaviour allows for 'turning off' schema checking and >> if so how to do it please? and if not, what may I try to remove >> the error messages at least for complex types ? >> >> Thank you for the insight and comments. >> Regards >> Habs >> >> Snippet of xml in an instance document: >> >> <catalogue> >> . >> . >> <products> >> <product xsi:type="co:book"/> >> <uid>2344</uid> >> <isbn>432432</isbn> >> . >> . >> </product> >> <product xsi:type="co:magazine"/> >> <uid>9999</uid> >> <author>432432</isbn> >> . >> . >> </product> >> </products> >> . >> . >> </catalogue> >> >> >> ------------------------------------------------------------------------------ >> The Command Line: Reinvented for Modern Developers >> Did the resurgence of CLI tooling catch you by surprise? >> Reconnect with the command line and become more productive. >> Learn the new .NET andASP.NET <http://ASP.NET> CLI. Get your free copy! >> http://sdm.link/telerik >> >> _______________________________________________ >> Xsltforms-support mailing list >> Xsl...@li... >> <mailto:Xsl...@li...> >> https://lists.sourceforge.net/lists/listinfo/xsltforms-support >> <https://lists.sourceforge.net/lists/listinfo/xsltforms-support> > |
From: Alain C. <ala...@ag...> - 2016-11-19 21:35:09
|
Tim, Unfortunately, this SO example is using XPath 2.0 and it also appears that XSLTForms currently does not support predicates after a var ref... Could you please post a small test case so I could get this "too much recursion" error? Thanks! --Alain Le 10/11/2016 à 19:30, Tim Thompson a écrit : > Alain, all, > > Is it possible to group output using variables and nested repeats in > XSLTForms? See this SO question for an example using Orbeon: > http://stackoverflow.com/questions/5938064/sorted-and-grouped-data-table-in-xforms > > When I try to implement this pattern in XSLTForms, using > fn:distinct-values, I get a "too much recursion" error. > > Thanks, > Tim > > -- > Tim A. Thompson > Metadata Librarian (Spanish/Portuguese Specialty) > Princeton University Library > > > > ------------------------------------------------------------------------------ > Developer Access Program for Intel Xeon Phi Processors > Access to Intel Xeon Phi processor-based developer platforms. > With one year of Intel Parallel Studio XE. > Training and support from Colfax. > Order your platform today. http://sdm.link/xeonphi > > > _______________________________________________ > Xsltforms-support mailing list > Xsl...@li... > https://lists.sourceforge.net/lists/listinfo/xsltforms-support |