xs:key/xs:keyref - editor showing incorrect choices
Oxygen general issues.
-
- Posts: 2
- Joined: Mon May 14, 2012 5:46 am
xs:key/xs:keyref - editor showing incorrect choices
Hi All,
I have been using oXygen for many years now and to be frank can't imagine life without it. I have returned to XML work after a 3 year break and found that am still having the same problem with xs:key/xs:keyref I've been having back 3 years ago in whatever version I was using then.
I have various elements with id attributes of xs:ID type and one of them is t:glossary-entry. I have an element t:gref with attribute target of type xs:IDREF which is used for cross referencing glossary entries. I have a set of key/keyref entries in my schema (shown below) which constraint the t:gref so it can only point to t:glossary-entry and no other element with xs:ID attribute. When it comes to validating the document everything works well. If my t:gref element points to t:glossary-entry then document is valid and if it points to say t:section than I correctly get a validation error: "[Xerces] cvc-identity-constraint.4.3: Key 'glossary-targets' with value 'sect-intro' not found for identity constraint of element 'website'."
The problem that I am having is that when I insert t:gref element into the document and oXygen shows me a list of choices for the target attribute, the list contains all xs:IDs from the document and not just those from t:glossary-entry element. So, basically it gives me invalid choices as well as those which are valid. I can select one of those invalid choices and my document becomes invalid. Am I doing something stupid or is oXygen simply ignoring the key constraints when presenting the choice for the target?
They key/keref defined in my root element in the schema:
Same problem in 12.2 standalone and 13.2 eclipse plugin
I have been using oXygen for many years now and to be frank can't imagine life without it. I have returned to XML work after a 3 year break and found that am still having the same problem with xs:key/xs:keyref I've been having back 3 years ago in whatever version I was using then.
I have various elements with id attributes of xs:ID type and one of them is t:glossary-entry. I have an element t:gref with attribute target of type xs:IDREF which is used for cross referencing glossary entries. I have a set of key/keyref entries in my schema (shown below) which constraint the t:gref so it can only point to t:glossary-entry and no other element with xs:ID attribute. When it comes to validating the document everything works well. If my t:gref element points to t:glossary-entry then document is valid and if it points to say t:section than I correctly get a validation error: "[Xerces] cvc-identity-constraint.4.3: Key 'glossary-targets' with value 'sect-intro' not found for identity constraint of element 'website'."
The problem that I am having is that when I insert t:gref element into the document and oXygen shows me a list of choices for the target attribute, the list contains all xs:IDs from the document and not just those from t:glossary-entry element. So, basically it gives me invalid choices as well as those which are valid. I can select one of those invalid choices and my document becomes invalid. Am I doing something stupid or is oXygen simply ignoring the key constraints when presenting the choice for the target?
They key/keref defined in my root element in the schema:
Code: Select all
<xs:key name="glossary-item-id">
<xs:selector xpath=".//t:glossary-entry"/>
<xs:field xpath="@id"/>
</xs:key>
<xs:keyref name="glossary-targets" refer="glossary-item-id">
<xs:selector xpath=".//t:gref"/>
<xs:field xpath="@target"/>
</xs:keyref>
-
- Posts: 2891
- Joined: Tue May 17, 2005 4:01 pm
Re: xs:key/xs:keyref - editor showing incorrect choices
Hello,
It's difficult to follow the relationship and references of the elements without having the schema to look at.
Could you please send us the schema or an appropriate sample that covers both the ID/IDREF attributes and key/keyref definitions to: support AT oxygenxml DOT com ?
Regards,
Adrian
It's difficult to follow the relationship and references of the elements without having the schema to look at.
Could you please send us the schema or an appropriate sample that covers both the ID/IDREF attributes and key/keyref definitions to: support AT oxygenxml DOT com ?
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 2891
- Joined: Tue May 17, 2005 4:01 pm
Re: xs:key/xs:keyref - editor showing incorrect choices
Hello,
In case anyone else encounters this, the problem in this case was that the content completion mechanism provided by Oxygen is offering all the collected IDs (based on the xs:IDREF type of the attribute) and is unaware of a subsequent restriction on the IDs imposed by the xs:key/xs:keyref combination. As a result it proposes all collected IDs, even though only one part of them apply in that context.
I have logged this to our issue tracking tool and it will be analyzed and implemented in a future version of Oxygen.
Regards,
Adrian
In case anyone else encounters this, the problem in this case was that the content completion mechanism provided by Oxygen is offering all the collected IDs (based on the xs:IDREF type of the attribute) and is unaware of a subsequent restriction on the IDs imposed by the xs:key/xs:keyref combination. As a result it proposes all collected IDs, even though only one part of them apply in that context.
I have logged this to our issue tracking tool and it will be analyzed and implemented in a future version of Oxygen.
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service