xs:alternative Content Completion
This should cover W3C XML Schema, Relax NG and DTD related problems.
-
- Posts: 2
- Joined: Sat May 01, 2021 8:21 am
xs:alternative Content Completion
Years ago, the editor supplied content completion based on the type selected via an xs:alternative. It stopped doing so when I upgraded from 15/16 to 21/23.
E.g. given this schema:
The editor will not give content completion assistance for the attributes "left" or "right" depending on "condition."
Similarly, if the derived types in the schema have child elements (etc.), no content completion assistance comes up for them either.
This is causing a bloat of xsi:type attributes in the instance documents. What happened?
E.g. given this schema:
Code: Select all
<?xml version="1.1" encoding="UTF-8"?>
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"
xmlns="urn:test" targetNamespace="urn:test" elementFormDefault="qualified"
vc:minVersion="1.1">
<xs:complexType name="base">
<xs:attribute name="condition" type="xs:boolean" use="required"/>
</xs:complexType>
<xs:complexType name="derived-1">
<xs:complexContent>
<xs:extension base="base">
<xs:attribute name="left"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="derived-2">
<xs:complexContent>
<xs:extension base="base">
<xs:attribute name="right"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="element" type="base">
<xs:alternative test="data(@condition) = ('true', 1)" type="derived-1"/>
<xs:alternative test="data(@condition) = ('false', 0)" type="derived-2"/>
</xs:element>
</xs:schema>
Code: Select all
<?xml version="1.1" encoding="UTF-8"?>
<element
xmlns="urn:test" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:test test.xsd"
condition="true"/>
This is causing a bloat of xsi:type attributes in the instance documents. What happened?
-
- Posts: 387
- Joined: Thu Jul 01, 2004 12:29 pm
Re: xs:alternative Content Completion
Hello,
Thanks for your feedback.
Unfortunately I cannot reproduce the problems. The content completion works fine for me, it provides the "left" or "right" attributes depending on "condition". I tested with oXygen XML Editor 23.1, build 2021030206.
Maybe you have set an option that affects the content completion support. I recommend you to reset to default the options from Options->Preferences->XML / XML Parser / XML Schema option page. The try to run the validation again on the XML document and then start the content completion.
If this does not work, maybe you can try to reset all your options. You can first save the options using the Options->Export Global Options action, then reset them using Options->Reset Global Options action.
If still does not work, please tell me what version of Oxygen do you use exactly, and send me the exported options on support@oxygenxml.com, to try to reproduce the problem.
Best Regards,
Octatian
Thanks for your feedback.
Unfortunately I cannot reproduce the problems. The content completion works fine for me, it provides the "left" or "right" attributes depending on "condition". I tested with oXygen XML Editor 23.1, build 2021030206.
Maybe you have set an option that affects the content completion support. I recommend you to reset to default the options from Options->Preferences->XML / XML Parser / XML Schema option page. The try to run the validation again on the XML document and then start the content completion.
If this does not work, maybe you can try to reset all your options. You can first save the options using the Options->Export Global Options action, then reset them using Options->Reset Global Options action.
If still does not work, please tell me what version of Oxygen do you use exactly, and send me the exported options on support@oxygenxml.com, to try to reproduce the problem.
Best Regards,
Octatian
Octavian Nadolu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 2
- Joined: Sat May 01, 2021 8:21 am
Re: xs:alternative Content Completion
I reset the XML Schema settings and then immediately changed it back to use 1.1, Saxon EE, and allow multiple schema imports, and now it works. The difference from what I had before is only in the Xerces validation features section--which it supposedly isn't using. Maybe the content completion is using Xerces anyway?
Thanks for the help.
Thanks for the help.
-
- Posts: 387
- Joined: Thu Jul 01, 2004 12:29 pm
Re: xs:alternative Content Completion
Hello,
Yes, only the XML Schema validation engine can be changed to Saxon, the content completion is always using Xerces.
Regards,
Octavian
Yes, only the XML Schema validation engine can be changed to Saxon, the content completion is always using Xerces.
Regards,
Octavian
Octavian Nadolu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ 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