RE: Schematron 1.6 new features
"Daniel Cazzulino" <[email protected]> Tue, 24 Feb 2004 15:00:13 -0300
| Newsgroups | gmane.text.xml.schematron |
|---|---|
| Organization | Lagash Systems SA |
| Message-ID | <[email protected]> |
Comments on the new features: Abstract patterns: I don't find some parts of the new syntax easy to learn/use/validate. Reasons: I prefer "inherits" instead of is-a. The same should happen for the abstract rules. Instead of a (more verbose) <extends rule="name"/> element, simply using "inherits='name'" would do. It's easy to understand that a rule can't inherit from a pattern and viceversa. Use: The only way to know what formal params are expected by the base abstract pattern is by looking at every single assertion/report and check for variable references. If the abstract pattern is complex enough, there may be many errors until the concrete pattern implementer discovers what is wrong. Validate: related to the previous one, the only way to validate that parameters specified are actually expected by the abstract patters, as well as that they are ALL present, is again to parse each test inside every rule in the abstract pattern. Not good IMO. I sort of prefer sch:base instead of sch:param, as it's not actually a param for the current pattern but for the base one. This way we make explicit de different in scope with regards to the variables (BTW, I assume these are available to the base abstract patter?) Finally, can an abstract pattern inherit (is-a) another abstract pattern? Allowing chains of inheritance is cool... Let variables: I experimented with variables in my Schematron.NET implementation. I found that having cascading scopes is really cool and makes programming the schema much easier. I believe there are XSLT limitations that would make this impossible to implement with it. I added variable scopes at every schematron element level: schema, phase, pattern and rule. Depending on the location, the query setting the value may be relative (to the context of a rule) or absolute (all the others). Values can be fixed strings, of course. This was cool as different phases could set some variable that would alter a relative value against which a test is verified, for example the maximum allowed amount for an order (phases "Employee", "Accountant" and "Manager" for example may have different increasing alowed values). Retrieving a variable at any level causes a walk upwards the parent scopes (assert->rule->pattern->phase->schema) looking for its value. Schematron as a Framework: I'd add XPATHEXSLT to the list of value for @use. I will be adding EXSLT.NET support to my XPath-based implementation, so some combination of both names should be used to specify I support both. In fact, now that I think about it, I believe the attribute should be a list, so that I can use for my implementation the value @use="EXSLT XPATH". Also, I believe there will be implementations of XPath2 that will be backwards compatible with XPath1, although that may not always be the case. So in that case you could have @use="XPATH2" or @use="XPATH XPATH2 EXSLT XQUERY", for example. Inclusions: I'd prefer to have XInclude supported directly. That way, I can include specific parts of other (maybe composite/embedded) schemas at specific locations in Schematron. I agree that with robust inclusions, and abstract patterns, there's not much use for abstract rules anymore. Schematron Results: A welcome addition. Being able to test for conformance against a standard output is a nice plus. Top-level parameters: Will there be an sch:param element to define them? I'd certainly like to see them, if they are to be supported. That's another reason to choose a different name for "parameters" to abstract patterns... I like sch:base even more now :) The reasoning for calling it sch:base is that it's like passing a parameter to the base pattern "constructor", like in C#. It could be sch:super of course ;) Schematron defined over all information items: This is cool. I think it may be a little harder to implement, but having abstract patterns over attributes too sounds really good. Making this dependant on the query language is appropriate also. Thoughts? Daniel Cazzulino [MVP XML] Cirius SA http://weblogs.asp.net/cazzu http://aspnet2.com -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Edvard Robertsson Sent: Tuesday, February 24, 2004 1:33 PM To: [email protected]; [email protected] Subject: RE: [Schematron-love-in] Schematron 1.6 new features Hi Daniel, >Hi guys, >I'd like to know if there's any article pointing out the new features >of 1.6, as well as any changes that may have happened since 1.5. That >would help me evolve Schematron.NET. Digging through the new XSLT >stylsheet isn't too helpful, although I can figure that out... a more >normative description would be WAY better. I recently posted an article on XML.com about Schematron including a short section on the new features in ISO Schematron. I think most of these are included in Schematron 1.6 as well. See http://www.xml.com/pub/a/2003/11/12/schematron.html?page=2#ISO_Schematron For more information you can check out the Schematron upgrade page at http://www.topologi.com/resources/schematronUpgrades.html Cheers, /Eddie > >Thanks! > >/kzu _________________________________________________________________ Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click _______________________________________________ Schematron-love-in mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/schematron-love-in ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click