Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sch:pattern/@document needs better specification of error handling #47

Open
rjelliffe opened this issue Aug 5, 2022 · 0 comments
Open
Labels
2025 A change made in preparing the 2025 edition element pattern Issues relating to element pattern

Comments

@rjelliffe
Copy link
Member

rjelliffe commented Aug 5, 2022

Background

The intent of sch:pattern/@document is that it allows a pattern to validate an XML resource retrieved by constructing a URL with information from the primary document.

So this allows a hub or TOC document with links to other documents. Such in a ZIP archive. XML is a web technology, therefore it is good to support at least a minimal support for documents in a web.

For Schematron 2016, there was only one level of indirection allowed*; consequently there can be no problem with transitive closure issues such as loops and self-referencing documents.

Problem

If no XML resource can be retrieved from a URL in sch:pattern/@document what is the result of validation?

Proposed Solution

Schematron description enhanced: If a resource cannot be retrieved for a URL in sch:pattern/@document then it is implementation-defined whether validation of other patterns continues.

SVRL elements augmented to allow elements that flag that there was an error retrieving (or parsing/converting) an external resource.

<svrl:active-pattern ...>
    <svrl:resource-error document=" ...">

    </svrl:resource>
    <svrl:conversion-error>
    </svrl:conversion-error>
</svrl:active-pattern>

Where the contents of svrl:resource-error are an implementation-defined message useful for the human in the context. It could, for example, be the MIME header for the error response. (Even some simple message like "Unable to retrieve external document XXXX.XXXX" would be better than nothing.)

The svrl:conversion-error element is the subject of a separate enhancement proposal. See #48 for details.

  • In theory, we could validate a fixed chain length of documents, reading one document into a top-level variable, then using that to for the URL for another document in another variable, and so on. Then using information in the variables to construct the URLs for sch:pattern/@documents. But with XPath 3 we get Xpath functions (I think), allowing an unbounded traversal of links.
@AndrewSales AndrewSales added the element pattern Issues relating to element pattern label Jun 19, 2023
@AndrewSales AndrewSales added the 2025 A change made in preparing the 2025 edition label Feb 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2025 A change made in preparing the 2025 edition element pattern Issues relating to element pattern
Projects
None yet
Development

No branches or pull requests

2 participants