Problem with spectitle attribute
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 8
- Joined: Tue Sep 06, 2016 4:33 pm
Problem with spectitle attribute
Post by anttirauramo »
Hi! Please advice, I'm hopefully missing something very simple here... I'm using oXygen XML Editor 17.1 with DITA OT 1.8.5 to create a DITA 1.2 specialization of section. The specialization is a plugin in DITA OT and defines a document type shell in one file and extensions in another.
I have a class that references attributeGroup section.attributes:
...and elements that extend that class:
All's fine, until I try to set a default value to the spectitle attribute in vaatimus-element's extension of RYL-kappale.class:
The attribute is available in author when editing the test document and visible in the schema design view, but when I now try to validate my test document, xerces says:
...and saxon says:
...and libxml says:
This happens even if I replace the reference to the attribute group with the contents of the group, thus defining spectitle locally in RYL-kappale. Without spectitle default value in the schema, the test document validates.
Why?
Please let me know if I should provide more information on my specialization to help solve this issue.
I have a class that references attributeGroup section.attributes:
Code: Select all
<xs:complexType name="RYL-kappale.class" mixed="false">
<xs:sequence maxOccurs="unbounded">
<xs:choice>
<xs:group ref="basic.block"/>
<xs:element ref="alakappale"/>
</xs:choice>
</xs:sequence>
<xs:attributeGroup ref="section.attributes"/>
</xs:complexType>
Code: Select all
<xs:element name="vaatimus">
<xs:annotation>
<xs:documentation>Vaatimusteksti</xs:documentation>
</xs:annotation>
<xs:complexType mixed="false">
<xs:complexContent>
<xs:extension base="RYL-kappale.class">
<xs:attribute ref="class" default="+ topic/section ryl-d/vaatimus " />
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
Code: Select all
<xs:attribute ref="spectitle" default="Vaatimus" />
Code: Select all
src-resolve: Cannot resolve the name 'spectitle' to a(n) 'attribute declaration' component.
Code: Select all
The attribute {spectitle} is referenced, but has not been declared
Code: Select all
element attribute: Schemas parser error : attribute use (unknown), attribute 'ref': The QName value 'spectitle' does not resolve to a(n) attribute declaration.
Why?
Please let me know if I should provide more information on my specialization to help solve this issue.
-
- Posts: 9446
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Problem with spectitle attribute
Hi,
This question is not quite related to Oxygen as a product but we could try to find some time to look into this. If possible please send the entire specialization plugin to our email address (support@oxygenxml.com), it's hard to understand the problem by looking at just a few XML Schema snippets.
Regards,
Radu
This question is not quite related to Oxygen as a product but we could try to find some time to look into this. If possible please send the entire specialization plugin to our email address (support@oxygenxml.com), it's hard to understand the problem by looking at just a few XML Schema snippets.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 8
- Joined: Tue Sep 06, 2016 4:33 pm
Re: Problem with spectitle attribute
Post by anttirauramo »
Hi, yeah, I know... I was also hoping to catch some attention from other users who might have also experienced this. On the other hand, the specialization does work in oxygen but apparently doesn't work anywhere else, so perhaps there is some deeper understanding there that'd help solve the problem... Anyways, the help is much appreciated!
-
- Posts: 9446
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Problem with spectitle attribute
Hi,
No problem, usually most users registered on the forum receive notifications only on the threads they started.
So if you want to ask the DITA community I would suggest the DITA Users List http://dita.xml.org/dita-users.
If you want to ask the opinion of Oxygen users you can write on the Oxygen Users List https://www.oxygenxml.com/mailman/listinfo/oxygen-user
Regards,
Radu
No problem, usually most users registered on the forum receive notifications only on the threads they started.
So if you want to ask the DITA community I would suggest the DITA Users List http://dita.xml.org/dita-users.
If you want to ask the opinion of Oxygen users you can write on the Oxygen Users List https://www.oxygenxml.com/mailman/listinfo/oxygen-user
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 8
- Joined: Tue Sep 06, 2016 4:33 pm
Re: Problem with spectitle attribute
Post by anttirauramo »
Okay, Radu most kindly pointed out, that..:
This perhaps kind of compromises extending DITA as now there is no connection, other than name and namespace, between my spectitle and the DITA spectitle, but that doesn't really have any effect on anything except the structure of the schema. Now my documents have the default spectitle and they validate, all's well!
So, instead of referencing the attributeGroup section.attributes I copied it's contents to RYL-kappale.class, omitting spectitle, and then declared spectitle locally in elements extending RYL-kappale.class:When using XSD extensions you can only add new attributes, you cannot modify features for old attributes. The @class attribute is not defined in the base complex type hierarchy to you are simply adding it and it works.
But the "spectitle" is already defined in the "section.attributes"
attribute group and xsd:extensions do not allow modifying characteristics of existing attributes.
Code: Select all
<xs:element name="vaatimus">
<xs:annotation>
<xs:documentation>Vaatimusteksti</xs:documentation>
</xs:annotation>
<xs:complexType mixed="false">
<xs:complexContent>
<xs:extension base="RYL-kappale.class">
<xs:attribute ref="class" default="+ topic/section ryl-d/vaatimus " />
<xs:attribute name="spectitle" default="Vaatimus" />
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
-
- Posts: 9446
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Problem with spectitle attribute
Hi Antti,
Thanks for updating the post.
I think what you did is the cleanest approach.
I did not suggest this workaround because the RYL-kappale.class is referenced as a base type in multiple places and in all those places the attribute reference to the base spectitle will be lost.
Regards,
Radu
Thanks for updating the post.
I think what you did is the cleanest approach.
I did not suggest this workaround because the RYL-kappale.class is referenced as a base type in multiple places and in all those places the attribute reference to the base spectitle will be lost.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “DITA (Editing and Publishing DITA Content)”
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