-
Notifications
You must be signed in to change notification settings - Fork 22
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
Key / Keyref instead of ID / IDRef for limiting scope using Xpaths #159
Comments
@corymosiman12 Is this referring to https://www.w3.org/TR/xmlschema-1/#declare-key? |
Notes from email on 10/29: Looking into how to constrain scope for IDREFs to appropriate elements. I don’t think it’s possible…but here’s what I found out:
|
Hey @markborkum , yes. We wanted to explore the possibilities of this. Have you done this before? Our first step was going to try to implement this on a simpler system (refactoring the XSD), then test it by creating an XML model using it. Thoughts / advice / warnings :) ? |
@corymosiman12 What is the intent/goal here? Which aspects of the schema would be affected by this issue? |
Intent is to improve constraint definition beyond IDs / IDRefs. My understanding of IDs / IDRefs is that they are global to the document, and XML validation only checks / ensures that an IDRef is made to an ID available in the XML doc, but is not doing this based on element 'type' (correct phrasing?). However, the inclusion of key / keyrefs appears to allow for constraining based on xpathing. Original scope of this question is exploratory, mainly to understand how this would affect the schema. As a first question, have you already implemented this in schematron? |
I see. @markborkum, do you see benefits to this still then? Major issues? @nllong thoughts? Continue exploration? |
@corymosiman12 Depending on the goal, In the Audit Template Schematron document, we use XPath to validate
|
Let’s discuss briefly on the call tomorrow.
Da: Mark Borkum <notifications@github.com>
Risposta: BuildingSync/schema <reply@reply.github.com>
Data: martedì novembre 5 2019 12:58
A: BuildingSync/schema <schema@noreply.github.com>
Cc: Nicholas Long <Nicholas.Long@nrel.gov>, Mention <mention@noreply.github.com>
Oggetto: Re: [BuildingSync/schema] Key / Keyref instead of ID / IDRef for limiting scope using Xpaths (#159)
@corymosiman12<https://github.com/corymosiman12> Depending on the goal, key/keyref may be worth exploring.
In the Audit Template Schematron document, we use XPath to validate id/idref links, where both the source and sink of the link are within the same scope. The general form is:
<sch:rule context="Scope[Source]">
<sch:assert test="Source/@IDref/text() = Sink/@ID/text()">
element 'Sink' not found within element 'Scope' for element 'Source'
</sch:assert>
</sch:rule>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#159?email_source=notifications&email_token=AAORVGRI7XIR7PUMTK2ZJULQSHF6BA5CNFSM4JJGKUS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDEDYOQ#issuecomment-549993530>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAORVGULLBMWRXLDHAOVDQLQSHF6BANCNFSM4JJGKUSQ>.
|
@markborkum I believe you said you looked into this more and found it dissatisfying - can you provide a recap / explanation to close out the discussion on this and then we can close this issue, as I believe we WILL NOT be going down this road? |
@corymosiman12 The main issue is the association of
Besides the difficulty of expressing 1, 2 and 3, there is also the issue that key/keyref XPaths are "restricted" to only parent/child syntax. They cannot, for example, use filter expressions. Hence, it is not possible to use key/keyref to refer to |
I see - thanks. Closing this. |
No description provided.
The text was updated successfully, but these errors were encountered: