E [DITA_SPECS] Invalid format for 'class' attribute. Class a

Having trouble installing Oxygen? Got a bug to report? Post it all here.
yury.eroshenkov
Posts: 34
Joined: Mon Jun 03, 2013 2:17 pm

E [DITA_SPECS] Invalid format for 'class' attribute. Class a

Post by yury.eroshenkov »

Hi,
i'm using an oxygen web component(applet) and i have a machinery industry task:

Code: Select all

<task id="MITest1_1" xmlns:ditaarch="http://dita.oasis-open.org/architecture/2005/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:oasis:names:tc:dita:spec:machinery:xsd:machineryTask.xsd">
<title>MITest1</title>
<prolog>
<author>Yury E.</author>
</prolog>
<taskbody>
<prelreqs>
</prelreqs>
</taskbody>
</task>
but when i inserted a <prelreqs> element i've got the next validation error:

Code: Select all

E [DITA_SPECS] Invalid format for 'class' attribute. Class attribute not specified.
As i know this xml must be valid by machinery schema. What this error means?
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: E [DITA_SPECS] Invalid format for 'class' attribute. Cla

Post by sorin_ristache »

Hello,

The error means that the definition of prelreqs in the XSD schema does not declare a class attribute for this element. You can see this yourself by placing the cursor on the <prelreqs> tag or the </prelreqs> tag, right click and select the action Show Definition (the default shortcut is Ctrl+Shift+Enter) from the popup menu.

You can correct the XSD schema for DITA tasks if you want at the location indicated by the Show Definition action. However I suggest validating your DITA tasks and topics against the DITA DTD, not the DITA XSD, as declared by default in the Oxygen templates for new DITA topic files. This will avoid the error reported by the DITA XSD. For example if you press the New button on the Oxygen toolbar and type task in the search text field of the New dialog box, then you select the entry called Machinery Task, Oxygen will create a new file that starts with:

Code: Select all

<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Machinery Task//EN" "task.dtd">
<task id="task_ID">
<title>Task title</title>
<shortdesc/>
<taskbody>
. . .

Regards,
Sorin
yury.eroshenkov
Posts: 34
Joined: Mon Jun 03, 2013 2:17 pm

Re: E [DITA_SPECS] Invalid format for 'class' attribute. Cla

Post by yury.eroshenkov »

Hi, Sorin.
We have to support both content declaration types: DTD and Schema in our tool. We are using the same schemas for our content that Oxygen Framework DITA 1.2 using from DITA-OT without any specialization. And, actually, the class attribute is specified in the taskreqDomain.xsd:

Code: Select all


  <!-- LONG NAME: Preliminary Requirements -->
<xs:complexType name="prelreqs.content">
<xs:sequence>
<xs:group minOccurs="0" ref="reqconds"/>
<xs:group minOccurs="0" ref="reqpers"/>
<xs:group minOccurs="0" ref="supequip"/>
<xs:group minOccurs="0" ref="supplies"/>
<xs:group minOccurs="0" ref="spares"/>
<xs:group minOccurs="0" ref="safety"/>
</xs:sequence>
</xs:complexType>
<xs:attributeGroup name="prelreqs.attributes">
<xs:attributeGroup ref="univ-atts"/>
<xs:attribute name="outputclass"/>
</xs:attributeGroup>
<xs:element name="prelreqs"/>
<xs:attributeGroup name="prelreqs.attlist">
<xs:attributeGroup ref="prelreqs.attributes"/>
<xs:attributeGroup ref="global-atts"/>
<xs:attribute name="class" default="+ topic/section task/prereq taskreq-d/prelreqs "/>
</xs:attributeGroup>
But in all Oxygen Editors (i've checked a standalone Oxygen Developer 14.2 and Author Component 15.0) the attribute list for the elements prelreqs and closereqs is empty. Is it means that the XSD declaration for these elements isn't correct?
yury.eroshenkov
Posts: 34
Joined: Mon Jun 03, 2013 2:17 pm

Re: E [DITA_SPECS] Invalid format for 'class' attribute. Cla

Post by yury.eroshenkov »

PS. Looks like the declaration have to be next:

Code: Select all


 <xs:complexType name="prelreqs.content">
<xs:sequence>
<xs:group minOccurs="0" ref="reqconds"/>
<xs:group minOccurs="0" ref="reqpers"/>
<xs:group minOccurs="0" ref="supequip"/>
<xs:group minOccurs="0" ref="supplies"/>
<xs:group minOccurs="0" ref="spares"/>
<xs:group minOccurs="0" ref="safety"/>
</xs:sequence>
</xs:complexType>
<xs:attributeGroup name="prelreqs.attributes">
<xs:attributeGroup ref="univ-atts"/>
<xs:attribute name="outputclass"/>
</xs:attributeGroup>
<!--add prelreqs attributes to prelreqs element declaration -->
<xs:element name="prelreqs">
<xs:complexType>
<xs:complexContent>
<xs:extension base="prelreqs.content">
<xs:attributeGroup ref="prelreqs.attlist"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
<!---------->
<xs:attributeGroup name="prelreqs.attlist">
<xs:attributeGroup ref="prelreqs.attributes"/>
<xs:attributeGroup ref="global-atts"/>
<xs:attribute name="class" default="+ topic/section task/prereq taskreq-d/prelreqs "/>
</xs:attributeGroup>
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: E [DITA_SPECS] Invalid format for 'class' attribute. Cla

Post by sorin_ristache »

Hi Yuri,

That is correct, the definition of the prelreqs element must be corrected in the DITA XSD for Machinery Task, as in your code:

Code: Select all

<!--add prelreqs attributes to prelreqs element declaration -->
<xs:element name="prelreqs">
<xs:complexType>
<xs:complexContent>
<xs:extension base="prelreqs.content">
<xs:attributeGroup ref="prelreqs.attlist"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>

Regards,
Sorin
yury.eroshenkov
Posts: 34
Joined: Mon Jun 03, 2013 2:17 pm

Re: E [DITA_SPECS] Invalid format for 'class' attribute. Cla

Post by yury.eroshenkov »

Hi, Sorin.
I've contacted with Mr. Eric Sirois (DITA implementation submitter from OASIS committee) and he told me that this issue is alredy fixed in the last version of the DITA 1.2 release 2013-04-10 (https://www.oasis-open.org/committees/d ... bbrev=dita).
So, i suggest you to update your dita schemas in the frameworks of your tools.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: E [DITA_SPECS] Invalid format for 'class' attribute. Cla

Post by sorin_ristache »

Hi Yuri,

Yes, that is what Eric said in the DITA-OT issue that I raised about this problem. Oxygen 16 will integrate DITA-OT 1.8 so this fix will be included in the future versions of Oxygen together with a more recent version of DITA-OT.


Regards,
Sorin
Post Reply