xsltforms-support Mailing List for XSLTForms (Page 41)
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: Dan M. <dan...@gm...> - 2012-07-26 12:57:58
|
Hi Florent, You may have to wrap the CSS files in XML tags like <css>...</css>. http://en.wikibooks.org/wiki/XRX/XSLTForms_and_eXist#Modifying_your_CSS_to_work_with_XSLTForms - Dan On Thu, Jul 26, 2012 at 7:10 AM, Florent Georges <li...@fg...> wrote: > Hi, > > When I add XSLTForms support to my page, it does not apply my > CSS files anymore. Those are imported by: > > <link href="xxx.css" rel="stylesheet" type="text/css"/> > > XSLTForms is plugged in by: > > <?xml-stylesheet href="xsltforms.xsl" type="text/xsl"?> > > XSLTForms works fine. If I remove the processing instruction > to import it, the CSS is correctly apply. But with XSLTForms, > it is not anymore. > > Any reason for this? Any solution? > > > Regards, > > > -- > Florent Georges > http://fgeorges.org/ > http://h2oconsulting.be/ > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Xsltforms-support mailing list > Xsl...@li... > https://lists.sourceforge.net/lists/listinfo/xsltforms-support > -- Dan McCreary NoSQL Evangelist office: (952) 931-9198 cell: (612) 986-1552 |
From: Florent G. <li...@fg...> - 2012-07-26 12:23:31
|
Hi, When I add XSLTForms support to my page, it does not apply my CSS files anymore. Those are imported by: <link href="xxx.css" rel="stylesheet" type="text/css"/> XSLTForms is plugged in by: <?xml-stylesheet href="xsltforms.xsl" type="text/xsl"?> XSLTForms works fine. If I remove the processing instruction to import it, the CSS is correctly apply. But with XSLTForms, it is not anymore. Any reason for this? Any solution? Regards, -- Florent Georges http://fgeorges.org/ http://h2oconsulting.be/ |
From: Alain C. <ala...@ag...> - 2012-07-26 07:46:50
|
Hello Terence, > By looking at the src/xslt/script/output.xsl.xml file, I gather that > it should now be possible to obtain control label text from model > instance nodes: xsl:template match="xforms:output | xforms:label[(@ref > or @bind) and not(parent::xforms:item) and not(parent::xforms:itemset)]" Yes, I have recently implemented this for a test case in W3C Test Suite (7.10.4.a context() function). > > Unfortunately, this does not seem to work, as can be seen by the > attached example. This W3C test case is just about the trigger control which is rendered with a SPAN element. > The problem seems to come from the fact that the last line of the > XsltForms_output.prototype.setValue function (in > src/js/controls/XFOutput.js.xml) states "element.src = value;" instead > of "XsltForms_browser.setValue(element, value);". No, this instruction is for image outputs (8.1.5.d mediatype attribute) but it's easy to add a test for considering the LABEL element similar to the SPAN element (and the TSPAN element for SVG!). This will be present in the next release. Thanks! -Alain |
From: Terence J. <tj...@ga...> - 2012-07-25 17:27:08
|
Hello, By looking at the src/xslt/script/output.xsl.xml file, I gather that it should now be possible to obtain control label text from model instance nodes: xsl:template match="xforms:output | xforms:label[(@ref or @bind) and not(parent::xforms:item) and not(parent::xforms:itemset)]" Unfortunately, this does not seem to work, as can be seen by the attached example. The problem seems to come from the fact that the last line of the XsltForms_output.prototype.setValue function (in src/js/controls/XFOutput.js.xml) states "element.src = value;" instead of "XsltForms_browser.setValue(element, value);". Regards, Terence |
From: Alain C. <ala...@ag...> - 2012-07-20 08:11:09
|
Xerox: https://docushare.xerox.com/dsdn/dsweb/View/Collection-2129 Healthcare IT: https://ncisvn.nci.nih.gov/WebSVN/log.php?repname=edct&path=%2FCollectorServer%2Ftrunk%2F&isdir=1&showchanges=1 StratML: http://xmldatasets.net/XF2/aboutstratxform.html Open Siddur: http://code.google.com/p/jewishliturgy/source/browse/trunk/setup/xsltforms.js Oracc: http://oracc.museum.upenn.edu/saao/saa16/corpus Tamboti: http://sourceforge.net/apps/trac/exist/browser/apps/tamboti/modules/edit/edit.xq ENSAM (http://www.ensam.eu/en/): http://sourceforge.net/mailarchive/message.php?msg_id=29544599 European Committee for Standardization: http://www.cen.eu/cwa/bii/specs/Tools/resources/xforms/invoice-xform-xsltForms.xml Collinta: http://collinta.com.au/xsltforms/designer.html La Trobe University: https://code.google.com/p/ands-la-trobe/ Australian Bureau of Statistics: http://sourceforge.net/projects/ddixformstrans/ University of Oxford: http://www.tmf-ev.de/DesktopModules/Bring2mind/DMX/Download.aspx?EntryId=16946&PortalId=0 Le 20/07/2012 03:05, C. M. Sperberg-McQueen a écrit : > I'd like to update the "Who uses XSLTForms?" page in the XSLTForms wikibook: > > http://en.wikibooks.org/wiki/XSLTForms/Applications > > Specifically, I'd like the page to list a few more XSLTForms-based applications of > XForms. There seems no better way to augment the list than to ask readers of > this mailing list, so here are my questions for readers of the list: > > Are you using XForms? What for? > > Are any of the forms you have built available on the open Web? URI please! > > There is no particular need, I guess, to limit the list of users to those with > forms on the open Web. So even if all your forms are behind a firewall, > if you are making serious use of XSLTForms I would like to hear from you. > > It's a wikibook, so in principle anyone on this mailing list can add themselves > to the page without any intervention from me. But if you reply to me, I will > undertake to summarize and package the replies and add at least some > relevant information to the page. (I should specify that this is a one-time offer; > I am not volunteering to maintain that page in perpetuity.) > > Thanks! > > Michael Sperberg-McQueen > > > > > |
From: C. M. Sperberg-M. <cm...@bl...> - 2012-07-20 01:05:42
|
I'd like to update the "Who uses XSLTForms?" page in the XSLTForms wikibook: http://en.wikibooks.org/wiki/XSLTForms/Applications Specifically, I'd like the page to list a few more XSLTForms-based applications of XForms. There seems no better way to augment the list than to ask readers of this mailing list, so here are my questions for readers of the list: Are you using XForms? What for? Are any of the forms you have built available on the open Web? URI please! There is no particular need, I guess, to limit the list of users to those with forms on the open Web. So even if all your forms are behind a firewall, if you are making serious use of XSLTForms I would like to hear from you. It's a wikibook, so in principle anyone on this mailing list can add themselves to the page without any intervention from me. But if you reply to me, I will undertake to summarize and package the replies and add at least some relevant information to the page. (I should specify that this is a one-time offer; I am not volunteering to maintain that page in perpetuity.) Thanks! Michael Sperberg-McQueen -- **************************************************************** * C. M. Sperberg-McQueen, Black Mesa Technologies LLC * http://www.blackmesatech.com * http://cmsmcq.com/mib * http://balisage.net **************************************************************** |
From: Alain C. <ala...@ag...> - 2012-07-19 20:00:15
|
Hello Terence, Thank you for reporting this issue! I have now committed a fix. -Alain Le 19/07/2012 19:03, Terence Jacyno a écrit : > Hello, > > Support for xforms:choices that was introduced in revision 524 seems > to have disappeared since revision 547. > > Regards, > > Terence > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Xsltforms-support mailing list > Xsl...@li... > https://lists.sourceforge.net/lists/listinfo/xsltforms-support > |
From: Terence J. <tj...@ga...> - 2012-07-19 18:02:47
|
Hello, Support for xforms:choices that was introduced in revision 524 seems to have disappeared since revision 547. Regards, Terence |
From: C. M. Sperberg-M. <cm...@bl...> - 2012-07-18 22:08:06
|
On Jul 17, 2012, at 4:33 PM, peter winstanley wrote: > Hello List > > "Daft Laddie" question here: How do I serialize an XML node so that it can be viewed in an XForms textarea as XML complete with angle brackets, indentation and preferably syntax highlighting? Various people have suggested ways to do this nicely. If indentation and syntax highlighting are desirable but not absolutely essential, then for quick and dirty results a simple way to display a node in XML syntax is <xf:output value="serialize(.)" mediatype="text/plain"/> Wrapping it in a 'pre' element is a simple way to get it styled in monospace. -- **************************************************************** * C. M. Sperberg-McQueen, Black Mesa Technologies LLC * http://www.blackmesatech.com * http://cmsmcq.com/mib * http://balisage.net **************************************************************** |
From: Alain C. <ala...@ag...> - 2012-07-18 20:19:30
|
Hello Peter, I have extended the transform() function in rev. 551 to accept inline XSLT. Please find attached a test case for common colored XML rendering. The third parameter of the transform() function has to be true for inline XSLT and false for an URI. Using inline XSLT allows to add XForms controls to dynamically modify the stylesheet! Thank you for your feedbacks! -Alain Le 18/07/2012 00:33, peter winstanley a écrit : > Hello List > > "Daft Laddie" question here: How do I serialize an XML node so that it can be viewed in an XForms textarea as XML complete with angle brackets, indentation and preferably syntax highlighting? > > Many thanks > > Peter > > ____________________________________________________________ > GET FREE SMILEYS FOR YOUR IM & EMAIL - Learn more at http://www.inbox.com/smileys > Works with AIM®, MSN® Messenger, Yahoo!® Messenger, ICQ®, Google Talk™ and most webmails > > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Xsltforms-support mailing list > Xsl...@li... > https://lists.sourceforge.net/lists/listinfo/xsltforms-support |
From: Alain C. <ala...@ag...> - 2012-07-18 20:03:17
|
Le 18/07/2012 00:03, C. M. Sperberg-McQueen a écrit : > This works fine. To try to make sure I understood the new action, > however, I tried the following variation, which works as expected > with one exception: > > <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events"> > <head> > <title>Inner & Outer Set Node</title> > <xf:model> > <xf:instance> > <data xmlns=""> > <item>a</item> > </data> > </xf:instance> > </xf:model> > </head> > <body style="margin: 0.5em;"> > <h1>Inner & Outer Set Node</h1> > <p>The instance currently looks like this:</p> > <pre> > <xf:output value="serialize(.)" mediatype="text/plain"> > </xf:output> > </pre> > <hr/> > <p>These buttons apply the <code>setnode</code> action to the instance root (<code>.</code>):</p> > <xf:trigger> > <xf:label>Set Inner to '<item>b</item>'</xf:label> > <xf:setnode ref="." ev:event="DOMActivate" inner="'<item>b</item>'"/> > </xf:trigger> > <xf:trigger> > <xf:label>Set Outer to '<item>c</item>'</xf:label> > <xf:setnode ref="." ev:event="DOMActivate" outer="'<item>c</item>'"/> > </xf:trigger> > <hr/> > <p>These buttons apply the <code>setnode</code> action to the child of the instance root (<code>./item</code>):</p> > <xf:trigger> > <xf:label>Set Inner to '<item>d</item>'</xf:label> > <xf:setnode ref="./item" ev:event="DOMActivate" inner="'<item>d</item>'"/> > </xf:trigger> > <xf:trigger> > <xf:label>Set Outer to '<item>e</item>'</xf:label> > <xf:setnode ref="./item" ev:event="DOMActivate" outer="'<item>e</item>'"/> > </xf:trigger> > </body> > </html> > > The second button of the first pair attempts to supply an outer > value for the outermost element of the instance (.) -- essentially, > that is, it attempts to replace the instance entirely. The other > buttons work as I expected, but this one doesn't seem to have > the desired effect (and after I click it, the others stop working). > > My idea is that setnode ref="instance('x')" outer="..."/> > should have essentially the same effect as > > <xf:submit target="bounce-xml-string-back-as-xml" > replace="instance" instance="x" ref="y"/> > > when y is an XPath expression pointing to a node set whose > serialization is the same string as given in the 'outer' attribute. > > If that's not possible from an implementation point of view, I can > live with it. But I predict I won't be the last user who hopes it will > work that way :) > > In any case, thank you again, this is great. > I have fixed this now. It was due to metadata (model id, instance id) stored in extra attributes (xsltforms_*) being erased. Thank you for your feedbacks! -Alain |
From: Stephen C. <ste...@gm...> - 2012-07-18 06:00:42
|
Not sure if this is an answer to your problem, but an xslt transform could do this, which relates to another current thread. Also, something like this interface might be useful in xsltforms perhaps: http://xmljs.sourceforge.net/contributedAdd-ons/xpath/sampleApplications/samplePaths/xpathexamples.html On Wed, Jul 18, 2012 at 8:33 AM, peter winstanley <p....@in...> wrote: > Hello List > > "Daft Laddie" question here: How do I serialize an XML node so that it > can be viewed in an XForms textarea as XML complete with angle brackets, > indentation and preferably syntax highlighting? > > Many thanks > > Peter > > ____________________________________________________________ > GET FREE SMILEYS FOR YOUR IM & EMAIL - Learn more at > http://www.inbox.com/smileys > Works with AIM®, MSN® Messenger, Yahoo!® Messenger, ICQ®, Google Talk™ and > most webmails > > > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Xsltforms-support mailing list > Xsl...@li... > https://lists.sourceforge.net/lists/listinfo/xsltforms-support > |
From: Dan M. <dan...@gm...> - 2012-07-18 03:00:10
|
Hi Peter, There were some tools that were written by Claudius that used CKEdit with XSLTForms that did this in the past. These tools allowed you to view and edit the XML source for a textarea with markup. You may want to contact him (on the CC). - Dan On Tue, Jul 17, 2012 at 5:33 PM, peter winstanley <p....@in...> wrote: > Hello List > > "Daft Laddie" question here: How do I serialize an XML node so that it can be viewed in an XForms textarea as XML complete with angle brackets, indentation and preferably syntax highlighting? > > Many thanks > > Peter > > ____________________________________________________________ > GET FREE SMILEYS FOR YOUR IM & EMAIL - Learn more at http://www.inbox.com/smileys > Works with AIM®, MSN® Messenger, Yahoo!® Messenger, ICQ®, Google Talk™ and most webmails > > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Xsltforms-support mailing list > Xsl...@li... > https://lists.sourceforge.net/lists/listinfo/xsltforms-support -- Dan McCreary NoSQL Evangelist office: (952) 931-9198 cell: (612) 986-1552 |
From: peter w. <p....@in...> - 2012-07-17 22:34:06
|
Hello List "Daft Laddie" question here: How do I serialize an XML node so that it can be viewed in an XForms textarea as XML complete with angle brackets, indentation and preferably syntax highlighting? Many thanks Peter ____________________________________________________________ GET FREE SMILEYS FOR YOUR IM & EMAIL - Learn more at http://www.inbox.com/smileys Works with AIM®, MSN® Messenger, Yahoo!® Messenger, ICQ®, Google Talk™ and most webmails |
From: C. M. Sperberg-M. <cm...@bl...> - 2012-07-17 22:04:04
|
On Jul 17, 2012, at 3:17 PM, Alain Couthures wrote: > Rev. 550 includes a new experimental action named "setnode" with @inner or @outer attributes to perform a "loadXML" for the corresponding node. That looks great! Thank you very much. > > Here is a test case: > <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events"> > <head> > <title>Inner & Outer Set Node</title> > <xf:model> > <xf:instance> > <data xmlns=""> > <item>a</item> > </data> > </xf:instance> > </xf:model> > </head> > <body> > <h1>Inner & Outer Set Node</h1> > <xf:output value="item"/> > <xf:trigger> > <xf:label>Inner</xf:label> > <xf:setnode ref="." ev:event="DOMActivate" inner="'<item>b</item>'"/> > </xf:trigger> > <xf:trigger> > <xf:label>Outer</xf:label> > <xf:setnode ref="item" ev:event="DOMActivate" outer="'<item>c</item>'"/> > </xf:trigger> > </body> > </html> This works fine. To try to make sure I understood the new action, however, I tried the following variation, which works as expected with one exception: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events"> <head> <title>Inner & Outer Set Node</title> <xf:model> <xf:instance> <data xmlns=""> <item>a</item> </data> </xf:instance> </xf:model> </head> <body style="margin: 0.5em;"> <h1>Inner & Outer Set Node</h1> <p>The instance currently looks like this:</p> <pre> <xf:output value="serialize(.)" mediatype="text/plain"> </xf:output> </pre> <hr/> <p>These buttons apply the <code>setnode</code> action to the instance root (<code>.</code>):</p> <xf:trigger> <xf:label>Set Inner to '<item>b</item>'</xf:label> <xf:setnode ref="." ev:event="DOMActivate" inner="'<item>b</item>'"/> </xf:trigger> <xf:trigger> <xf:label>Set Outer to '<item>c</item>'</xf:label> <xf:setnode ref="." ev:event="DOMActivate" outer="'<item>c</item>'"/> </xf:trigger> <hr/> <p>These buttons apply the <code>setnode</code> action to the child of the instance root (<code>./item</code>):</p> <xf:trigger> <xf:label>Set Inner to '<item>d</item>'</xf:label> <xf:setnode ref="./item" ev:event="DOMActivate" inner="'<item>d</item>'"/> </xf:trigger> <xf:trigger> <xf:label>Set Outer to '<item>e</item>'</xf:label> <xf:setnode ref="./item" ev:event="DOMActivate" outer="'<item>e</item>'"/> </xf:trigger> </body> </html> The second button of the first pair attempts to supply an outer value for the outermost element of the instance (.) -- essentially, that is, it attempts to replace the instance entirely. The other buttons work as I expected, but this one doesn't seem to have the desired effect (and after I click it, the others stop working). My idea is that setnode ref="instance('x')" outer="..."/> should have essentially the same effect as <xf:submit target="bounce-xml-string-back-as-xml" replace="instance" instance="x" ref="y"/> when y is an XPath expression pointing to a node set whose serialization is the same string as given in the 'outer' attribute. If that's not possible from an implementation point of view, I can live with it. But I predict I won't be the last user who hopes it will work that way :) In any case, thank you again, this is great. -- **************************************************************** * C. M. Sperberg-McQueen, Black Mesa Technologies LLC * http://www.blackmesatech.com * http://cmsmcq.com/mib * http://balisage.net **************************************************************** |
From: Alain C. <ala...@ag...> - 2012-07-17 21:18:19
|
Rev. 550 includes a new experimental action named "setnode" with @inner or @outer attributes to perform a "loadXML" for the corresponding node. Here is a test case: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events"> <head> <title>Inner & Outer Set Node</title> <xf:model> <xf:instance> <data xmlns=""> <item>a</item> </data> </xf:instance> </xf:model> </head> <body> <h1>Inner & Outer Set Node</h1> <xf:output value="item"/> <xf:trigger> <xf:label>Inner</xf:label> <xf:setnode ref="." ev:event="DOMActivate" inner="'<item>b</item>'"/> </xf:trigger> <xf:trigger> <xf:label>Outer</xf:label> <xf:setnode ref="item" ev:event="DOMActivate" outer="'<item>c</item>'"/> </xf:trigger> </body> </html> Le 16/07/2012 16:32, C. M. Sperberg-McQueen a écrit : > For what it's worth, I think it would be useful to have a standard way > to load the result of a transform into an instance. > > In case an example helps, the form I was working on this past week > may serve as a simple use case. It involves two XSLT processes: > first, the user loads an XML document and a static stylesheet (the > 'factory') runs over the user's document and produces a second > stylesheet (the 'filter'), and then the user can configure the filter by > changing various default behaviors. Whey they are done, they can > save the filter to disk or apply the filter to the user's document. > > Since the point of the filter is to produce untagged text for the user > to feed into text analysis or statistical software that does not understand > XML (it's sad to think that people still use such software, but I'm told > they do), there is no particular need to load the XML structure of the > second transformation result into an instance. (Initially I used the > 'text' output method in the transform, but all the browsers I tested > appear to insist on producing either XML or HTML output from a > transform, so I switched to the XML output method and wrapped > the text result in an 'output' element.) > > But the result of the first transformation MUST be loaded into an > instance for the form to serve its purpose; the point of the form is > to illustrate, for a panel discussion at a conference next week, > (a) that it's not enough just to 'strip the tags out' of an XML document > and (b) that it's possible to provide an interface to allow an > intelligent selection from the encoded document. So the user > must be able to edit the filter, which means the filter must be an > XML instance. > > In this case, I handled the lack of 'loadXML' action by using a simple > trick: I submit the text result of the initial transformation to a script > on the server, which does nothing but bounce it back to the client > as text/xml. The submission is defined this way: > > <xf:submission id="load-userxslt" > ref="instance('filter')/text()" > method="post" > resource="../../../lib/reflect-as-xml.sh" > replace="instance" > instance="filter" > /> > > The 'filter' instance initially contains the text-node output from the > transformation; this submission sends that output (without the > outermost wrapper element, which is not needed) to the server, > where 'reflect-as-xml.sh' does nothing but send it back with an HTTP > header. Reduced to its essentials, reflect-as-xml.sh looks like this: > > #!/bin/sh > echo "Content-Type: text/xml" > echo > cat > > It would be a nicer solution, however, if no server round-trip were > required here. (I thought about trying to figure out how to do that > in Javascript with an extension function or extension action, but I > decided to go with this quicker solution, for purposes of the demo.) > > In case it's of interest to readers of this list, the form in question > is now visible at > > http://blackmesatech.com/2012/07/dh/sdb.xml > > The form is intended as a toy to illustrate some general principles, > and not as a tool for really serious work. (So in particular, don't > give it a very large document to work with. It works fine on a > TEI-encoded sonnet, and it takes several minutes [and counting] to > handle one of Shakespeare's five-act plays.) > > |
From: C. M. Sperberg-M. <cm...@bl...> - 2012-07-16 14:33:04
|
On Jul 16, 2012, at 2:09 AM, Alain Couthures wrote: > The "transform()" function is not yet fully specified and it would be > easy to temporarily add a third parameter to it to switch from URI to text. > > As you mention it in your test case, another situation is whether the > node for the stylesheet is a leaf or a sub-tree to be serialized and a > fourth parameter could indicate this. > > Currently, XSLTForms only supports a text result for the transformation > and it can be used within a "setvalue" action. A sort of "loadXML" > action could easily be added so the result will be loaded as a sub-tree. > > What do you think? For what it's worth, I think it would be useful to have a standard way to load the result of a transform into an instance. In case an example helps, the form I was working on this past week may serve as a simple use case. It involves two XSLT processes: first, the user loads an XML document and a static stylesheet (the 'factory') runs over the user's document and produces a second stylesheet (the 'filter'), and then the user can configure the filter by changing various default behaviors. Whey they are done, they can save the filter to disk or apply the filter to the user's document. Since the point of the filter is to produce untagged text for the user to feed into text analysis or statistical software that does not understand XML (it's sad to think that people still use such software, but I'm told they do), there is no particular need to load the XML structure of the second transformation result into an instance. (Initially I used the 'text' output method in the transform, but all the browsers I tested appear to insist on producing either XML or HTML output from a transform, so I switched to the XML output method and wrapped the text result in an 'output' element.) But the result of the first transformation MUST be loaded into an instance for the form to serve its purpose; the point of the form is to illustrate, for a panel discussion at a conference next week, (a) that it's not enough just to 'strip the tags out' of an XML document and (b) that it's possible to provide an interface to allow an intelligent selection from the encoded document. So the user must be able to edit the filter, which means the filter must be an XML instance. In this case, I handled the lack of 'loadXML' action by using a simple trick: I submit the text result of the initial transformation to a script on the server, which does nothing but bounce it back to the client as text/xml. The submission is defined this way: <xf:submission id="load-userxslt" ref="instance('filter')/text()" method="post" resource="../../../lib/reflect-as-xml.sh" replace="instance" instance="filter" /> The 'filter' instance initially contains the text-node output from the transformation; this submission sends that output (without the outermost wrapper element, which is not needed) to the server, where 'reflect-as-xml.sh' does nothing but send it back with an HTTP header. Reduced to its essentials, reflect-as-xml.sh looks like this: #!/bin/sh echo "Content-Type: text/xml" echo cat It would be a nicer solution, however, if no server round-trip were required here. (I thought about trying to figure out how to do that in Javascript with an extension function or extension action, but I decided to go with this quicker solution, for purposes of the demo.) In case it's of interest to readers of this list, the form in question is now visible at http://blackmesatech.com/2012/07/dh/sdb.xml The form is intended as a toy to illustrate some general principles, and not as a tool for really serious work. (So in particular, don't give it a very large document to work with. It works fine on a TEI-encoded sonnet, and it takes several minutes [and counting] to handle one of Shakespeare's five-act plays.) -- **************************************************************** * C. M. Sperberg-McQueen, Black Mesa Technologies LLC * http://www.blackmesatech.com * http://cmsmcq.com/mib * http://balisage.net **************************************************************** |
From: Alain C. <ala...@ag...> - 2012-07-16 08:10:16
|
The "transform()" function is not yet fully specified and it would be easy to temporarily add a third parameter to it to switch from URI to text. As you mention it in your test case, another situation is whether the node for the stylesheet is a leaf or a sub-tree to be serialized and a fourth parameter could indicate this. Currently, XSLTForms only supports a text result for the transformation and it can be used within a "setvalue" action. A sort of "loadXML" action could easily be added so the result will be loaded as a sub-tree. What do you think? Thanks! -Alain Le 15/07/2012 22:14, C. M. Sperberg-McQueen a écrit : > On Jul 12, 2012, at 3:15 PM, C. M. Sperberg-McQueen wrote: > >> In a form I'm working on, I'd like to apply a stylesheet located in a >> document instance (instance('filter') to an input document located in >> another instance (instance('userdoc')). > For others interested in this topic, I should record that this is in fact > possible and a simple extension function does the job. > > A number of test cases that demonstrate the use of transform() and > an extension function for instance-based XSLT transforms can be > found at > > http://blackmesatech.com/2012/07/testcase/transform/index.xml > > Michael Sperberg-McQueen > > >> ... >> So I wrote an extension function that looks like this: >> >> function bmt_applyxslt_ns_s(nsXML, sXSLT) { >> if (arguments.length !== 2) { >> throw XsltForms_xpathFunctionExceptions.transformInvalidArgumentsNumber; >> } >> return nsXML.length === 0? "" : XsltForms_browser.transformText(XsltForms_browser.saveXML(nsXML[0]), sXSLT, true); >> } >> >> This is almost verbatim the same as the source code for transform(), >> except for the argument names and 'true' instead of 'false' in the >> third argument. > This code appears to work correctly, given a good stylesheet. > >> I register the function with XSLTforms in the usual way. >> >> <xf:setvalue >> ref="instance('userout')/self::data" >> value="bmt:s_applyxslt_ns_s(instance('userdoc'), serialize(instance('filter')))"/> >> >> The form loads as expected and the function seems to be called >> without incident and without error messages (and alert messages >> confirm that the arguments look pretty much as I expect them to look). >> But the result is consistently not the output I expect from the stylesheet, >> but a document which reads in its entirety: >> >> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"> >> <head><title></title></head> >> <body> >> <pre></pre> >> </body> >> </html> >> >> Anyone have a clue? Anyone have a better (or just different) way to go about >> this? > This appears to be Safari's way of signaling an error of some kind in the > execution of the XSLT transform. > > |
From: C. M. Sperberg-M. <cm...@bl...> - 2012-07-15 20:14:36
|
On Jul 12, 2012, at 3:15 PM, C. M. Sperberg-McQueen wrote: > In a form I'm working on, I'd like to apply a stylesheet located in a > document instance (instance('filter') to an input document located in > another instance (instance('userdoc')). For others interested in this topic, I should record that this is in fact possible and a simple extension function does the job. A number of test cases that demonstrate the use of transform() and an extension function for instance-based XSLT transforms can be found at http://blackmesatech.com/2012/07/testcase/transform/index.xml Michael Sperberg-McQueen > ... > So I wrote an extension function that looks like this: > > function bmt_applyxslt_ns_s(nsXML, sXSLT) { > if (arguments.length !== 2) { > throw XsltForms_xpathFunctionExceptions.transformInvalidArgumentsNumber; > } > return nsXML.length === 0? "" : XsltForms_browser.transformText(XsltForms_browser.saveXML(nsXML[0]), sXSLT, true); > } > > This is almost verbatim the same as the source code for transform(), > except for the argument names and 'true' instead of 'false' in the > third argument. This code appears to work correctly, given a good stylesheet. > I register the function with XSLTforms in the usual way. > > <xf:setvalue > ref="instance('userout')/self::data" > value="bmt:s_applyxslt_ns_s(instance('userdoc'), serialize(instance('filter')))"/> > > The form loads as expected and the function seems to be called > without incident and without error messages (and alert messages > confirm that the arguments look pretty much as I expect them to look). > But the result is consistently not the output I expect from the stylesheet, > but a document which reads in its entirety: > > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"> > <head><title></title></head> > <body> > <pre></pre> > </body> > </html> > > Anyone have a clue? Anyone have a better (or just different) way to go about > this? This appears to be Safari's way of signaling an error of some kind in the execution of the XSLT transform. -- **************************************************************** * C. M. Sperberg-McQueen, Black Mesa Technologies LLC * http://www.blackmesatech.com * http://cmsmcq.com/mib * http://balisage.net **************************************************************** |
From: Alain C. <ala...@ag...> - 2012-07-15 19:56:12
|
Mark, Setting a value with Javascript instructions is quite similar to using the setvalue action. Here is the Javascript code for this action: 1 XsltForms_setvalue.prototype.run = function(element, ctx) { 2 var node = this.binding.evaluate(ctx)[0]; 3 if (node) { 4 if (this.context) { 5 ctx = this.context.evaluate(ctx)[0]; 6 } 7 var value = this.value? XsltForms_globals.stringValue(this.context ? this.value.evaluate(ctx, ctx) : this.value.evaluate(node, ctx)) : this.literal; 8 XsltForms_globals.openAction(); 9 XsltForms_browser.setValue(node, value || ""); 10 document.getElementById(XsltForms_browser.getMeta(node.ownerDocument.documentElement, "model")).xfElement.addChange(node); 11 XsltForms_browser.debugConsole.write("Setvalue " + node.nodeName + " = " + value); 12 XsltForms_globals.closeAction(); 13 } 14 }; Only lines 8 to 12 are interesting for your situation: The "node" variable points to the XML node to be updated and the "value" variable contains its new text value. The refresh will be performed at the end with the "closeAction" method (line 12): the "openAction" method (line 8) is there to stack embedded actions. Depending on the DOM API of the browser, the value is assigned to the node (line 9). To limit the refresh according to dependencies, it is required to add the node to the changes list for its own model (line 10). Could you please test this with your form? For compatibility with future releases of XSLTForms, it would be better to define a method just for that, don't you think? Thank you for your feedbacks! -Alain Le 15/07/2012 21:24, Mark Seaborne a écrit : > Michael, > > Thanks for the suggestion, and I take your point. > > What I really need is a custom control. My JS function just takes a value chosen by a user when they select a feature on a map (openLayers vector layer), and pops the value into an XML instance. So, logically what I have is a select1 rendered as a map with selectable features. The features are already represented as XML (gml), rendered by openLayers as points on my map. > > So, yes, you are right, I am trying to do something with Javascript that I should be doing with just XForms! > > Best wishes > > Mark > > On 15 Jul 2012, at 19:46, C. M. Sperberg-McQueen wrote: > >> On Jul 15, 2012, at 5:50 AM, Mark Seaborne wrote: >> >>> Hi, >>> >>> I have noticed that if I change the form so that the js function is called from an XForms control using xf:load AND I add a bind to the model, then the XForms UI updates to reflect the value change caused by the js function. >>> >>> However, when the function is triggered elsewhere in the page, the UI is not updated, even with the bind statement in the model. >>> >> I have not yet studied any of the examples you sent, but stepping >> back a bit, at a very high level it looks as if you are doing (or: trying >> to do) things in Javascript that you could in theory do in XForms; >> making that work will always require that you know a lot about the >> internals of the XForms implementation. >> >> I wonder if you would make more headway doing less in JS and >> more in XForms -- define your function as a Javascript function that >> operates solely on its arguments and calculates a result, and >> register your function as an XPath function along the lines shown >> in http://en.wikibooks.org/wiki/XSLTForms/XSLTForms_only_Extensions#User-Defined_Functions >> -- then set the value of the node you want to update using the >> XForms setvalue action, and use XForms events to tie updates to >> the value to whatever triggering events are taking place elsewhere. >> >> Concretely, I don't think "Javascript function f has been invoked" >> or "... has completed execution" are events that appear in the XForms >> model. Various user actions, changes to values on specified nodes, >> and so on are events XForms knows about and I bet you'll have more >> luck getting XSLTForms to do what you want if you pose your problem >> in terms of those elements. >> >> Of course, if you've already got a lot of non-XForms Javascript in >> the app, this approach may seem impracticable. >> >> Just my two cents ... >> >> Michael Sperberg-McQueen >> >> -- >> **************************************************************** >> * C. M. Sperberg-McQueen, Black Mesa Technologies LLC >> * http://www.blackmesatech.com >> * http://cmsmcq.com/mib >> * http://balisage.net >> **************************************************************** >> >> >> >> > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Xsltforms-support mailing list > Xsl...@li... > https://lists.sourceforge.net/lists/listinfo/xsltforms-support > |
From: Mark S. <m_s...@ma...> - 2012-07-15 19:25:05
|
Michael, Thanks for the suggestion, and I take your point. What I really need is a custom control. My JS function just takes a value chosen by a user when they select a feature on a map (openLayers vector layer), and pops the value into an XML instance. So, logically what I have is a select1 rendered as a map with selectable features. The features are already represented as XML (gml), rendered by openLayers as points on my map. So, yes, you are right, I am trying to do something with Javascript that I should be doing with just XForms! Best wishes Mark On 15 Jul 2012, at 19:46, C. M. Sperberg-McQueen wrote: > > On Jul 15, 2012, at 5:50 AM, Mark Seaborne wrote: > >> Hi, >> >> I have noticed that if I change the form so that the js function is called from an XForms control using xf:load AND I add a bind to the model, then the XForms UI updates to reflect the value change caused by the js function. >> >> However, when the function is triggered elsewhere in the page, the UI is not updated, even with the bind statement in the model. >> > > I have not yet studied any of the examples you sent, but stepping > back a bit, at a very high level it looks as if you are doing (or: trying > to do) things in Javascript that you could in theory do in XForms; > making that work will always require that you know a lot about the > internals of the XForms implementation. > > I wonder if you would make more headway doing less in JS and > more in XForms -- define your function as a Javascript function that > operates solely on its arguments and calculates a result, and > register your function as an XPath function along the lines shown > in http://en.wikibooks.org/wiki/XSLTForms/XSLTForms_only_Extensions#User-Defined_Functions > -- then set the value of the node you want to update using the > XForms setvalue action, and use XForms events to tie updates to > the value to whatever triggering events are taking place elsewhere. > > Concretely, I don't think "Javascript function f has been invoked" > or "... has completed execution" are events that appear in the XForms > model. Various user actions, changes to values on specified nodes, > and so on are events XForms knows about and I bet you'll have more > luck getting XSLTForms to do what you want if you pose your problem > in terms of those elements. > > Of course, if you've already got a lot of non-XForms Javascript in > the app, this approach may seem impracticable. > > Just my two cents ... > > 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...> - 2012-07-15 18:52:28
|
On Jul 15, 2012, at 10:56 AM, Alain Couthures wrote: > Hello, > > For compatibility with Mozilla XForms Extension, XSLTForms still has > some support for namespace in CSS rules, like this: > > ... > > Actually, most XSLTForms users seem to ignore this feature and it might > become optional in the next release for performance reasons (and > because, being implemented with XSLT 1.0, it currently requires external > CSS files to contain a dummy document element!). Replacing every > "xf|tag" by ".xforms-tag" is producing the same behavior. > > XForms implementers, what do you think of CSS rules for XForms? > > XForms users, do you really like this feature? Speaking only for myself: (a) yes, I like it and I do use it, but (b) I dislike having to wrap external CSS files in elements (it worries me because it means I end up with two copies of every CSS file, which is a maintenance challenge), so in practice I almost always use this idiom only in the header of the form. (If I ever standardized on the way I want particular controls to look, that would be a maintenance challenge, too, but so far I haven't, so I don't mind.) Also (c) I could live with it, if the feature became optional or went away for performance reasons or for compatibility with other live XForms implementations. Michael -- **************************************************************** * 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...> - 2012-07-15 18:46:42
|
On Jul 15, 2012, at 5:50 AM, Mark Seaborne wrote: > Hi, > > I have noticed that if I change the form so that the js function is called from an XForms control using xf:load AND I add a bind to the model, then the XForms UI updates to reflect the value change caused by the js function. > > However, when the function is triggered elsewhere in the page, the UI is not updated, even with the bind statement in the model. > I have not yet studied any of the examples you sent, but stepping back a bit, at a very high level it looks as if you are doing (or: trying to do) things in Javascript that you could in theory do in XForms; making that work will always require that you know a lot about the internals of the XForms implementation. I wonder if you would make more headway doing less in JS and more in XForms -- define your function as a Javascript function that operates solely on its arguments and calculates a result, and register your function as an XPath function along the lines shown in http://en.wikibooks.org/wiki/XSLTForms/XSLTForms_only_Extensions#User-Defined_Functions -- then set the value of the node you want to update using the XForms setvalue action, and use XForms events to tie updates to the value to whatever triggering events are taking place elsewhere. Concretely, I don't think "Javascript function f has been invoked" or "... has completed execution" are events that appear in the XForms model. Various user actions, changes to values on specified nodes, and so on are events XForms knows about and I bet you'll have more luck getting XSLTForms to do what you want if you pose your problem in terms of those elements. Of course, if you've already got a lot of non-XForms Javascript in the app, this approach may seem impracticable. Just my two cents ... Michael Sperberg-McQueen -- **************************************************************** * C. M. Sperberg-McQueen, Black Mesa Technologies LLC * http://www.blackmesatech.com * http://cmsmcq.com/mib * http://balisage.net **************************************************************** |
From: Alain C. <ala...@ag...> - 2012-07-15 16:57:11
|
Hello, For compatibility with Mozilla XForms Extension, XSLTForms still has some support for namespace in CSS rules, like this: @namespace xforms url(http://www.w3.org/2002/xforms); xforms|*:invalid { background-color: red; } xforms|label.title { font-size: 15pt; font-weight: bold; color: #000099; margin-bottom: 2em; } Actually, most XSLTForms users seem to ignore this feature and it might become optional in the next release for performance reasons (and because, being implemented with XSLT 1.0, it currently requires external CSS files to contain a dummy document element!). Replacing every "xf|tag" by ".xforms-tag" is producing the same behavior. XForms implementers, what do you think of CSS rules for XForms? XForms users, do you really like this feature? Thank you for your comments! Alain Couthures agenceXML |
From: Mark S. <m_s...@ma...> - 2012-07-15 11:51:00
|
Hi, I have noticed that if I change the form so that the js function is called from an XForms control using xf:load AND I add a bind to the model, then the XForms UI updates to reflect the value change caused by the js function. However, when the function is triggered elsewhere in the page, the UI is not updated, even with the bind statement in the model. Here is the updated form. Mark <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet href="../xsltforms/xsltforms.xsl" type="text/xsl"?> <?xsltforms-options debug="no"?> <?css-conversion no?> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events"> <head> <title>Discover your Whithorn</title> <script type='text/javascript'> function onFeatureSelect(evt) { var modelElem = document.getElementById("theModel"); var instDoc = modelElem.getInstanceDocument("variables"); var xmlSite = instDoc.getElementsByTagName("currSite")[0]; xmlSite.childNodes[0].nodeValue = evt; //alert(xmlSite.childNodes[0].nodeValue); modelElem.rebuild(); modelElem.recalculate(); modelElem.revalidate(); modelElem.refresh(); } </script> <xf:model id="theModel"> <xf:instance id="variables" xmlns=""> <doc> <currSite>Cairn Buy</currSite> <b/> </doc> </xf:instance> <xf:bind calculate="instance('variables')/currSite" nodeset="instance('variables')/b"/> </xf:model> </head> <body> <h2>Sites</h2> <div> <p>Value of instance('variables')/currSite is: <strong><xf:output value="instance('variables')/currSite"/></strong></p> <xf:trigger> <xf:label>Change to Hole Stone</xf:label> <xf:load ev:event="DOMActivate" resource="javascript:onFeatureSelect('Hole Stone')"/> </xf:trigger> <xf:trigger> <xf:label>Change to Cairn Buy</xf:label> <xf:load ev:event="DOMActivate" resource="javascript:onFeatureSelect('Cairn Buy')"/> </xf:trigger> <p onclick="onFeatureSelect('Hole Stone')">Set value of instance('variables')/currSite to Hole Stone</p> <p onclick="onFeatureSelect('Cairn Buy')">Set value of instance('variables')/currSite to Cairn Buy</p> </div> </body> </html> |