Page 1 of 1

doc type association for root tag

Posted: Wed Aug 30, 2017 8:37 am
by 4everJang
I know it should be possible to have <oXygen/> look at the root tag of an XML document to determine which DTD to use for validation but it does not work (yet). Is there a detailed description of what to include and what to remove from the association rules to make this work?

I am developing an app in eXist-db, which strips all doctype declarations from the XML, so whenever I open a DITA file, I have to add the doctype declaration to make the validation work. The root element is always <dita> as that is the only type of file I am storing in eXist-db.

Re: doc type association for root tag

Posted: Wed Aug 30, 2017 6:28 pm
by mihaela

Here are some steps to follow if you want to to add a default schema validation for your DITA documents with "dita" root element name and no schema declared in the document:
  • Create an extension from the DITA default document type - open the Preferences dialog box (Options > Preferences) and go to Document Type Association. Select "DITA" document type and press "Extend". A "Document Type" dialog will open, allowing you to edit your extension framework.
  • In the "Association Rules" tab from the "Document Type" dialog remove all the rules exept the one that specifies "dita" as root element name.
  • Remove the default validation scenario from the "Validation" tab .
  • In the Schema tab, you can specify a schema that Oxygen XML Editor uses if an XML document does not contain a schema declaration and no default validation scenario is associated with it. So, go to "Schema" tab and specify the DTD to be associated with your documents.

Re: doc type association for root tag

Posted: Mon Sep 18, 2017 10:51 am
by 4everJang
Hello Mihaela,

I got swamped in other work, so I did not check back on the forum until now. I foillowed the steps you provided and this solved my issue.