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

Support alternative method of declaring namespaces #15

Open
AndrewSales opened this issue Jun 1, 2023 · 5 comments
Open

Support alternative method of declaring namespaces #15

AndrewSales opened this issue Jun 1, 2023 · 5 comments

Comments

@AndrewSales
Copy link
Owner

AndrewSales commented Jun 1, 2023

as suggested by @dmj in his presentation about ATOP at the 2023 SUM. This technique embeds SCH constraints and the existing ns method of declaring namespaces is cumbersome.

@sydb
Copy link

sydb commented Jun 6, 2023

I am not 100% sure, but my instinct is that I am in favor. I presume the idea is that whenever you (the Schematron processor) need to resolve a namespace prefix (typically from a @context, a @select, or a @test) you examine all the ../namespace::* or all the ../namespace-node(), eh?

Sounds like a lot simpler way of doing things. In the worst case, of course, it is probably very expensive to go around looking up all the namespace nodes all the time. But I am betting that for the vast majority of Schematron schemas some serious optimizations could be performed, no?

@AndrewSales
Copy link
Owner Author

Thanks, Syd - glad to have you along.

I honestly haven't thought much about the how yet, having just noted this in the moment at the meetup. But what you describe sounds plausible.

@dmj did you already have some ideas around this? If we can put our heads together to find a viable route, it will probably merit an entry over at https://github.com/Schematron/schematron-enhancement-proposals/issues.

@dmj
Copy link

dmj commented Jun 7, 2023

I though about two possibilities:

a. Keep sch:ns and allow it as child of sch:pattern, sch:assert, sch:report, sch:diagnostics, schand sch:rule and so on. A sch:ns as child of a, say, sch:pattern defines the namespace bindings for all contained rules.

b. Deprecate sch:ns and use the standardized namespace declaration mechanism. A query language expression would have access to all namespace bindings declared on the containing element or one of its parents.

@AndrewSales
Copy link
Owner Author

Thank you. (b) is appealing -- ns is easy to process, but it's never felt very XML-y.

@AndrewSales
Copy link
Owner Author

As you can see, raised as Schematron/schematron-enhancement-proposals#62.
Please do chip in if I misrepresent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants