Page 1 of 1

ignore or filter DITA error messages

Posted: Wed Jun 17, 2020 9:35 am
by vishwavaranasi
Hi Team , we have a custom DITA doc types for the <topic> , so we have created a template file

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//COMPANY//DTD myCustom DITA Topic//EN" "myCustomTopic.dtd">
<topic id="${customUUID}" format="dita" type="topic">
    <title></title>
    <body></body>
</topic>
since my DITA custom type extends DITA , and when i create a topic using above template DITA validation is throwing error


Attribute "type" is not allowed to appear in element "topic".

Attribute "format" is not allowed to appear in element "topic".

We want to allow these 2 attributes to be included when we create a topic and don not show any error messages to the user.

would you please help us how to achieve this?

Thanks,
vishwa

Re: ignore or filter DITA error messages

Posted: Wed Jun 17, 2020 9:44 am
by Radu
Hi,

Your use case is quite strange because the format and type of a file are automatically determined by the publishing engine when it is referenced in the DITA Map.

There is a tutorial written by expert Eliot Kimber about how to create your own DITA specialization DTDs:

https://www.xiruss.org/tutorials/dita-specialization/

One of the chapters there is called "Attribute Specialization Tutorial" and can be used to add your own new global attributes, but the attributes will need to be defined on all DITA elements, with the DITA 1.3 specification all new attributes need to be defined as gobal attributes and thus they become available on all elements:

https://www.oxygenxml.com/dita/1.3/spec ... butes.html

Regards,
Radu

Re: ignore or filter DITA error messages

Posted: Fri Jun 19, 2020 4:41 pm
by wmaclean
Hi Radu - thanks for your help!