Thread: Re: [Xsltforms-support] Question Re Implementing Custom Types
Brought to you by:
alain-couthures
From: <ajb...@aj...> - 2023-10-16 18:50:07
|
Alain – FANTASTIC, thank you! I will test and get back to you ASAP. 😊 -Tony Bufort www.ajbconsulting.us <http://www.ajbconsulting.us/> Anthony J. (Tony) Bufort Owner / Sr. Developer EMAIL: ajb...@aj... <email:ajb...@aj...> PHONE: (425) 221-4447 SKYPE: ajbufort LINKEDIN: www.linkedin.com/in/anthonybufort <http://www.linkedin.com/in/anthonybufort> A fully licensed, fully insured Washington state entity. From: Alain Couthures <ala...@ag...> Sent: Sunday, October 15, 2023 1:10 AM To: ajb...@aj...; Steven Pemberton <ste...@cw...>; xsl...@li... Subject: Re: [Xsltforms-support] Question Re Implementing Custom Types Hello Tony, I have fixed some issues for supporting OSCAL schema. Please give a try to the xsltforms.js file attached. Thank you for your feedback! --Alain Steve, Alain, et al, Thanks for the quick replies. 😊 Alright, so I am using the OSCAL complete schema, v 1.1.0, along with an SSP instance (see attached). Though the instance is an SSP, I have started testing using the complete schema, as I am testing other aspects of my code in the process. In the resultant HTML, I get output like this: …so things are getting found and displayed, but I am not getting any validation or date-picker goodness. In my previous bind I sent you, I slimmed it down for purposes of brevity. Here is the actual bind… <xf:bind id="/system-security-plan/metadata/published" ref="/o:system-security-plan/o:metadata/o:published" type="oscal-metadata-published-FIELD"/> My expectation is that XSLTForms would find the type and its restriction base, follow that to the underlying type (DateTimeWithTimezoneDatatype), then follow its underlying type (DateTimeDatatype) to <xs:restriction base="xs:dateTime">, acknowledging the native type and allowing for both a rendering of a date-picker in the browser (Opera latest version in my case) and validation benefits within the resultant XForm. Thank you for considering my problem. -Tony <http://www.ajbconsulting.us/> www.ajbconsulting.us Anthony J. (Tony) Bufort Owner / Sr. Developer EMAIL: ajb...@aj... <mailto:ajb...@aj...> PHONE: (425) 221-4447 SKYPE: ajbufort LINKEDIN: <http://www.linkedin.com/in/anthonybufort> www.linkedin.com/in/anthonybufort A fully licensed, fully insured Washington state entity. From: Steven Pemberton <ste...@cw... <mailto:ste...@cw...> > Sent: Friday, October 6, 2023 1:11 AM To: ajb...@aj... <mailto:ajb...@aj...> ; xsl...@li... <mailto:xsl...@li...> Subject: Re: [Xsltforms-support] Question Re Implementing Custom Types Could you show us the instance you are referencing? Steven On Friday 06 October 2023 06:45:05 (+02:00), ajb...@aj... <mailto:ajb...@aj...> wrote: Hello Alain and Company, I am a new user of XSLTForms, exploring the framework, and am quite impressed, especially considering it’s a free product. However, I would like confirmation that what I am seeing is indeed the case, or if I am missing something, regarding handling custom types. In my model definition I reference a schema file, expecting to link up the types defined therein to my bind statements. The types I am trying to use are simpleTypes. Here is an example: <xs:simpleType name="DateTimeWithTimezoneDatatype"> <xs:annotation> <xs:documentation>A string representing a point in time with a required timezone.</xs:documentation> </xs:annotation> <xs:restriction base="DateTimeDatatype"> <xs:pattern value="(((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30)))T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(\.[0-9]+)?(Z|(-((0[0-9]|1[0-2]):00|0[39]:30)|\+((0[0-9]|1[0-4]):00|(0[34569]|10):30|(0[58]|12):45)))"/> </xs:restriction> </xs:simpleType> And the bind trying to use it (the ‘o:’ namespace used in @ref is indeed confirmed correct): <xf:bind id="/published" ref="/o:published" type=" DateTimeWithTimezoneDatatype"/> And finally, the input field: <xf:input bind="/published" incremental="true" type-ref=" DateTimeWithTimezoneDatatype"> <xf:label> <b>Published:</b> </xf:label> </xf:input> I get no ostensible complaints from the xf processor, but no validation behavior either (i.e. entering invalid values provokes no response). (Note that the slashes in the @id and @bind attributes seem to be permissible if non-standard.) Can the XSLTForms processor handle the schema type as defined above? It seems to acknowledge the type, but not operate using it. Or are users expected to create type-handling additions in xsltforms.js? I am unclear as to the situation in XSLTForms 1.7, which is the version I am using. Please advise, and thank you in advance! -Tony Bufort, AJB Consulting <http://www.ajbconsulting.us/> www.ajbconsulting.us Anthony J. (Tony) Bufort Owner / Sr. Developer EMAIL: ajb...@aj... <mailto:ajb...@aj...> PHONE: (425) 221-4447 SKYPE: ajbufort LINKEDIN: <http://www.linkedin.com/in/anthonybufort> www.linkedin.com/in/anthonybufort A fully licensed, fully insured Washington state entity. _______________________________________________ Xsltforms-support mailing list Xsl...@li... <mailto:Xsl...@li...> https://lists.sourceforge.net/lists/listinfo/xsltforms-support |
From: <ajb...@aj...> - 2023-10-16 20:27:43
|
Hi Alain, Your new code is now tested and confirmed working on my end. Thank you for this speedy attention and resolution! OSCAL and XForms have a bright future together. 😊 Attending Declarative Amsterdam, hope to see you there. -Tony Bufort www.ajbconsulting.us <http://www.ajbconsulting.us/> Anthony J. (Tony) Bufort Owner / Sr. Developer EMAIL: ajb...@aj... <email:ajb...@aj...> PHONE: (425) 221-4447 SKYPE: ajbufort LINKEDIN: www.linkedin.com/in/anthonybufort <http://www.linkedin.com/in/anthonybufort> A fully licensed, fully insured Washington state entity. From: ajb...@aj... <ajb...@aj...> Sent: Monday, October 16, 2023 11:41 AM To: 'Alain Couthures' <ala...@ag...>; 'Steven Pemberton' <ste...@cw...>; 'xsl...@li...' <xsl...@li...> Subject: RE: [Xsltforms-support] Question Re Implementing Custom Types Alain – FANTASTIC, thank you! I will test and get back to you ASAP. 😊 -Tony Bufort www.ajbconsulting.us <http://www.ajbconsulting.us/> Anthony J. (Tony) Bufort Owner / Sr. Developer EMAIL: ajb...@aj... <email:ajb...@aj...> PHONE: (425) 221-4447 SKYPE: ajbufort LINKEDIN: www.linkedin.com/in/anthonybufort <http://www.linkedin.com/in/anthonybufort> A fully licensed, fully insured Washington state entity. From: Alain Couthures <ala...@ag... <mailto:ala...@ag...> > Sent: Sunday, October 15, 2023 1:10 AM To: ajb...@aj... <mailto:ajb...@aj...> ; Steven Pemberton <ste...@cw... <mailto:ste...@cw...> >; xsl...@li... <mailto:xsl...@li...> Subject: Re: [Xsltforms-support] Question Re Implementing Custom Types Hello Tony, I have fixed some issues for supporting OSCAL schema. Please give a try to the xsltforms.js file attached. Thank you for your feedback! --Alain Steve, Alain, et al, Thanks for the quick replies. 😊 Alright, so I am using the OSCAL complete schema, v 1.1.0, along with an SSP instance (see attached). Though the instance is an SSP, I have started testing using the complete schema, as I am testing other aspects of my code in the process. In the resultant HTML, I get output like this: …so things are getting found and displayed, but I am not getting any validation or date-picker goodness. In my previous bind I sent you, I slimmed it down for purposes of brevity. Here is the actual bind… <xf:bind id="/system-security-plan/metadata/published" ref="/o:system-security-plan/o:metadata/o:published" type="oscal-metadata-published-FIELD"/> My expectation is that XSLTForms would find the type and its restriction base, follow that to the underlying type (DateTimeWithTimezoneDatatype), then follow its underlying type (DateTimeDatatype) to <xs:restriction base="xs:dateTime">, acknowledging the native type and allowing for both a rendering of a date-picker in the browser (Opera latest version in my case) and validation benefits within the resultant XForm. Thank you for considering my problem. -Tony <http://www.ajbconsulting.us/> www.ajbconsulting.us Anthony J. (Tony) Bufort Owner / Sr. Developer EMAIL: ajb...@aj... <mailto:ajb...@aj...> PHONE: (425) 221-4447 SKYPE: ajbufort LINKEDIN: <http://www.linkedin.com/in/anthonybufort> www.linkedin.com/in/anthonybufort A fully licensed, fully insured Washington state entity. From: Steven Pemberton <ste...@cw... <mailto:ste...@cw...> > Sent: Friday, October 6, 2023 1:11 AM To: ajb...@aj... <mailto:ajb...@aj...> ; xsl...@li... <mailto:xsl...@li...> Subject: Re: [Xsltforms-support] Question Re Implementing Custom Types Could you show us the instance you are referencing? Steven On Friday 06 October 2023 06:45:05 (+02:00), ajb...@aj... <mailto:ajb...@aj...> wrote: Hello Alain and Company, I am a new user of XSLTForms, exploring the framework, and am quite impressed, especially considering it’s a free product. However, I would like confirmation that what I am seeing is indeed the case, or if I am missing something, regarding handling custom types. In my model definition I reference a schema file, expecting to link up the types defined therein to my bind statements. The types I am trying to use are simpleTypes. Here is an example: <xs:simpleType name="DateTimeWithTimezoneDatatype"> <xs:annotation> <xs:documentation>A string representing a point in time with a required timezone.</xs:documentation> </xs:annotation> <xs:restriction base="DateTimeDatatype"> <xs:pattern value="(((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30)))T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(\.[0-9]+)?(Z|(-((0[0-9]|1[0-2]):00|0[39]:30)|\+((0[0-9]|1[0-4]):00|(0[34569]|10):30|(0[58]|12):45)))"/> </xs:restriction> </xs:simpleType> And the bind trying to use it (the ‘o:’ namespace used in @ref is indeed confirmed correct): <xf:bind id="/published" ref="/o:published" type=" DateTimeWithTimezoneDatatype"/> And finally, the input field: <xf:input bind="/published" incremental="true" type-ref=" DateTimeWithTimezoneDatatype"> <xf:label> <b>Published:</b> </xf:label> </xf:input> I get no ostensible complaints from the xf processor, but no validation behavior either (i.e. entering invalid values provokes no response). (Note that the slashes in the @id and @bind attributes seem to be permissible if non-standard.) Can the XSLTForms processor handle the schema type as defined above? It seems to acknowledge the type, but not operate using it. Or are users expected to create type-handling additions in xsltforms.js? I am unclear as to the situation in XSLTForms 1.7, which is the version I am using. Please advise, and thank you in advance! -Tony Bufort, AJB Consulting <http://www.ajbconsulting.us/> www.ajbconsulting.us Anthony J. (Tony) Bufort Owner / Sr. Developer EMAIL: ajb...@aj... <mailto:ajb...@aj...> PHONE: (425) 221-4447 SKYPE: ajbufort LINKEDIN: <http://www.linkedin.com/in/anthonybufort> www.linkedin.com/in/anthonybufort A fully licensed, fully insured Washington state entity. _______________________________________________ Xsltforms-support mailing list Xsl...@li... <mailto:Xsl...@li...> https://lists.sourceforge.net/lists/listinfo/xsltforms-support |
From: <ajb...@aj...> - 2023-10-16 20:34:01
|
Hello Alain, How does XSLTForms handle schematron within schemata, whether it is inline or referenced as an external file? As far as I can tell, I would have to parse all schematron separately and then try to fit the reflected business rules within @constraint attributes. If schematron is not handled out-of-the-box by XSLTForms, can you point me to any already-established alternatives that will work with your framework? Thanks Again, -Tony Bufort www.ajbconsulting.us <http://www.ajbconsulting.us/> Anthony J. (Tony) Bufort Owner / Sr. Developer EMAIL: ajb...@aj... <email:ajb...@aj...> PHONE: (425) 221-4447 SKYPE: ajbufort LINKEDIN: www.linkedin.com/in/anthonybufort <http://www.linkedin.com/in/anthonybufort> A fully licensed, fully insured Washington state entity. |
From: Alain C. <ala...@ag...> - 2023-10-17 18:41:36
|
<!doctype html> <html> <head> <meta charset="UTF-8"> </head> <body> <div> Hello Tony, </div> <div class="default-style"> </div> <div class="default-style"> It might be possible to add support of Schematron in XSLTForms, transposing rules into constraints with Javascript and DOM. </div> <div class="default-style"> </div> <div class="default-style"> XPath 3.1 support in XSLTForms will not be available before 2.0. Is XPath 1.0 a problem? </div> <div class="default-style"> </div> <div class="default-style"> Do you have some examples for me to evaluate this more precisely? </div> <div class="default-style"> </div> <div class="default-style"> Thank you in advance </div> <div class="default-style"> </div> <div class="default-style"> --Alain </div> <blockquote type="cite"> <div> Le 16/10/2023 22:33 CEST, ajb...@aj... a écrit : </div> <div> </div> <div> </div> <div class="WordSection1"> <p class="MsoNormal">Hello Alain,</p> <p class="MsoNormal"> </p> <p class="MsoNormal">How does XSLTForms handle schematron within schemata, whether it is inline or referenced as an external file?</p> <p class="MsoNormal"> </p> <p class="MsoNormal">As far as I can tell, I would have to parse all schematron separately and then try to fit the reflected business rules within @constraint attributes.</p> <p class="MsoNormal"> </p> <p class="MsoNormal">If schematron is not handled out-of-the-box by XSLTForms, can you point me to any already-established alternatives that will work with your framework?</p> <p class="MsoNormal"> </p> <p class="MsoNormal">Thanks Again,</p> <p class="MsoNormal"> </p> <p class="MsoNormal">-Tony Bufort</p> <p class="MsoNormal"> </p> <div> <p class="MsoNormal"> </p> <table class="MsoNormalTable" border="0" cellpadding="0"> <tbody> <tr> <td style="border: solid red 1.0pt; border-left: none; padding: .75pt 5.25pt .75pt .75pt;"> <p class="MsoNormal"><span style="font-family: 'Arial',sans-serif;"><img id="Picture_x0020_26" style="width: 1.6354in; height: .875in;" src="cid:image001.png@01DA0035.5D95DC60" alt="ttp://www.ajbconsulting.us/images/outlook/AJB_Consulting_new_logo_OUTLOOK_SIGNATURE.png" width="157" height="84"></span></p> <p class="MsoNormal"><span style="font-family: Courier;"><a href="http://www.ajbconsulting.us/">www.ajbconsulting.us</a></span></p> </td> <td style="border: solid red 1.0pt; border-right: none; padding: .75pt .75pt .75pt 3.75pt;"> <p class="MsoNormal"><span style="font-size: 12.0pt; font-family: 'Arial',sans-serif;"> <strong>Anthony J. (Tony) Bufort</strong><br> </span><em><span style="font-family: 'Arial',sans-serif;">Owner / Sr. Developer</span></em></p> <table class="MsoNormalTable" border="0" cellpadding="0"> <tbody> <tr> <td style="padding: .75pt .75pt .75pt .75pt;"> <p class="MsoNormal"><span style="font-size: 9.0pt;"><img id="Picture_x0020_27" style="width: .1666in; height: .1666in;" src="cid:image002.png@01DA0035.5D95DC60" alt="ttp://www.ajbconsulting.us/images/outlook/icons/email.png" width="16" height="16" border="0"></span></p> </td> <td style="padding: .75pt .75pt .75pt .75pt;"> <p class="MsoNormal"><strong><span style="font-size: 9.0pt;">EMAIL:</span></strong><span style="font-size: 9.0pt;"> <a>ajb...@aj...</a></span></p> </td> </tr> <tr> <td style="padding: .75pt .75pt .75pt .75pt;"> <p class="MsoNormal"><span style="font-size: 9.0pt;"><img id="Picture_x0020_28" style="width: .1666in; height: .1666in;" src="cid:image003.png@01DA0035.5D95DC60" alt="ttp://www.ajbconsulting.us/images/outlook/icons/phone.png" width="16" height="16" border="0"></span></p> </td> <td style="padding: .75pt .75pt .75pt .75pt;"> <p class="MsoNormal"><strong><span style="font-size: 9.0pt;">PHONE:</span></strong><span style="font-size: 9.0pt;"> (425) 221-4447</span></p> </td> </tr> <tr> <td style="padding: .75pt .75pt .75pt .75pt;"> <p class="MsoNormal"><span style="font-size: 9.0pt;"><img id="Picture_x0020_29" style="width: .1666in; height: .1666in;" src="cid:image004.png@01DA0035.5D95DC60" alt="ttp://www.ajbconsulting.us/images/outlook/icons/skype.png" width="16" height="16" border="0"></span></p> </td> <td style="padding: .75pt .75pt .75pt .75pt;"> <p class="MsoNormal"><strong><span style="font-size: 9.0pt;">SKYPE:</span></strong><span style="font-size: 9.0pt;"> ajbufort</span></p> </td> </tr> <tr> <td style="padding: .75pt .75pt .75pt .75pt;"> <p class="MsoNormal"><span style="font-size: 9.0pt;"><img id="Picture_x0020_30" style="width: .1666in; height: .1666in;" src="cid:image005.png@01DA0035.5D95DC60" alt="ttp://www.ajbconsulting.us/images/outlook/icons/linkedin.png" width="16" height="16" border="0"></span></p> </td> <td style="padding: .75pt .75pt .75pt .75pt;"> <p class="MsoNormal"><strong><span style="font-size: 9.0pt;">LINKEDIN:</span></strong><span style="font-size: 9.0pt;"> <a href="http://www.linkedin.com/in/anthonybufort">www.linkedin.com/in/anthonybufort</a></span></p> </td> </tr> </tbody> </table> </td> </tr> </tbody> </table> <p class="MsoNormal"><span style="display: none;"> </span></p> <table class="MsoNormalTable" style="border: none; border-bottom: solid red 1.0pt;" border="1" cellpadding="0"> <tbody> <tr> <td style="border: none; padding: 3.0pt .75pt .75pt .75pt;"> <p class="MsoNormal"><span style="font-size: 9.0pt; font-family: 'Arial',sans-serif;"> <img id="Picture_x0020_31" style="width: .3958in; height: .2604in;" src="cid:image006.jpg@01DA0035.5D95DC60" alt="ttp://www.ajbconsulting.us/images/outlook/wa_state_seal_sm.jpg" width="38" height="25" border="0"></span></p> </td> <td style="border: none; padding: 3.0pt .75pt .75pt .75pt;"> <p class="MsoNormal"><span style="font-size: 9.0pt; font-family: 'Arial',sans-serif;"> A <strong><em>fully licensed, fully insured</em></strong> Washington state entity. </span></p> </td> </tr> </tbody> </table> </div> <div> <p class="MsoNormal"> </p> </div> </div> </blockquote> </body> </html> |