Code Monkey home page Code Monkey logo

Comments (7)

xatapult avatar xatapult commented on July 17, 2024

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.

rjelliffe avatar rjelliffe commented on July 17, 2024

from schematron-enhancement-proposals.

dmj avatar dmj commented on July 17, 2024

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.

AndrewSales avatar AndrewSales commented on July 17, 2024

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:

  1. add param as currently defined: this would compel you to include a value for abstract parameters in a valid schema
  2. make value optional and allow it to be absent for an abstract pattern parameter but required for a concrete one
  3. 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.

rjelliffe avatar rjelliffe commented on July 17, 2024

from schematron-enhancement-proposals.

dmj avatar dmj commented on July 17, 2024

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.

AndrewSales avatar AndrewSales commented on July 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.