Comments (7)
There's another reason we might want to do something about this: XSLT uses <xsl:param>
elements to define a parameter in the location where they're used and an <xsl:with-param>
to give it a value. But Schematron uses <param>
elements to give parameters a value. Since XSLT and Schematron are often used side-by-side, that's confusing...
I know this would seriously break compatibility with previous versions.
from schematron-enhancement-proposals.
from schematron-enhancement-proposals.
I'll most likely implement this using processing instructions in SchXslt2. It seems useful to error on both sides: Parameters that are declared but not provided, and parameters that are provided but not declared.
from schematron-enhancement-proposals.
I think adding optional-repeatable element param
to abstract patterns is a simple enough solution here. I don't think the syntax is that much of an issue - it's unambiguous from the context to a machine and human beings are adept at using the same word in different contexts to express different meanings - plus XSLT is an important query language binding, but only one of them.
However, param
as currently defined has mandatory name
and value
attributes. You may not wish to specify a value for an abstract parameter, and if you do (as you must now), is that value the default? What happens if the concrete pattern also specifies a value for that parameter (it must, as things stand)?
In which case, it seems there are three options:
- add
param
as currently defined: this would compel you to include avalue
for abstract parameters in a valid schema - make
value
optional and allow it to be absent for an abstract pattern parameter but required for a concrete one - redefine
param
when used in an abstract pattern as having only the name attribute.
(2) offers most flexibility, enabling default values.
from schematron-enhancement-proposals.
from schematron-enhancement-proposals.
When I implemented the processing instruction I decided against the possibility of default values for backwards compatibility. If this is no convern, then I opt for (2).
from schematron-enhancement-proposals.
FWIW it's mine too, @dmj .
On the subject of compatibility:
- an existing implementation would presumably not know what to do with the proposed abstract
param
- it equally would not know how to handle the absence of a
param
value - existing schemas should function just as before, though they would be invalid if the constraint on every concrete parameter requiring an abstract equivalent were added to the Schematron schema schema [Annex B]
- such invalidity as there is should disappear once the "expansion" processing step is complete, and all abstract patterns have been instantiated. At that stage, schemas using this proposed new mechanism should be backward-compatible on this score.
Correct me if I'm wrong!
from schematron-enhancement-proposals.
Related Issues (20)
- sch:visit element
- Specify the query language binding in use when embedding Schematron (@sch:queryBinding) HOT 2
- 03.24 subject [ref. JP16 017] HOT 2
- 05.03 Whitespace [ref. JP19 021] HOT 3
- 05.05.14 subject attribute [ref. JP31 032] HOT 2
- 06. Semantics [ref. JP32 034] HOT 2
- Update XSLT 1.0 URL HOT 1
- Add attribute named e.g. 'severity' to schematron with well defined semantics for reporting severity levels HOT 8
- pattern/@documents: rules apply only to subordinate documents? HOT 3
- pattern/@documents: pattern variables in scope? HOT 6
- pattern/@documents: definition of behaviour HOT 1
- Defining namespaces HOT 5
- pattern/@document should allow variable that is a document HOT 1
- Ability for role value to be dynamic or different per phase HOT 9
- ISO Schematron iso-schematron.rng license issue HOT 9
- Define the process of importing (include,extending, etc.) definitions from an external ISO Schematron schema HOT 3
- Overrides on sch:include[@href] & sch:extends[@href]
- Clarify ordering of certain elements HOT 1
- SVRL element for compilation and runtime errors HOT 6
- Clarify support for XPath 4.0 or XSLT/XQuery 4.0 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from schematron-enhancement-proposals.