xsltforms-support Mailing List for XSLTForms (Page 20)
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: <bc...@sh...> - 2015-08-01 14:54:33
|
Hello I think I have sorted this. Firstly, I had contributed to the problem because I had not added the xforms xmlns prefix to the resource element in the submission. Secondly, I have realised (through debug and further reading etc) that the resource element's 'value' attribute has to be an xpath (or an xpath function); a plain text string (to a resource) as I had, will not work. Therefore this works now: <xf:submission id="mysubmission" method="get" serialization="none" mode="synchronized" replace="instance" instance="myinstance"> <xf:resource value="concat('/rest/db/data/','myxmldoc.xml')" /> </xf:submission> But my original: <xf:submission id="mysubmission" method="get" serialization="none" mode="synchronized" replace="instance" instance="myinstance"> <xf:resource value="/rest/db/data/myxmldoc.xml" /> </xf:submission> will not work, as the @value is not an xpath or a function. That's how I figure it anyway :-) Thank you Marked as solved. On 31 July 2015 at 09:20, <bc...@sh...> wrote: > Hello, good morning xslt-support@ > > > I am struggling to resolve how to do something; I want to use the correct > method to load a new xml document as a replacement to the existing xml in > an instance in the XForm model. > > For the submission element, if the attribute 'resource' is used then it > works. > If a child element '<resource value="...">' is used instead, then it does > not work and the error message returned is, "Unsupported mediatype > 'text/html' for instance #myinstance" > > Therefore, as it stands the following submission works: > > <xf:submission id="mysubmission" method="get" serialization="none" > mode="synchronized" replace="instance" instance="myinstance" > resource="/rest/db/data/myxmldoc.xml" /> > > This submission variation does not (error as described above): > > <xf:submission id="mysubmission" method="get" serialization="none" > mode="synchronized" replace="instance" instance="myinstance"> > > <resource value="/rest/db/data/myxmldoc.xml" /> > </xf:submission> > > I need to use the latter submission (with the resource element) later on, > as I need to dynamically alter the resource value at submission time. > > The backend server is eXist-db. If I call the xml instance via the > browser directly from the REST server as a test, the headers show that the > content type is "application/xml", so this content would appear to be fine > and therefore I cannot work out why there is an unsupported mediatype error. > > Please, what is the correct/better way to achieve the above, or is there a > problem somewhere in XSLTForms that I am creating regarding the > content-type on the request/return following triggering the submission > using the resource element? > > Thank you for some advice and pointers. > Regards > BC Habs > Hallifax > UK > > > > > |
From: <bc...@sh...> - 2015-07-31 08:42:51
|
Hello, good morning xslt-support@ I am struggling to resolve how to do something; I want to use the correct method to load a new xml document as a replacement to the existing xml in an instance in the XForm model. For the submission element, if the attribute 'resource' is used then it works. If a child element '<resource value="...">' is used instead, then it does not work and the error message returned is, "Unsupported mediatype 'text/html' for instance #myinstance" Therefore, as it stands the following submission works: <xf:submission id="mysubmission" method="get" serialization="none" mode="synchronized" replace="instance" instance="myinstance" resource="/rest/db/data/myxmldoc.xml" /> This submission variation does not (error as described above): <xf:submission id="mysubmission" method="get" serialization="none" mode="synchronized" replace="instance" instance="myinstance"> <resource value="/rest/db/data/myxmldoc.xml" /> </xf:submission> I need to use the latter submission (with the resource element) later on, as I need to dynamically alter the resource value at submission time. The backend server is eXist-db. If I call the xml instance via the browser directly from the REST server as a test, the headers show that the content type is "application/xml", so this content would appear to be fine and therefore I cannot work out why there is an unsupported mediatype error. Please, what is the correct/better way to achieve the above, or is there a problem somewhere in XSLTForms that I am creating regarding the content-type on the request/return following triggering the submission using the resource element? Thank you for some advice and pointers. Regards BC Habs Hallifax UK |
From: William V. <wve...@vi...> - 2015-07-28 13:38:22
|
Hi Mats, You can use an xforms:output element inside xforms:hint and xforms:help, and use the @ref attribute of xforms:output Hope this helps, - Bill De: Mats Eklund [mailto:mat...@li...] Enviado el: lunes, 27 de julio de 2015 3:39 p. m. Para: xsl...@li... Asunto: [Xsltforms-support] xforms:help/@ref Dear Alan, It seems the @ref attribute is not supported on xforms:hint and xforms:help elements in XSLTForms, is that right? Do you have some hints (!) how best to implement support for this? Kind regards, Mats |
From: Mats E. <mat...@li...> - 2015-07-27 20:51:45
|
Dear Alan, It seems the @ref attribute is not supported on xforms:hint and xforms:help elements in XSLTForms, is that right? Do you have some hints (!) how best to implement support for this? Kind regards,Mats |
From: Tim T. <tim...@gm...> - 2015-07-14 19:02:32
|
Thank you, Alain! One other minor issue I have noticed with submissions: it seems that when <xf:resource value=""/> is used with GET requests (instead of @resource) that the query string is duplicated. You can see this by inspecting the GET request on this page: http://pulcams.github.io/index.xhtml. This does not seem to affect the submission response itself. Best regards, Tim -- Tim A. Thompson Metadata Librarian (Spanish/Portuguese Specialty) Princeton University Library On Tue, Jul 14, 2015 at 4:30 AM, Alain Couthures < ala...@ag...> wrote: > Tim, > > Currently, XSLTForms is not interpreting media type correctly: the > response media type has to be analyzed instead of submission/@mediatype > which is there just for the request serialization. I tested adding the > overrideMimeType property to the request and the browser errors don't occur > anymore! > > I will fix this as soon as possible. > > Thanks! > > --Alain > > > Le 10/07/2015 16:08, Tim Thompson a écrit : > > Alain, > > I'm testing XSLTForms on an Apache XAMPP server (though not yet with > SaxonHE9-4-0-7), and I had (another) question about browser errors. > > Here's a Gist that shows a basic submission from XSLTForms to DBpedia's > SPARQL endpoint, using @replace="text" on the <xf:submission> element: > https://gist.github.com/Timathom/176a1e6865215b00d544 > > This works beautifully, but in Firefox and IE 11, I am getting browser > errors on the XHR response. > > Here is the HTTP response header in Firefox: > > HTTP/1.1 200 OK > Date: Fri, 10 Jul 2015 13:26:30 GMT > Content-Type: application/ld+json > Content-Length: 7127 > Connection: keep-alive > Server: Virtuoso/07.20.3214 (Linux) i686-generic-linux-glibc212-64 VDB > Access-Control-Allow-Origin: http://localhost > access-control-allow-credentials: true > access-control-expose-headers: Content-Type > Access-Control-Allow-Headers: Accept, Authorization, Slug, Link, Origin, > Content-type > Expires: Fri, 17 Jul 2015 13:26:30 GMT > Cache-Control: max-age=604800 > Accept-Ranges: bytes > > Even though the server returns a Content-Type of "application/ld+json," > the browser still tries to parse it as XML. Firefox throws this error (via > Firebug): > > XML Parsing Error: not well-formed Location: > moz-nullprincipal:{a25b11dd-9e4b-5f40-bb8b-b9415ed8d56e} Line Number 1, > Column 1: > > { "@graph": [ > ^ > > IE 11 throws this error: > > XML5619: Incorrect document syntax. Line: 1, Column 1 > > Chrome does not throw a (visible) error. I guess that these errors are > probably harmless, but is there any way to avoid them, and to prevent the > browser from trying to parse the response as XML when the XForms submission > has a @replace attribute value of "text" and the Content-Type of the > response is a non-XML format? > > Thanks again! > Tim > > -- > Tim A. Thompson > Metadata Librarian (Spanish/Portuguese Specialty) > Princeton University Library > > > |
From: Alain C. <ala...@ag...> - 2015-07-14 08:30:59
|
Tim, Currently, XSLTForms is not interpreting media type correctly: the response media type has to be analyzed instead of submission/@mediatype which is there just for the request serialization. I tested adding the overrideMimeType property to the request and the browser errors don't occur anymore! I will fix this as soon as possible. Thanks! --Alain Le 10/07/2015 16:08, Tim Thompson a écrit : > Alain, > > I'm testing XSLTForms on an Apache XAMPP server (though not yet with > SaxonHE9-4-0-7), and I had (another) question about browser errors. > > Here's a Gist that shows a basic submission from XSLTForms to > DBpedia's SPARQL endpoint, using @replace="text" on the > <xf:submission> element: > https://gist.github.com/Timathom/176a1e6865215b00d544 > > This works beautifully, but in Firefox and IE 11, I am getting browser > errors on the XHR response. > > Here is the HTTP response header in Firefox: > > HTTP/1.1 200 OK > Date: Fri, 10 Jul 2015 13:26:30 GMT > Content-Type: application/ld+json > Content-Length: 7127 > Connection: keep-alive > Server: Virtuoso/07.20.3214 (Linux) i686-generic-linux-glibc212-64 VDB > Access-Control-Allow-Origin: http://localhost > access-control-allow-credentials: true > access-control-expose-headers: Content-Type > Access-Control-Allow-Headers: Accept, Authorization, Slug, Link, > Origin, Content-type > Expires: Fri, 17 Jul 2015 13:26:30 GMT > Cache-Control: max-age=604800 > Accept-Ranges: bytes > > Even though the server returns a Content-Type of > "application/ld+json," the browser still tries to parse it as XML. > Firefox throws this error (via Firebug): > > XML Parsing Error: not well-formed Location: > moz-nullprincipal:{a25b11dd-9e4b-5f40-bb8b-b9415ed8d56e} Line Number > 1, Column 1: > > { "@graph": [ > ^ > > IE 11 throws this error: > > XML5619: Incorrect document syntax. Line: 1, Column 1 > > Chrome does not throw a (visible) error. I guess that these errors are > probably harmless, but is there any way to avoid them, and to prevent > the browser from trying to parse the response as XML when the XForms > submission has a @replace attribute value of "text" and the > Content-Type of the response is a non-XML format? > > Thanks again! > Tim > > -- > Tim A. Thompson > Metadata Librarian (Spanish/Portuguese Specialty) > Princeton University Library > |
From: Mark S. <m_s...@ma...> - 2015-07-12 08:27:48
|
Hi Alain, Indeed, I will contact them to suggest they fix the headers. Thanks once again Alain for support well beyond the call of duty! Best wishes Mark > On 10 Jul 2015, at 22:26, Alain Couthures <ala...@ag...> wrote: > > Mark, > > When compared with a dbpedia.org response, there should be response headers such as: > > Access-Control-Allow-Origin: http://localhost <http://localhost/> > Access-Control-Allow-Credentials: true > Access-Control-Expose-Headers: Content-Type > Access-Control-Allow-Headers: Accept, Authorization, Slug, Link, Origin, Content-type > > The web administrator for www.nearby.org.uk <http://www.nearby.org.uk/> should be contacted for these headers to be added, don't you think? > > Thank you for your feedback! > > --Alain > > Le 10/07/2015 22:17, Alain Couthures a écrit : >> As I suspected, this is a cross-domain restriction. I have not been looking at this for a long time and it has surely been improved ( <https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS>https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS <https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS>)! >> >> --Alain >> >> Le 10/07/2015 22:05, Alain Couthures a écrit : >>> Hello Mark, >>> >>> The browser debugger says that the response is empty... but it can be viewed in a different tab! >>> >>> I have to check the HTTP request... >>> >>> --Alain >>> >>> Le 10/07/2015 21:57, Mark Seaborne a écrit : >>>> <html xmlns=" <http://www.w3.org/1999/xhtml>http://www.w3.org/1999/xhtml <http://www.w3.org/1999/xhtml>" >>>> xmlns:nr=" <http://www.nearby.org.uk/>http://www.nearby.org.uk <http://www.nearby.org.uk/>" >>>> xmlns:xf=" <http://www.w3.org/2002/xforms>http://www.w3.org/2002/xforms <http://www.w3.org/2002/xforms>" >>>> xmlns:ev=" <http://www.w3.org/2001/xml-events>http://www.w3.org/2001/xml-events <http://www.w3.org/2001/xml-events>"> >>>> >>>> <head> >>>> <title>Test</title> >>>> >>>> >>>> <xf:model id="theModel"> >>>> <xf:instance id="var" xmlns=""> >>>> <doc> >>>> <!--co-ordinates--> >>>> <convert> >>>> <key>37d6c2c0832f6b</key> >>>> <p>303743,967206</p> >>>> <in>gr-osgb36</in> >>>> <need>gr10-osgb36</need> >>>> <output>sxml</output> >>>> </convert> >>>> </doc> >>>> </xf:instance> >>>> >>>> <xf:instance id="gridRef"> >>>> <convert xmlns=" <http://www.nearby.org.uk/>http://www.nearby.org.uk <http://www.nearby.org.uk/>" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance <http://www.w3.org/2001/XMLSchema-instance>" xsi:schemaLocation=" <http://www.nearby.org.uk/api/convert.xsd>http://www.nearby.org.uk/api/convert.xsd <http://www.nearby.org.uk/api/convert.xsd>"> >>>> <info href=" <http://www.nearby.org.uk/api/convert-help.php>http://www.nearby.org.uk/api/convert-help.php <http://www.nearby.org.uk/api/convert-help.php>"/> >>>> <input> >>>> <en datum="osgb36" e="302872" n="966758"/> >>>> </input> >>>> <output> >>>> <gaz country="United Kingdom"/> >>>> <gr10 datum="osgb36" gr10="ND 02872 66758"/> >>>> <gr datum="osgb36" gr="ND0287266758" digits="10"/> >>>> <ll datum="wgs84" lat="58.577939885331" long="-3.6719623952203"/> >>>> </output> >>>> </convert> >>>> </xf:instance> >>>> >>>> >>>> <xf:submission id="getGridRef" >>>> method="get" >>>> replace="instance" >>>> instance="gridRef" >>>> ref="instance('var')/convert" >>>> serialization="application/x-www-form-urlencoded" >>>> resource=" <http://www.nearby.org.uk/api/convert.php>http://www.nearby.org.uk/api/convert.php <http://www.nearby.org.uk/api/convert.php>"> >>>> <xf:action ev:event="xforms-submit-error"> >>>> <xf:message level="modal">'<xf:output value="instance('var')/convert/p"/>' getGridRef didn't work</xf:message> >>>> </xf:action> >>>> </xf:submission> >>>> >>>> </xf:model> >>>> >>>> </head> >>>> >>>> <body> >>>> <xf:input ref="instance('var')/convert/p"> >>>> <xf:label>EPSG:27700 co-ordinates</xf:label> >>>> </xf:input> >>>> >>>> <xf:submit submission="getGridRef"> >>>> <xf:label>Get Ordnance Survey Grid Reference</xf:label> >>>> </xf:submit> >>>> >>>> <p>OS Grid Reference is: <xf:output ref="instance('gridRef')/nr:output/nr:gr10/@gr10"/></p> >>>> </body> >>>> </html> >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Don't Limit Your Business. Reach for the Cloud. >>> GigeNET's Cloud Solutions provide you with the tools and support that >>> you need to offload your IT needs and focus on growing your business. >>> Configured For All Businesses. Start Your Cloud Today. >>> https://www.gigenetcloud.com/ <https://www.gigenetcloud.com/> >>> >>> _______________________________________________ >>> 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> >> >> >> >> ------------------------------------------------------------------------------ >> Don't Limit Your Business. Reach for the Cloud. >> GigeNET's Cloud Solutions provide you with the tools and support that >> you need to offload your IT needs and focus on growing your business. >> Configured For All Businesses. Start Your Cloud Today. >> https://www.gigenetcloud.com/ <https://www.gigenetcloud.com/> >> >> _______________________________________________ >> 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...> - 2015-07-10 20:27:08
|
Mark, When compared with a dbpedia.org response, there should be response headers such as: Access-Control-Allow-Origin: http://localhost Access-Control-Allow-Credentials: true Access-Control-Expose-Headers: Content-Type Access-Control-Allow-Headers: Accept, Authorization, Slug, Link, Origin, Content-type The web administrator for www.nearby.org.uk should be contacted for these headers to be added, don't you think? Thank you for your feedback! --Alain Le 10/07/2015 22:17, Alain Couthures a écrit : > As I suspected, this is a cross-domain restriction. I have not been > looking at this for a long time and it has surely been improved > (https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS)! > > --Alain > > Le 10/07/2015 22:05, Alain Couthures a écrit : >> Hello Mark, >> >> The browser debugger says that the response is empty... but it can be >> viewed in a different tab! >> >> I have to check the HTTP request... >> >> --Alain >> >> Le 10/07/2015 21:57, Mark Seaborne a écrit : >>> <htmlxmlns="http://www.w3.org/1999/xhtml" >>> xmlns:nr="http://www.nearby.org.uk" >>> xmlns:xf="http://www.w3.org/2002/xforms" >>> xmlns:ev="http://www.w3.org/2001/xml-events"> >>> >>> <head> >>> <title>Test</title> >>> >>> >>> <xf:modelid="theModel"> >>> <xf:instanceid="var"xmlns=""> >>> <doc> >>> <!--co-ordinates--> >>> <convert> >>> <key>37d6c2c0832f6b</key> >>> <p>303743,967206</p> >>> <in>gr-osgb36</in> >>> <need>gr10-osgb36</need> >>> <output>sxml</output> >>> </convert> >>> </doc> >>> </xf:instance> >>> >>> <xf:instanceid="gridRef"> >>> <convertxmlns="http://www.nearby.org.uk"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.nearby.org.uk/api/convert.xsd"> >>> <infohref="http://www.nearby.org.uk/api/convert-help.php"/> >>> <input> >>> <endatum="osgb36"e="302872"n="966758"/> >>> </input> >>> <output> >>> <gazcountry="United Kingdom"/> >>> <gr10datum="osgb36"gr10="ND 02872 66758"/> >>> <grdatum="osgb36"gr="ND0287266758"digits="10"/> >>> <lldatum="wgs84"lat="58.577939885331"long="-3.6719623952203"/> >>> </output> >>> </convert> >>> </xf:instance> >>> >>> >>> <xf:submissionid="getGridRef" >>> method="get" >>> replace="instance" >>> instance="gridRef" >>> ref="instance('var')/convert" >>> serialization="application/x-www-form-urlencoded" >>> resource="http://www.nearby.org.uk/api/convert.php"> >>> <xf:actionev:event="xforms-submit-error"> >>> <xf:messagelevel="modal">'<xf:outputvalue="instance('var')/convert/p"/>' >>> getGridRef didn't work</xf:message> >>> </xf:action> >>> </xf:submission> >>> >>> </xf:model> >>> >>> </head> >>> >>> <body> >>> <xf:inputref="instance('var')/convert/p"> >>> <xf:label>EPSG:27700 co-ordinates</xf:label> >>> </xf:input> >>> >>> <xf:submitsubmission="getGridRef"> >>> <xf:label>Get Ordnance Survey Grid Reference</xf:label> >>> </xf:submit> >>> >>> <p>OS Grid Reference is: >>> <xf:outputref="instance('gridRef')/nr:output/nr:gr10/@gr10"/></p> >>> </body> >>> </html> >> >> >> >> ------------------------------------------------------------------------------ >> Don't Limit Your Business. Reach for the Cloud. >> GigeNET's Cloud Solutions provide you with the tools and support that >> you need to offload your IT needs and focus on growing your business. >> Configured For All Businesses. Start Your Cloud Today. >> https://www.gigenetcloud.com/ >> >> >> _______________________________________________ >> Xsltforms-support mailing list >> Xsl...@li... >> https://lists.sourceforge.net/lists/listinfo/xsltforms-support > > > > ------------------------------------------------------------------------------ > Don't Limit Your Business. Reach for the Cloud. > GigeNET's Cloud Solutions provide you with the tools and support that > you need to offload your IT needs and focus on growing your business. > Configured For All Businesses. Start Your Cloud Today. > https://www.gigenetcloud.com/ > > > _______________________________________________ > Xsltforms-support mailing list > Xsl...@li... > https://lists.sourceforge.net/lists/listinfo/xsltforms-support |
From: Alain C. <ala...@ag...> - 2015-07-10 20:17:58
|
As I suspected, this is a cross-domain restriction. I have not been looking at this for a long time and it has surely been improved (https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS)! --Alain Le 10/07/2015 22:05, Alain Couthures a écrit : > Hello Mark, > > The browser debugger says that the response is empty... but it can be > viewed in a different tab! > > I have to check the HTTP request... > > --Alain > > Le 10/07/2015 21:57, Mark Seaborne a écrit : >> <htmlxmlns="http://www.w3.org/1999/xhtml" >> xmlns:nr="http://www.nearby.org.uk" >> xmlns:xf="http://www.w3.org/2002/xforms" >> xmlns:ev="http://www.w3.org/2001/xml-events"> >> >> <head> >> <title>Test</title> >> >> >> <xf:modelid="theModel"> >> <xf:instanceid="var"xmlns=""> >> <doc> >> <!--co-ordinates--> >> <convert> >> <key>37d6c2c0832f6b</key> >> <p>303743,967206</p> >> <in>gr-osgb36</in> >> <need>gr10-osgb36</need> >> <output>sxml</output> >> </convert> >> </doc> >> </xf:instance> >> >> <xf:instanceid="gridRef"> >> <convertxmlns="http://www.nearby.org.uk"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.nearby.org.uk/api/convert.xsd"> >> <infohref="http://www.nearby.org.uk/api/convert-help.php"/> >> <input> >> <endatum="osgb36"e="302872"n="966758"/> >> </input> >> <output> >> <gazcountry="United Kingdom"/> >> <gr10datum="osgb36"gr10="ND 02872 66758"/> >> <grdatum="osgb36"gr="ND0287266758"digits="10"/> >> <lldatum="wgs84"lat="58.577939885331"long="-3.6719623952203"/> >> </output> >> </convert> >> </xf:instance> >> >> >> <xf:submissionid="getGridRef" >> method="get" >> replace="instance" >> instance="gridRef" >> ref="instance('var')/convert" >> serialization="application/x-www-form-urlencoded" >> resource="http://www.nearby.org.uk/api/convert.php"> >> <xf:actionev:event="xforms-submit-error"> >> <xf:messagelevel="modal">'<xf:outputvalue="instance('var')/convert/p"/>' >> getGridRef didn't work</xf:message> >> </xf:action> >> </xf:submission> >> >> </xf:model> >> >> </head> >> >> <body> >> <xf:inputref="instance('var')/convert/p"> >> <xf:label>EPSG:27700 co-ordinates</xf:label> >> </xf:input> >> >> <xf:submitsubmission="getGridRef"> >> <xf:label>Get Ordnance Survey Grid Reference</xf:label> >> </xf:submit> >> >> <p>OS Grid Reference is: >> <xf:outputref="instance('gridRef')/nr:output/nr:gr10/@gr10"/></p> >> </body> >> </html> > > > > ------------------------------------------------------------------------------ > Don't Limit Your Business. Reach for the Cloud. > GigeNET's Cloud Solutions provide you with the tools and support that > you need to offload your IT needs and focus on growing your business. > Configured For All Businesses. Start Your Cloud Today. > https://www.gigenetcloud.com/ > > > _______________________________________________ > Xsltforms-support mailing list > Xsl...@li... > https://lists.sourceforge.net/lists/listinfo/xsltforms-support |
From: Alain C. <ala...@ag...> - 2015-07-10 20:06:09
|
Hello Mark, The browser debugger says that the response is empty... but it can be viewed in a different tab! I have to check the HTTP request... --Alain Le 10/07/2015 21:57, Mark Seaborne a écrit : > <htmlxmlns="http://www.w3.org/1999/xhtml" > xmlns:nr="http://www.nearby.org.uk" > xmlns:xf="http://www.w3.org/2002/xforms" > xmlns:ev="http://www.w3.org/2001/xml-events"> > > <head> > <title>Test</title> > > > <xf:modelid="theModel"> > <xf:instanceid="var"xmlns=""> > <doc> > <!--co-ordinates--> > <convert> > <key>37d6c2c0832f6b</key> > <p>303743,967206</p> > <in>gr-osgb36</in> > <need>gr10-osgb36</need> > <output>sxml</output> > </convert> > </doc> > </xf:instance> > > <xf:instanceid="gridRef"> > <convertxmlns="http://www.nearby.org.uk"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.nearby.org.uk/api/convert.xsd"> > <infohref="http://www.nearby.org.uk/api/convert-help.php"/> > <input> > <endatum="osgb36"e="302872"n="966758"/> > </input> > <output> > <gazcountry="United Kingdom"/> > <gr10datum="osgb36"gr10="ND 02872 66758"/> > <grdatum="osgb36"gr="ND0287266758"digits="10"/> > <lldatum="wgs84"lat="58.577939885331"long="-3.6719623952203"/> > </output> > </convert> > </xf:instance> > > > <xf:submissionid="getGridRef" > method="get" > replace="instance" > instance="gridRef" > ref="instance('var')/convert" > serialization="application/x-www-form-urlencoded" > resource="http://www.nearby.org.uk/api/convert.php"> > <xf:actionev:event="xforms-submit-error"> > <xf:messagelevel="modal">'<xf:outputvalue="instance('var')/convert/p"/>' > getGridRef didn't work</xf:message> > </xf:action> > </xf:submission> > > </xf:model> > > </head> > > <body> > <xf:inputref="instance('var')/convert/p"> > <xf:label>EPSG:27700 co-ordinates</xf:label> > </xf:input> > > <xf:submitsubmission="getGridRef"> > <xf:label>Get Ordnance Survey Grid Reference</xf:label> > </xf:submit> > > <p>OS Grid Reference is: > <xf:outputref="instance('gridRef')/nr:output/nr:gr10/@gr10"/></p> > </body> > </html> |
From: Mark S. <m_s...@ma...> - 2015-07-10 19:58:09
|
Hi Tim, Here is a complete test form: <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet href="../xsltforms/xsltforms.xsl" type="application/xml"?> <?xsltforms-options debug="yes"?> <?css-conversion no?> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:nr="http://www.nearby.org.uk" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events"> <head> <title>Test</title> <xf:model id="theModel"> <xf:instance id="var" xmlns=""> <doc> <!--co-ordinates--> <convert> <key>37d6c2c0832f6b</key> <p>303743,967206</p> <in>gr-osgb36</in> <need>gr10-osgb36</need> <output>sxml</output> </convert> </doc> </xf:instance> <xf:instance id="gridRef"> <convert xmlns="http://www.nearby.org.uk" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.nearby.org.uk/api/convert.xsd"> <info href="http://www.nearby.org.uk/api/convert-help.php"/> <input> <en datum="osgb36" e="302872" n="966758"/> </input> <output> <gaz country="United Kingdom"/> <gr10 datum="osgb36" gr10="ND 02872 66758"/> <gr datum="osgb36" gr="ND0287266758" digits="10"/> <ll datum="wgs84" lat="58.577939885331" long="-3.6719623952203"/> </output> </convert> </xf:instance> <xf:submission id="getGridRef" method="get" replace="instance" instance="gridRef" ref="instance('var')/convert" serialization="application/x-www-form-urlencoded" resource="http://www.nearby.org.uk/api/convert.php"> <xf:action ev:event="xforms-submit-error"> <xf:message level="modal">'<xf:output value="instance('var')/convert/p"/>' getGridRef didn't work</xf:message> </xf:action> </xf:submission> </xf:model> </head> <body> <xf:input ref="instance('var')/convert/p"> <xf:label>EPSG:27700 co-ordinates</xf:label> </xf:input> <xf:submit submission="getGridRef"> <xf:label>Get Ordnance Survey Grid Reference</xf:label> </xf:submit> <p>OS Grid Reference is: <xf:output ref="instance('gridRef')/nr:output/nr:gr10/@gr10"/></p> </body> </html> > On 10 Jul 2015, at 21:01, Tim Thompson <tim...@gm...> wrote: > > Hi, Mark, > > What do your instances look like? Could you include a more complete example? > > Best, > Tim > > > -- > Tim A. Thompson > Metadata Librarian (Spanish/Portuguese Specialty) > Princeton University Library > <mailto:ta...@pr...> > > On Fri, Jul 10, 2015 at 2:45 PM, Mark Seaborne <m_s...@ma... <mailto:m_s...@ma...>> wrote: > Hi, > > I have a simple submit that is failing, if anyone can suggest something to try I would be very grateful. I’m sure I must have missed something obvious. > > Here is what XSLTForms, build 615, reports: > > Submit get - application/xml - http://www.nearby.org.uk/api/convert.php?key=37d6c2c0832f6b&p=303657%2C965123&in=gr-osgb36&need=gr10-osgb36&output=sxml <http://www.nearby.org.uk/api/convert.php?key=37d6c2c0832f6b&p=303657%2C965123&in=gr-osgb36&need=gr10-osgb36&output=sxml> - false > > If I copy the URL string into a browser the expected XML document is returned, so there is no problem there. > > Here is the submission itself: > > <xf:submission id="getGridRef" > method="get" > replace="instance" > instance="coord" > ref="instance('var')/convert" > serialization="application/x-www-form-urlencoded" > resource="http://www.nearby.org.uk/api/convert.php <http://www.nearby.org.uk/api/convert.php>"> > <xf:action ev:event="xforms-submit-error"> > <xf:message level="modal">'<xf:output value="instance('var')/convert/p"/>' getGridRef didn't work</xf:message> > </xf:action> > </xf:submission> > > Best wishes > > Mark > > ------------------------------------------------------------------------------ > Don't Limit Your Business. Reach for the Cloud. > GigeNET's Cloud Solutions provide you with the tools and support that > you need to offload your IT needs and focus on growing your business. > Configured For All Businesses. Start Your Cloud Today. > https://www.gigenetcloud.com/ <https://www.gigenetcloud.com/> > _______________________________________________ > 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: Tim T. <tim...@gm...> - 2015-07-10 19:01:37
|
Hi, Mark, What do your instances look like? Could you include a more complete example? Best, Tim -- Tim A. Thompson Metadata Librarian (Spanish/Portuguese Specialty) Princeton University Library <ta...@pr...> On Fri, Jul 10, 2015 at 2:45 PM, Mark Seaborne <m_s...@ma...> wrote: > Hi, > > I have a simple submit that is failing, if anyone can suggest something to > try I would be very grateful. I’m sure I must have missed something obvious. > > Here is what XSLTForms, build 615, reports: > > Submit get - application/xml - > http://www.nearby.org.uk/api/convert.php?key=37d6c2c0832f6b&p=303657%2C965123&in=gr-osgb36&need=gr10-osgb36&output=sxml > - false > > If I copy the URL string into a browser the expected XML document is > returned, so there is no problem there. > > Here is the submission itself: > > <xf:submission id="getGridRef" > method="get" > replace="instance" > instance="coord" > ref="instance('var')/convert" > serialization="application/x-www-form-urlencoded" > resource="http://www.nearby.org.uk/api/convert.php"> > <xf:action ev:event="xforms-submit-error"> > <xf:message level="modal">'<xf:output value="instance('var')/convert/p"/>' > getGridRef didn't work</xf:message> > </xf:action> > </xf:submission> > > Best wishes > > Mark > > > ------------------------------------------------------------------------------ > Don't Limit Your Business. Reach for the Cloud. > GigeNET's Cloud Solutions provide you with the tools and support that > you need to offload your IT needs and focus on growing your business. > Configured For All Businesses. Start Your Cloud Today. > https://www.gigenetcloud.com/ > _______________________________________________ > Xsltforms-support mailing list > Xsl...@li... > https://lists.sourceforge.net/lists/listinfo/xsltforms-support > > |
From: Mark S. <m_s...@ma...> - 2015-07-10 18:45:16
|
Hi, I have a simple submit that is failing, if anyone can suggest something to try I would be very grateful. I’m sure I must have missed something obvious. Here is what XSLTForms, build 615, reports: Submit get - application/xml - http://www.nearby.org.uk/api/convert.php?key=37d6c2c0832f6b&p=303657%2C965123&in=gr-osgb36&need=gr10-osgb36&output=sxml - false If I copy the URL string into a browser the expected XML document is returned, so there is no problem there. Here is the submission itself: <xf:submission id="getGridRef" method="get" replace="instance" instance="coord" ref="instance('var')/convert" serialization="application/x-www-form-urlencoded" resource="http://www.nearby.org.uk/api/convert.php"> <xf:action ev:event="xforms-submit-error"> <xf:message level="modal">'<xf:output value="instance('var')/convert/p"/>' getGridRef didn't work</xf:message> </xf:action> </xf:submission> Best wishes Mark |
From: Tim T. <tim...@gm...> - 2015-07-10 14:08:40
|
Alain, I'm testing XSLTForms on an Apache XAMPP server (though not yet with SaxonHE9-4-0-7), and I had (another) question about browser errors. Here's a Gist that shows a basic submission from XSLTForms to DBpedia's SPARQL endpoint, using @replace="text" on the <xf:submission> element: https://gist.github.com/Timathom/176a1e6865215b00d544 This works beautifully, but in Firefox and IE 11, I am getting browser errors on the XHR response. Here is the HTTP response header in Firefox: HTTP/1.1 200 OK Date: Fri, 10 Jul 2015 13:26:30 GMT Content-Type: application/ld+json Content-Length: 7127 Connection: keep-alive Server: Virtuoso/07.20.3214 (Linux) i686-generic-linux-glibc212-64 VDB Access-Control-Allow-Origin: http://localhost access-control-allow-credentials: true access-control-expose-headers: Content-Type Access-Control-Allow-Headers: Accept, Authorization, Slug, Link, Origin, Content-type Expires: Fri, 17 Jul 2015 13:26:30 GMT Cache-Control: max-age=604800 Accept-Ranges: bytes Even though the server returns a Content-Type of "application/ld+json," the browser still tries to parse it as XML. Firefox throws this error (via Firebug): XML Parsing Error: not well-formed Location: moz-nullprincipal:{a25b11dd-9e4b-5f40-bb8b-b9415ed8d56e} Line Number 1, Column 1: { "@graph": [ ^ IE 11 throws this error: XML5619: Incorrect document syntax. Line: 1, Column 1 Chrome does not throw a (visible) error. I guess that these errors are probably harmless, but is there any way to avoid them, and to prevent the browser from trying to parse the response as XML when the XForms submission has a @replace attribute value of "text" and the Content-Type of the response is a non-XML format? Thanks again! Tim -- Tim A. Thompson Metadata Librarian (Spanish/Portuguese Specialty) Princeton University Library |
From: Alain C. <ala...@ag...> - 2015-07-09 17:02:02
|
Hello Tim, I have integrated SaxonHE9-4-0-7J in PHP-based dev environment for XSLTForms. A Windows command file is used to perform the transformation: java -cp /Saxon/saxon9he.jar net.sf.saxon.Transform -t -s:%1 -xsl:%2 -o:%3 1> \Saxon\saxon.log 2>&1 It works as expected (it is just slower than with native XSLT engine...) and the corresponding log file is not mentioning any error: Saxon-HE 9.4.0.7J from Saxonica Java version 1.8.0_45 Warning: at xsl:stylesheet on line 29 column 675 of txsA520.tmp: Running an XSLT 1 stylesheet with an XSLT 2 processor Stylesheet compilation time: 1579 milliseconds Processing file:/C:/Windows/Temp/txsA51F.tmp Using parser com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser Building tree for file:/C:/Windows/Temp/txsA51F.tmp using class net.sf.saxon.tree.tiny.TinyBuilder Tree built in 4 milliseconds Tree size: 64 nodes, 591 characters, 22 attributes URIResolver.resolve href="config.xsl" base="file:/C:/Windows/Temp/txsA520.tmp" Building tree for file:/C:/Windows/Temp/config.xsl using class net.sf.saxon.tree.tiny.TinyBuilder Tree built in 27 milliseconds Tree size: 111 nodes, 289 characters, 2 attributes Execution time: 252ms Memory used: 8513136 NamePool contents: 294 entries in 216 chains. 14 URIs Do you know a way to obtain the Saxon log when used within eXist? Could please you send me this log? Thanks! --Alain Le 08/07/2015 21:44, Tim Thompson a écrit : > Hello, > > In eXist 3.0.RC1, versions of XSLTForms greater than Rev. 594 (the one > that ships with eXist) do not seem to work. Versions beginning with > Rev. 595[1] cause a transformation error: "Error during XSLT > transformation: XSLT Stylesheet (possibly) contains a recursion." > XSLTForms up to Rev. 617 have been running successfully in eXist 2.2. > > Best, > Tim > > [1] > https://github.com/AlainCouthures/xsltforms/commit/97657f909fedb79981dca82d69d62068392ebeef > > -- > Tim A. Thompson > Metadata Librarian (Spanish/Portuguese Specialty) > Princeton University Library > > > > ------------------------------------------------------------------------------ > Don't Limit Your Business. Reach for the Cloud. > GigeNET's Cloud Solutions provide you with the tools and support that > you need to offload your IT needs and focus on growing your business. > Configured For All Businesses. Start Your Cloud Today. > https://www.gigenetcloud.com/ > > > _______________________________________________ > Xsltforms-support mailing list > Xsl...@li... > https://lists.sourceforge.net/lists/listinfo/xsltforms-support |
From: Tim T. <tim...@gm...> - 2015-07-09 12:58:21
|
That makes sense--thank you for the clarification! -- Tim A. Thompson Metadata Librarian (Spanish/Portuguese Specialty) Princeton University Library On Thu, Jul 9, 2015 at 12:53 AM, Alain Couthures < ala...@ag...> wrote: > Tim, > > Firefox-only issues are usually caused by its XSLT engine not supporting > the namespace axis. A trick is necessary for XSLTForms to get the > namespaceURI from the prefix: adding some dummy attribute, such as > bf:dummy="dummy", at the document element should be enough. With this > trick, your test forms are working for me with Firefox too. > > Subforms mechanism in XSLTForms is merging models and ignoring already > existing instances. Without any declared model, XSLTForms is actually > declaring a default one. For unit tests, it might be interesting to declare > the main models and the main instances used in the subform just to be able > to run it independently. > > Thank you for your feedback! > > --Alain > > > Le 09/07/2015 06:29, Tim Thompson a écrit : > > Tried to send this to the list with an attachment, but was bounced. > Sending again without it. --Tim > > ---------- Forwarded message ---------- > From: Tim Thompson <tim...@gm...> > Date: Thu, Jul 9, 2015 at 12:25 AM > Subject: Namespaces in subforms (Firefox) > To: Alain Couthures <ala...@ag...> > Cc: xsl...@li... > > > Alain, > > The "not well-formed" issue in Firefox seems to have been caused by an > external JavaScript library that I was using, so I'll have to investigate > that myself. > > However, I did discover another issue in Firefox that may or may not be a > bug. > > My understanding of subforms in XSLTForms, as Eric van der Vlist explains > it, is that "XSLTForms doesn’t isolate the models from the master form and > its subform and it is possible to access directly to any instance of the > master form from the subforms." By that token, it should not be necessary > to repeat instance data in a subform model, is that correct? The subform > controls can be bound directly to the mainform instances. > > A couple of basic tests seems to confirm that this is the case (using > your writers/books example). Test 1 works in Firefox, Chrome, and IE. But > if namespaced elements are used in the mainform instance, as in Test 2, > this pattern causes Firefox to fail. If the model element is uncommented in > Subform 2, then Firefox loads the subform correctly. > > So, is a local model always necessary in the subform, or is this an issue > with Firefox? Tests are also attached. > > Thanks again, > Tim > > > Test 1 (no namespaced instance elements) > > Mainform > > <html > xmlns="http://www.w3.org/1999/xhtml" > xmlns:bf=" <http://bibframe.org/vocab/>http://bibframe.org/vocab/" > xmlns:xforms=" <http://www.w3.org/2002/xforms> > http://www.w3.org/2002/xforms" > xmlns:ev=" <http://www.w3.org/2001/xml-events> > http://www.w3.org/2001/xml-events"> > <head> > <title>Writers (Subforms)</title> > <xforms:model> > <xforms:instance xmlns=""> > <Writers> > <Writer firstname="Albert" lastname="Camus" > selected="false"> > <Book year="1938" title="Caligula"/> > <Book year="1942" title="L'étranger"/> > <Book year="1947" title="La peste"/> > <Book year="1951" title="L'homme révolté"/> > </Writer> > </Writers> > </xforms:instance> > </xforms:model> > </head> > <body> > <h3>Writers (Subforms)</h3> > <xforms:repeat nodeset="Writer" appearance="compact"> > <p> > <xforms:output ref="@firstname"/> <xforms:output > ref="@lastname"/>  > <xforms:trigger> > <xforms:label><xforms:output value="choose(@selected > != 'true','Show','Hide')"/> books</xforms:label> > <xforms:action ev:event="DOMActivate"> > <xforms:load if="@selected != 'true'" show="embed" > targetid="subform" resource="test1-subform.xhtml"/> > <xforms:unload if="@selected = 'true'" > targetid="subform"/> > <xforms:setvalue ref="@selected" value=". != > 'true'"/> > </xforms:action> > </xforms:trigger> > <xforms:group id="subform"/> > </p> > </xforms:repeat> > </body> > </html> > > Subform > > <html > xmlns="http://www.w3.org/1999/xhtml" > xmlns:bf=" <http://bibframe.org/vocab/>http://bibframe.org/vocab/" > xmlns:xforms=" <http://www.w3.org/2002/xforms> > http://www.w3.org/2002/xforms" > xmlns:ev=" <http://www.w3.org/2001/xml-events> > http://www.w3.org/2001/xml-events"> > <head> > <title>Books</title> > <!--<xforms:model> > <xforms:instance> > <Books> > <Book year="2013" title="XForms with XSLTForms"/> > </Books> > </xforms:instance> > </xforms:model>--> > </head> > <body> > <xforms:repeat nodeset="Book"> > <xforms:output value="@year"/> - <xforms:output > value="@title"/> > </xforms:repeat> > </body> > </html> > > > Test 2 > > Mainform > > <html > xmlns="http://www.w3.org/1999/xhtml" > xmlns:bf=" <http://bibframe.org/vocab/>http://bibframe.org/vocab/" > xmlns:xforms=" <http://www.w3.org/2002/xforms> > http://www.w3.org/2002/xforms" > xmlns:ev=" <http://www.w3.org/2001/xml-events> > http://www.w3.org/2001/xml-events"> > <head> > <title>Writers (Subforms)</title> > <xforms:model> > <xforms:instance> > <bf:Writers> > <bf:Writer firstname="Albert" lastname="Camus" > selected="false"> > <bf:Book year="1938" title="Caligula"/> > <bf:Book year="1942" title="L'étranger"/> > <bf:Book year="1947" title="La peste"/> > <bf:Book year="1951" title="L'homme révolté"/> > </bf:Writer> > </bf:Writers> > </xforms:instance> > </xforms:model> > </head> > <body> > <h3>Writers (Subforms)</h3> > <xforms:repeat nodeset="bf:Writer" appearance="compact"> > <p> > <xforms:output ref="@firstname"/> <xforms:output > ref="@lastname"/>  > <xforms:trigger> > <xforms:label><xforms:output value="choose(@selected > != 'true','Show','Hide')"/> books</xforms:label> > <xforms:action ev:event="DOMActivate"> > <xforms:load if="@selected != 'true'" show="embed" > targetid="subform" resource="test2-subform.xhtml"/> > <xforms:unload if="@selected = 'true'" > targetid="subform"/> > <xforms:setvalue ref="@selected" value=". != > 'true'"/> > </xforms:action> > </xforms:trigger> > <xforms:group id="subform"/> > </p> > </xforms:repeat> > </body> > </html> > > Subform > > <html > xmlns="http://www.w3.org/1999/xhtml" > xmlns:bf=" <http://bibframe.org/vocab/>http://bibframe.org/vocab/" > xmlns:xforms=" <http://www.w3.org/2002/xforms> > http://www.w3.org/2002/xforms" > xmlns:ev=" <http://www.w3.org/2001/xml-events> > http://www.w3.org/2001/xml-events"> > <head> > <title>Books</title> > <!--<xforms:model> > <xforms:instance> > <bf:Books> > <bf:Book year="2013" title="XForms with XSLTForms"/> > </bf:Books> > </xforms:instance> > </xforms:model>--> > </head> > <body> > <xforms:repeat nodeset="bf:Book"> > <xforms:output value="@year"/> - <xforms:output > value="@title"/> > </xforms:repeat> > </body> > </html> > > > -- > Tim A. Thompson > Metadata Librarian (Spanish/Portuguese Specialty) > Princeton University Library > > > > ------------------------------------------------------------------------------ > Don't Limit Your Business. Reach for the Cloud. > GigeNET's Cloud Solutions provide you with the tools and support that > you need to offload your IT needs and focus on growing your business. > Configured For All Businesses. Start Your Cloud Today.https://www.gigenetcloud.com/ > > > > _______________________________________________ > Xsltforms-support mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/xsltforms-support > > > |
From: Alain C. <ala...@ag...> - 2015-07-09 04:53:53
|
Tim, Firefox-only issues are usually caused by its XSLT engine not supporting the namespace axis. A trick is necessary for XSLTForms to get the namespaceURI from the prefix: adding some dummy attribute, such as bf:dummy="dummy", at the document element should be enough. With this trick, your test forms are working for me with Firefox too. Subforms mechanism in XSLTForms is merging models and ignoring already existing instances. Without any declared model, XSLTForms is actually declaring a default one. For unit tests, it might be interesting to declare the main models and the main instances used in the subform just to be able to run it independently. Thank you for your feedback! --Alain Le 09/07/2015 06:29, Tim Thompson a écrit : > Tried to send this to the list with an attachment, but was bounced. > Sending again without it. --Tim > > ---------- Forwarded message ---------- > From: *Tim Thompson* <tim...@gm... <mailto:tim...@gm...>> > Date: Thu, Jul 9, 2015 at 12:25 AM > Subject: Namespaces in subforms (Firefox) > To: Alain Couthures <ala...@ag... > <mailto:ala...@ag...>> > Cc: xsl...@li... > <mailto:xsl...@li...> > > > Alain, > > The "not well-formed" issue in Firefox seems to have been caused by an > external JavaScript library that I was using, so I'll have to > investigate that myself. > > However, I did discover another issue in Firefox that may or may not > be a bug. > > My understanding of subforms in XSLTForms, as Eric van der Vlist > explains it, is that "XSLTForms doesn’t isolate the models from the > master form and its subform and it is possible to access directly to > any instance of the master form from the subforms." By that token, it > should not be necessary to repeat instance data in a subform model, is > that correct? The subform controls can be bound directly to the > mainform instances. > > A couple of basic tests seems to confirm that this is the case (using > your writers/books example). Test 1 works in Firefox, Chrome, and IE. > But if namespaced elements are used in the mainform instance, as in > Test 2, this pattern causes Firefox to fail. If the model element is > uncommented in Subform 2, then Firefox loads the subform correctly. > > So, is a local model always necessary in the subform, or is this an > issue with Firefox? Tests are also attached. > > Thanks again, > Tim > > > Test 1 (no namespaced instance elements) > > Mainform > > <html > xmlns="http://www.w3.org/1999/xhtml" > xmlns:bf="http://bibframe.org/vocab/" > xmlns:xforms="http://www.w3.org/2002/xforms" > xmlns:ev="http://www.w3.org/2001/xml-events"> > <head> > <title>Writers (Subforms)</title> > <xforms:model> > <xforms:instance xmlns=""> > <Writers> > <Writer firstname="Albert" lastname="Camus" > selected="false"> > <Book year="1938" title="Caligula"/> > <Book year="1942" title="L'étranger"/> > <Book year="1947" title="La peste"/> > <Book year="1951" title="L'homme révolté"/> > </Writer> > </Writers> > </xforms:instance> > </xforms:model> > </head> > <body> > <h3>Writers (Subforms)</h3> > <xforms:repeat nodeset="Writer" appearance="compact"> > <p> > <xforms:output ref="@firstname"/> <xforms:output > ref="@lastname"/>  > <xforms:trigger> > <xforms:label><xforms:output value="choose(@selected != > 'true','Show','Hide')"/> books</xforms:label> > <xforms:action ev:event="DOMActivate"> > <xforms:load if="@selected != 'true'" show="embed" targetid="subform" > resource="test1-subform.xhtml"/> > <xforms:unload if="@selected = 'true'" targetid="subform"/> > <xforms:setvalue ref="@selected" value=". != 'true'"/> > </xforms:action> > </xforms:trigger> > <xforms:group id="subform"/> > </p> > </xforms:repeat> > </body> > </html> > > Subform > > <html > xmlns="http://www.w3.org/1999/xhtml" > xmlns:bf="http://bibframe.org/vocab/" > xmlns:xforms="http://www.w3.org/2002/xforms" > xmlns:ev="http://www.w3.org/2001/xml-events"> > <head> > <title>Books</title> > <!--<xforms:model> > <xforms:instance> > <Books> > <Book year="2013" title="XForms with XSLTForms"/> > </Books> > </xforms:instance> > </xforms:model>--> > </head> > <body> > <xforms:repeat nodeset="Book"> > <xforms:output value="@year"/> - <xforms:output > value="@title"/> > </xforms:repeat> > </body> > </html> > > > Test 2 > > Mainform > > <html > xmlns="http://www.w3.org/1999/xhtml" > xmlns:bf="http://bibframe.org/vocab/" > xmlns:xforms="http://www.w3.org/2002/xforms" > xmlns:ev="http://www.w3.org/2001/xml-events"> > <head> > <title>Writers (Subforms)</title> > <xforms:model> > <xforms:instance> > <bf:Writers> > <bf:Writer firstname="Albert" lastname="Camus" > selected="false"> > <bf:Book year="1938" title="Caligula"/> > <bf:Book year="1942" title="L'étranger"/> > <bf:Book year="1947" title="La peste"/> > <bf:Book year="1951" title="L'homme révolté"/> > </bf:Writer> > </bf:Writers> > </xforms:instance> > </xforms:model> > </head> > <body> > <h3>Writers (Subforms)</h3> > <xforms:repeat nodeset="bf:Writer" appearance="compact"> > <p> > <xforms:output ref="@firstname"/> <xforms:output > ref="@lastname"/>  > <xforms:trigger> > <xforms:label><xforms:output value="choose(@selected != > 'true','Show','Hide')"/> books</xforms:label> > <xforms:action ev:event="DOMActivate"> > <xforms:load if="@selected != 'true'" show="embed" targetid="subform" > resource="test2-subform.xhtml"/> > <xforms:unload if="@selected = 'true'" targetid="subform"/> > <xforms:setvalue ref="@selected" value=". != 'true'"/> > </xforms:action> > </xforms:trigger> > <xforms:group id="subform"/> > </p> > </xforms:repeat> > </body> > </html> > > Subform > > <html > xmlns="http://www.w3.org/1999/xhtml" > xmlns:bf="http://bibframe.org/vocab/" > xmlns:xforms="http://www.w3.org/2002/xforms" > xmlns:ev="http://www.w3.org/2001/xml-events"> > <head> > <title>Books</title> > <!--<xforms:model> > <xforms:instance> > <bf:Books> > <bf:Book year="2013" title="XForms with XSLTForms"/> > </bf:Books> > </xforms:instance> > </xforms:model>--> > </head> > <body> > <xforms:repeat nodeset="bf:Book"> > <xforms:output value="@year"/> - <xforms:output > value="@title"/> > </xforms:repeat> > </body> > </html> > > > -- > Tim A. Thompson > Metadata Librarian (Spanish/Portuguese Specialty) > Princeton University Library > > > > ------------------------------------------------------------------------------ > Don't Limit Your Business. Reach for the Cloud. > GigeNET's Cloud Solutions provide you with the tools and support that > you need to offload your IT needs and focus on growing your business. > Configured For All Businesses. Start Your Cloud Today. > https://www.gigenetcloud.com/ > > > _______________________________________________ > Xsltforms-support mailing list > Xsl...@li... > https://lists.sourceforge.net/lists/listinfo/xsltforms-support |
From: Tim T. <tim...@gm...> - 2015-07-09 04:29:53
|
Tried to send this to the list with an attachment, but was bounced. Sending again without it. --Tim ---------- Forwarded message ---------- From: Tim Thompson <tim...@gm...> Date: Thu, Jul 9, 2015 at 12:25 AM Subject: Namespaces in subforms (Firefox) To: Alain Couthures <ala...@ag...> Cc: xsl...@li... Alain, The "not well-formed" issue in Firefox seems to have been caused by an external JavaScript library that I was using, so I'll have to investigate that myself. However, I did discover another issue in Firefox that may or may not be a bug. My understanding of subforms in XSLTForms, as Eric van der Vlist explains it, is that "XSLTForms doesn’t isolate the models from the master form and its subform and it is possible to access directly to any instance of the master form from the subforms." By that token, it should not be necessary to repeat instance data in a subform model, is that correct? The subform controls can be bound directly to the mainform instances. A couple of basic tests seems to confirm that this is the case (using your writers/books example). Test 1 works in Firefox, Chrome, and IE. But if namespaced elements are used in the mainform instance, as in Test 2, this pattern causes Firefox to fail. If the model element is uncommented in Subform 2, then Firefox loads the subform correctly. So, is a local model always necessary in the subform, or is this an issue with Firefox? Tests are also attached. Thanks again, Tim Test 1 (no namespaced instance elements) Mainform <html xmlns="http://www.w3.org/1999/xhtml" xmlns:bf="http://bibframe.org/vocab/" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events"> <head> <title>Writers (Subforms)</title> <xforms:model> <xforms:instance xmlns=""> <Writers> <Writer firstname="Albert" lastname="Camus" selected="false"> <Book year="1938" title="Caligula"/> <Book year="1942" title="L'étranger"/> <Book year="1947" title="La peste"/> <Book year="1951" title="L'homme révolté"/> </Writer> </Writers> </xforms:instance> </xforms:model> </head> <body> <h3>Writers (Subforms)</h3> <xforms:repeat nodeset="Writer" appearance="compact"> <p> <xforms:output ref="@firstname"/> <xforms:output ref="@lastname"/>  <xforms:trigger> <xforms:label><xforms:output value="choose(@selected != 'true','Show','Hide')"/> books</xforms:label> <xforms:action ev:event="DOMActivate"> <xforms:load if="@selected != 'true'" show="embed" targetid="subform" resource="test1-subform.xhtml"/> <xforms:unload if="@selected = 'true'" targetid="subform"/> <xforms:setvalue ref="@selected" value=". != 'true'"/> </xforms:action> </xforms:trigger> <xforms:group id="subform"/> </p> </xforms:repeat> </body> </html> Subform <html xmlns="http://www.w3.org/1999/xhtml" xmlns:bf="http://bibframe.org/vocab/" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events"> <head> <title>Books</title> <!--<xforms:model> <xforms:instance> <Books> <Book year="2013" title="XForms with XSLTForms"/> </Books> </xforms:instance> </xforms:model>--> </head> <body> <xforms:repeat nodeset="Book"> <xforms:output value="@year"/> - <xforms:output value="@title"/> </xforms:repeat> </body> </html> Test 2 Mainform <html xmlns="http://www.w3.org/1999/xhtml" xmlns:bf="http://bibframe.org/vocab/" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events"> <head> <title>Writers (Subforms)</title> <xforms:model> <xforms:instance> <bf:Writers> <bf:Writer firstname="Albert" lastname="Camus" selected="false"> <bf:Book year="1938" title="Caligula"/> <bf:Book year="1942" title="L'étranger"/> <bf:Book year="1947" title="La peste"/> <bf:Book year="1951" title="L'homme révolté"/> </bf:Writer> </bf:Writers> </xforms:instance> </xforms:model> </head> <body> <h3>Writers (Subforms)</h3> <xforms:repeat nodeset="bf:Writer" appearance="compact"> <p> <xforms:output ref="@firstname"/> <xforms:output ref="@lastname"/>  <xforms:trigger> <xforms:label><xforms:output value="choose(@selected != 'true','Show','Hide')"/> books</xforms:label> <xforms:action ev:event="DOMActivate"> <xforms:load if="@selected != 'true'" show="embed" targetid="subform" resource="test2-subform.xhtml"/> <xforms:unload if="@selected = 'true'" targetid="subform"/> <xforms:setvalue ref="@selected" value=". != 'true'"/> </xforms:action> </xforms:trigger> <xforms:group id="subform"/> </p> </xforms:repeat> </body> </html> Subform <html xmlns="http://www.w3.org/1999/xhtml" xmlns:bf="http://bibframe.org/vocab/" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events"> <head> <title>Books</title> <!--<xforms:model> <xforms:instance> <bf:Books> <bf:Book year="2013" title="XForms with XSLTForms"/> </bf:Books> </xforms:instance> </xforms:model>--> </head> <body> <xforms:repeat nodeset="bf:Book"> <xforms:output value="@year"/> - <xforms:output value="@title"/> </xforms:repeat> </body> </html> -- Tim A. Thompson Metadata Librarian (Spanish/Portuguese Specialty) Princeton University Library |
From: Tim T. <tim...@gm...> - 2015-07-08 20:53:22
|
Alain, I reinstalled eXist 2.2 and am not currently getting the "ambiguous rule match" error anymore. But, yes, there were originally 2 different @match values. Best, Tim -- Tim A. Thompson Metadata Librarian (Spanish/Portuguese Specialty) Princeton University Library On Wed, Jul 8, 2015 at 4:23 PM, Alain Couthures < ala...@ag...> wrote: > Tim, > > About "Ambiguous rule match", it sounds as if the error message is > incomplete because it should end with at least 2 different @match values. > Can you please check this? > > Thanks! > > --Alain > > > Le 08/07/2015 02:46, Tim Thompson a écrit : > > Alain, > > Thank you very much for these updates! > > However, I am running into a couple of errors. > > 1. In addition to the CDATA comments, > <?javax.xml.transform.enable-output-escaping?> processing instructions are > also being output inside the <script> tags, which is causing a syntax error > (in Firefox, Chrome, and IE). Firefox throws the following error: > > SyntaxError: expected expression, got '<' > > 2. When I clear my browser cache and reload the page, the transformation > breaks with a server error: > > Error while serializing XML: Ambiguous rule match for > /html/head[1]/script[1] Matches both "xhtml:script[not(@type) or @type = > 'text/javascript'] | script[not(@type) or @type = 'text/javascript']" > > Sorry for the trouble! > > Tim > > -- > Tim A. Thompson > Metadata Librarian (Spanish/Portuguese Specialty) > Princeton University Library > > > On Tue, Jul 7, 2015 at 3:23 PM, Alain Couthures < > <ala...@ag...>ala...@ag...> wrote: > >> Tim, >> >> I have now committed CDATA support: >> >> - script content is "escaped" with CDATA for "text/javascript" and >> "text/turtle" >> - @cdata-section-elements in submission is supported for all major >> browsers >> >> Thank you for your feedback! >> >> --Alain >> >> >> Le 06/07/2015 20:00, Tim Thompson a écrit : >> >> Alain, >> >> I think adding the proposed CDATA encapsulations to script elements >> would be a great solution. >> >> Regarding @cdata-section-elements, I do need this functionality, in some >> form, for the application I'm working on. But my first preference would be >> to output the CDATA sections on the server using XQuery. Unfortunately, >> eXist does not currently support cdata-section-elements as a serialization >> parameter either, so I was considering the @cdata-section-elements >> submission attribute as a temporary workaround. I do think this would be a >> good feature to have, but for now, just adding the CDATA encapsulations >> would make a big difference. >> >> Thanks again! >> Tim >> >> >> -- >> Tim A. Thompson >> Metadata Librarian (Spanish/Portuguese Specialty) >> Princeton University Library >> >> >> On Mon, Jul 6, 2015 at 1:08 PM, Alain Couthures < >> <ala...@ag...>ala...@ag...> wrote: >> >>> Tim, >>> >>> XSLT does not preserve CDATA nodes but treats them into text nodes. It >>> is still possible to treat script elements according to their type >>> attributes. I can modified the XSLT stylesheet accordingly: for >>> "text/javascript", the script value can be encapsulated with "/* <![CDATA[ >>> */" and "/* ]]> */", and, for "text/turtle", with "# <![CDATA[" and "# >>> ]]>". What do you think? >>> >>> For submission, adding support for @cdata-section-elements is not >>> difficult for non-IE browsers because serialization is performed with >>> Javascript instructions. For IE, because serialization is still based on an >>> XSLT transformation, the stylesheet source would have to be adapted >>> according to @cdata-section-elements value. Do you already need this? >>> >>> --Alain >>> >>> >>> Le 05/07/2015 04:10, Tim Thompson a écrit : >>> >>> Alain, >>> >>> I am trying to load a subform that contains a <script >>> type="text/turtle"> tag with RDF data serialized as Turtle. >>> >>> This data is enclosed in a CDATA section (per >>> <http://www.w3.org/TR/turtle/#h3_xhtml> >>> http://www.w3.org/TR/turtle/#h3_xhtml). However, when I load the >>> subform (as XHTML), the CDATA is ignored and all <> characters are escaped, >>> which causes the Turtle parser I am using to break. Shouldn't CDATA >>> contents be ignored when a subform is loaded? >>> >>> As a related question, does XSLTForms support the >>> @cdata-section-elements attribute on <xf:submission>? I see some reference >>> to it in the code, but wasn't sure whether it had been fully implemented. >>> This could be very useful for dealing with non-XML formats in hybrid >>> applications. >>> >>> Many thanks, >>> Tim >>> >>> -- >>> Tim A. Thompson >>> Metadata Librarian (Spanish/Portuguese Specialty) >>> Princeton University Library >>> >>> >>> ------------------------------------------------------------------------------ >>> Don't Limit Your Business. Reach for the Cloud. >>> GigeNET's Cloud Solutions provide you with the tools and support that >>> you need to offload your IT needs and focus on growing your business. >>> Configured For All Businesses. Start Your Cloud Today.https://www.gigenetcloud.com/ >>> >>> >>> >>> _______________________________________________ >>> Xsltforms-support mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/xsltforms-support >>> >>> >>> >> >> > > |
From: Alain C. <ala...@ag...> - 2015-07-08 20:23:39
|
Tim, About "Ambiguous rule match", it sounds as if the error message is incomplete because it should end with at least 2 different @match values. Can you please check this? Thanks! --Alain Le 08/07/2015 02:46, Tim Thompson a écrit : > Alain, > > Thank you very much for these updates! > > However, I am running into a couple of errors. > > 1. In addition to the CDATA comments, > <?javax.xml.transform.enable-output-escaping?> processing instructions > are also being output inside the <script> tags, which is causing a > syntax error (in Firefox, Chrome, and IE). Firefox throws the > following error: > > SyntaxError: expected expression, got '<' > > 2. When I clear my browser cache and reload the page, the > transformation breaks with a server error: > > Error while serializing XML: Ambiguous rule match for > /html/head[1]/script[1] Matches both "xhtml:script[not(@type) or @type > = 'text/javascript'] | script[not(@type) or @type = 'text/javascript']" > > Sorry for the trouble! > > Tim > > -- > Tim A. Thompson > Metadata Librarian (Spanish/Portuguese Specialty) > Princeton University Library > > > On Tue, Jul 7, 2015 at 3:23 PM, Alain Couthures > <ala...@ag... <mailto:ala...@ag...>> > wrote: > > Tim, > > I have now committed CDATA support: > > * script content is "escaped" with CDATA for "text/javascript" > and "text/turtle" > * @cdata-section-elements in submission is supported for all > major browsers > > Thank you for your feedback! > > --Alain > > > Le 06/07/2015 20:00, Tim Thompson a écrit : >> Alain, >> >> I think adding the proposed CDATA encapsulations to script >> elements would be a great solution. >> >> Regarding @cdata-section-elements, I do need this functionality, >> in some form, for the application I'm working on. But my first >> preference would be to output the CDATA sections on the server >> using XQuery. Unfortunately, eXist does not currently support >> cdata-section-elements as a serialization parameter either, so I >> was considering the @cdata-section-elements submission attribute >> as a temporary workaround. I do think this would be a good >> feature to have, but for now, just adding the CDATA >> encapsulations would make a big difference. >> >> Thanks again! >> Tim >> >> >> -- >> Tim A. Thompson >> Metadata Librarian (Spanish/Portuguese Specialty) >> Princeton University Library >> >> >> On Mon, Jul 6, 2015 at 1:08 PM, Alain Couthures >> <ala...@ag... >> <mailto:ala...@ag...>> wrote: >> >> Tim, >> >> XSLT does not preserve CDATA nodes but treats them into text >> nodes. It is still possible to treat script elements >> according to their type attributes. I can modified the XSLT >> stylesheet accordingly: for "text/javascript", the script >> value can be encapsulated with "/* <![CDATA[ */" and "/* ]]> >> */", and, for "text/turtle", with "# <![CDATA[" and "# ]]>". >> What do you think? >> >> For submission, adding support for @cdata-section-elements is >> not difficult for non-IE browsers because serialization is >> performed with Javascript instructions. For IE, because >> serialization is still based on an XSLT transformation, the >> stylesheet source would have to be adapted according to >> @cdata-section-elements value. Do you already need this? >> >> --Alain >> >> >> Le 05/07/2015 04:10, Tim Thompson a écrit : >>> Alain, >>> >>> I am trying to load a subform that contains a <script >>> type="text/turtle"> tag with RDF data serialized as Turtle. >>> >>> This data is enclosed in a CDATA section (per >>> http://www.w3.org/TR/turtle/#h3_xhtml). However, when I load >>> the subform (as XHTML), the CDATA is ignored and all <> >>> characters are escaped, which causes the Turtle parser I am >>> using to break. Shouldn't CDATA contents be ignored when a >>> subform is loaded? >>> >>> As a related question, does XSLTForms support the >>> @cdata-section-elements attribute on <xf:submission>? I see >>> some reference to it in the code, but wasn't sure whether it >>> had been fully implemented. This could be very useful for >>> dealing with non-XML formats in hybrid applications. >>> >>> Many thanks, >>> Tim >>> >>> -- >>> Tim A. Thompson >>> Metadata Librarian (Spanish/Portuguese Specialty) >>> Princeton University Library >>> >>> >>> ------------------------------------------------------------------------------ >>> Don't Limit Your Business. Reach for the Cloud. >>> GigeNET's Cloud Solutions provide you with the tools and support that >>> you need to offload your IT needs and focus on growing your business. >>> Configured For All Businesses. Start Your Cloud Today. >>> https://www.gigenetcloud.com/ >>> >>> >>> _______________________________________________ >>> Xsltforms-support mailing list >>> Xsl...@li... >>> <mailto:Xsl...@li...> >>> https://lists.sourceforge.net/lists/listinfo/xsltforms-support >> >> > > |
From: <wol...@ex...> - 2015-07-08 20:14:45
|
Hello Alain, > Is it correct that eXist now comes with its own XSLT engine? No, it uses saxon 9.4.0.7 for XSLT. Wolfgang |
From: Alain C. <ala...@ag...> - 2015-07-08 20:12:41
|
Hello Tim, Is it correct that eXist now comes with its own XSLT engine? Thanks! --Alain Le 08/07/2015 21:44, Tim Thompson a écrit : > Hello, > > In eXist 3.0.RC1, versions of XSLTForms greater than Rev. 594 (the one > that ships with eXist) do not seem to work. Versions beginning with > Rev. 595[1] cause a transformation error: "Error during XSLT > transformation: XSLT Stylesheet (possibly) contains a recursion." > XSLTForms up to Rev. 617 have been running successfully in eXist 2.2. > > Best, > Tim > > [1] > https://github.com/AlainCouthures/xsltforms/commit/97657f909fedb79981dca82d69d62068392ebeef > > -- > Tim A. Thompson > Metadata Librarian (Spanish/Portuguese Specialty) > Princeton University Library > > > > ------------------------------------------------------------------------------ > Don't Limit Your Business. Reach for the Cloud. > GigeNET's Cloud Solutions provide you with the tools and support that > you need to offload your IT needs and focus on growing your business. > Configured For All Businesses. Start Your Cloud Today. > https://www.gigenetcloud.com/ > > > _______________________________________________ > Xsltforms-support mailing list > Xsl...@li... > https://lists.sourceforge.net/lists/listinfo/xsltforms-support |
From: Tim T. <tim...@gm...> - 2015-07-08 19:44:53
|
Hello, In eXist 3.0.RC1, versions of XSLTForms greater than Rev. 594 (the one that ships with eXist) do not seem to work. Versions beginning with Rev. 595[1] cause a transformation error: "Error during XSLT transformation: XSLT Stylesheet (possibly) contains a recursion." XSLTForms up to Rev. 617 have been running successfully in eXist 2.2. Best, Tim [1] https://github.com/AlainCouthures/xsltforms/commit/97657f909fedb79981dca82d69d62068392ebeef -- Tim A. Thompson Metadata Librarian (Spanish/Portuguese Specialty) Princeton University Library |
From: Alain C. <ala...@ag...> - 2015-07-08 19:37:56
|
Tim, A "not well-formed" error might be due to an incorrect content-type for Firefox. Have you already checked this? --Alain Le 08/07/2015 05:43, Tim Thompson a écrit : > Just to update: the previous errors were produced in eXist 2.2. I have > also done some testing in BaseX 8.2.2, and I did not get these errors. > In BaseX, the CDATA sections seem to be properly generated (no > processing instructions appear in the output) and the application runs > in Chrome and Internet Explorer 11. It still does not run in Firefox, > however, which fails to load properly and throws a vague "not > well-formed" error. > > --Tim > > -- > Tim A. Thompson > Metadata Librarian (Spanish/Portuguese Specialty) > Princeton University Library > > > On Tue, Jul 7, 2015 at 8:46 PM, Tim Thompson <tim...@gm... > <mailto:tim...@gm...>> wrote: > > Alain, > > Thank you very much for these updates! > > However, I am running into a couple of errors. > > 1. In addition to the CDATA comments, > <?javax.xml.transform.enable-output-escaping?> processing > instructions are also being output inside the <script> tags, which > is causing a syntax error (in Firefox, Chrome, and IE). Firefox > throws the following error: > > SyntaxError: expected expression, got '<' > > 2. When I clear my browser cache and reload the page, the > transformation breaks with a server error: > > Error while serializing XML: Ambiguous rule match for > /html/head[1]/script[1] Matches both "xhtml:script[not(@type) or > @type = 'text/javascript'] | script[not(@type) or @type = > 'text/javascript']" > > Sorry for the trouble! > > Tim > > -- > Tim A. Thompson > Metadata Librarian (Spanish/Portuguese Specialty) > Princeton University Library > > > On Tue, Jul 7, 2015 at 3:23 PM, Alain Couthures > <ala...@ag... > <mailto:ala...@ag...>> wrote: > > Tim, > > I have now committed CDATA support: > > * script content is "escaped" with CDATA for > "text/javascript" and "text/turtle" > * @cdata-section-elements in submission is supported for all > major browsers > > Thank you for your feedback! > > --Alain > > > Le 06/07/2015 20:00, Tim Thompson a écrit : >> Alain, >> >> I think adding the proposed CDATA encapsulations to script >> elements would be a great solution. >> >> Regarding @cdata-section-elements, I do need this >> functionality, in some form, for the application I'm working >> on. But my first preference would be to output the CDATA >> sections on the server using XQuery. Unfortunately, eXist >> does not currently support cdata-section-elements as a >> serialization parameter either, so I was considering the >> @cdata-section-elements submission attribute as a temporary >> workaround. I do think this would be a good feature to have, >> but for now, just adding the CDATA encapsulations would make >> a big difference. >> >> Thanks again! >> Tim >> >> >> -- >> Tim A. Thompson >> Metadata Librarian (Spanish/Portuguese Specialty) >> Princeton University Library >> >> >> On Mon, Jul 6, 2015 at 1:08 PM, Alain Couthures >> <ala...@ag... >> <mailto:ala...@ag...>> wrote: >> >> Tim, >> >> XSLT does not preserve CDATA nodes but treats them into >> text nodes. It is still possible to treat script elements >> according to their type attributes. I can modified the >> XSLT stylesheet accordingly: for "text/javascript", the >> script value can be encapsulated with "/* <![CDATA[ */" >> and "/* ]]> */", and, for "text/turtle", with "# >> <![CDATA[" and "# ]]>". What do you think? >> >> For submission, adding support for >> @cdata-section-elements is not difficult for non-IE >> browsers because serialization is performed with >> Javascript instructions. For IE, because serialization is >> still based on an XSLT transformation, the stylesheet >> source would have to be adapted according to >> @cdata-section-elements value. Do you already need this? >> >> --Alain >> >> >> Le 05/07/2015 04:10, Tim Thompson a écrit : >>> Alain, >>> >>> I am trying to load a subform that contains a <script >>> type="text/turtle"> tag with RDF data serialized as Turtle. >>> >>> This data is enclosed in a CDATA section (per >>> http://www.w3.org/TR/turtle/#h3_xhtml). However, when I >>> load the subform (as XHTML), the CDATA is ignored and >>> all <> characters are escaped, which causes the Turtle >>> parser I am using to break. Shouldn't CDATA contents be >>> ignored when a subform is loaded? >>> >>> As a related question, does XSLTForms support the >>> @cdata-section-elements attribute on <xf:submission>? I >>> see some reference to it in the code, but wasn't sure >>> whether it had been fully implemented. This could be >>> very useful for dealing with non-XML formats in hybrid >>> applications. >>> >>> Many thanks, >>> Tim >>> >>> -- >>> Tim A. Thompson >>> Metadata Librarian (Spanish/Portuguese Specialty) >>> Princeton University Library >>> >>> >>> ------------------------------------------------------------------------------ >>> Don't Limit Your Business. Reach for the Cloud. >>> GigeNET's Cloud Solutions provide you with the tools and support that >>> you need to offload your IT needs and focus on growing your business. >>> Configured For All Businesses. Start Your Cloud Today. >>> https://www.gigenetcloud.com/ >>> >>> >>> _______________________________________________ >>> Xsltforms-support mailing list >>> Xsl...@li... >>> <mailto:Xsl...@li...> >>> https://lists.sourceforge.net/lists/listinfo/xsltforms-support >> >> > > > |
From: Artyom S. <art...@gm...> - 2015-07-08 03:56:59
|
Hello Tim, 2015-07-07 19:31 GMT+06:00 Tim Thompson <tim...@gm...>: > Hi, Artyom, > > This might be a good question for the XSLTForms e-mail support list > (copied here). > Thanks for pointing this out. > From what I can tell, since your subform target is in a separate > <xf:case>, it is not possible to load the subforms a second time without > toggling the case again. If I add <xforms:toggle case="form-sub"/> to the > #form-main triggers, it seems to work as expected: > > <xforms:trigger> > <xforms:label>Open subform 1</xforms:label> > <xforms:action ev:event="DOMActivate"> > <xforms:message>Opening subform 1</xforms:message> > <xforms:toggle case="form-sub"/> > <xforms:load show="embed" targetid="subform" > resource="showform3_subform1.xml"/> > </xforms:action> > </xforms:trigger> > > Indeed, this works great! Thank you very much. I'm attaching the modified sample for completeness. Subform 1 will never load due to a non-existent resource (which is fully reported to the user). > -- > Tim A. Thompson > Metadata Librarian (Spanish/Portuguese Specialty) > Princeton University Library > > > On Tue, Jul 7, 2015 at 2:32 AM, Artyom Shalkhakov < > not...@gi...> wrote: > >> Hello, >> >> I have a form sketch where subforms are embedded into the main form. >> However, there are complications: >> >> 1. if subform failed to be found, then the user should be notified >> about the error >> 2. user has to be able to dismiss the subform either by accepting or >> rejecting it >> >> Here's the main form (showform3_load.xml): >> >> <?xml-stylesheet href="/xsltforms/xsltforms.xsl" type="text/xsl"?> >> <html xmlns="http://www.w3.org/1999/xhtml" >> xmlns:xforms="http://www.w3.org/2002/xforms" >> xmlns:ev="http://www.w3.org/2001/xml-events"> >> <head> >> <title>Main Form</title> >> <xforms:model> >> <xforms:instance> >> <data xmlns=""/> >> </xforms:instance> >> <!-- FIXME: these actions are only run once (probably get removed on subform unload?) --> >> <xforms:action ev:event="xforms-link-exception" ev:observer="subform"> >> <xforms:message> >> Failed to obtain the subform at: <xforms:output value="event('resource-uri')"/>, >> error code: <xforms:output value="event('response-status-code')"/>, >> error reason: <xforms:output value="event('response-reason-phrase')"/> >> </xforms:message> >> </xforms:action> >> <xforms:action ev:event="xforms-load-done" ev:observer="subform"> >> <xforms:message>Load Success!</xforms:message> >> <xforms:toggle case="form-sub"/> >> </xforms:action> >> </xforms:model> >> </head> >> <body> >> <xforms:switch id="form-switch"> >> <!-- this is the "main" form --> >> <xforms:case id="form-main"> >> <h2>Main form</h2> >> <xforms:trigger> >> <xforms:label>Open subform 1</xforms:label> >> <xforms:action ev:event="DOMActivate"> >> <xforms:message>Opening subform 1</xforms:message> >> <xforms:load show="embed" targetid="subform" resource="showform3_subform1.xml"/> >> </xforms:action> >> </xforms:trigger> >> <xforms:trigger> >> <xforms:label>Open subform 2</xforms:label> >> <xforms:action ev:event="DOMActivate"> >> <xforms:message>Opening subform 2</xforms:message> >> <xforms:load show="embed" targetid="subform" resource="showform3_subform2.xml"/> >> </xforms:action> >> </xforms:trigger> >> </xforms:case> >> <!-- this is the portion of the form that we will be using for subforms (e.g. Edit subform) --> >> <xforms:case id="form-sub"> >> <xforms:trigger> >> <xforms:label>Accept Subform</xforms:label> >> <xforms:action ev:event="DOMActivate"> >> <xforms:message>Accepting Subform</xforms:message> >> <xforms:unload targetid="subform"/> >> <xforms:toggle case="form-main"/> >> </xforms:action> >> </xforms:trigger> >> <!-- this actually does what we want, but the subform *by itself* >> is invalid (there is no such targetid in the subform! >> --> >> <xforms:trigger> >> <xforms:label>Reject Subform</xforms:label> >> <xforms:action ev:event="DOMActivate"> >> <xforms:message>Rejecting Subform</xforms:message> >> <xforms:unload targetid="subform"/> >> <xforms:toggle case="form-main"/> >> </xforms:action> >> </xforms:trigger> >> <xforms:group id="subform"/> >> </xforms:case> >> </xforms:switch> >> </body> >> </html> >> >> Here is subform 1 (showform3_subform1.xml): >> >> <?xml-stylesheet href="/xsltforms/xsltforms.xsl" type="text/xsl"?> >> <html xmlns="http://www.w3.org/1999/xhtml" >> xmlns:xforms="http://www.w3.org/2002/xforms" >> xmlns:ev="http://www.w3.org/2001/xml-events"> >> <head> >> <title>Subform 1</title> >> <xforms:model> >> <xforms:instance> >> <data xmlns=""/> >> </xforms:instance> >> </xforms:model> >> </head> >> <body> >> <h2>Subform 1</h2> >> <p>hello world!</p> >> </body> >> </html> >> >> And finally, here is subform 3 (showform3_subform2.xml): >> >> <?xml-stylesheet href="/xsltforms/xsltforms.xsl" type="text/xsl"?> >> <html xmlns="http://www.w3.org/1999/xhtml" >> xmlns:xforms="http://www.w3.org/2002/xforms" >> xmlns:ev="http://www.w3.org/2001/xml-events"> >> <head> >> <title>Subform 2</title> >> <xforms:model> >> <xforms:instance> >> <data xmlns=""/> >> </xforms:instance> >> </xforms:model> >> </head> >> <body> >> <h2>Subform 2</h2> >> <p>goodbye world!</p> >> </body> >> </html> >> >> To reproduce: >> >> 1. Open the main form >> 2. Click on "Open subform 1" >> 3. Subform 1 will be opened >> 4. Click on "Accept Subform" >> 5. You will be brought back to the main form >> 6. Click on either "Open subform 1" or "Open subform 2", and there is >> no change >> >> Please help me figure this one out. >> >> — >> Reply to this email directly or view it on GitHub >> <https://github.com/AlainCouthures/xsltforms/issues/8>. >> > > -- Cheers, Artyom Shalkhakov |