Page 1 of 1

Exist DB drops DOCTYPE on Save

Posted: Mon Apr 29, 2013 6:42 pm
by bpopp
This is likely an exist issue, but I'm hoping someone here knows a quick fix. When using the Exist data connector (either via xmlrpc or webdav), the DOCTYPE declaration gets dropped on file creation/save. This causes Oxygen to treat the file as text vs in Authoring mode.

Anyone know a way to prevent this from happening?

Thanks,

Brian

Re: Exist DB drops DOCTYPE on Save

Posted: Mon Apr 29, 2013 9:45 pm
by ionela
Hi Brian,

A quick fix to preserve the Doctype declaration is to add the following PI directive in the files which tells eXist to keep it:

Code: Select all

<?exist-serialize indent="yes" output-doctype="yes"?>
What eXist-db version are you using? Depending on the version, there may be a way to somehow configure eXist to always preserve the Doctype declaration.

Regards,
Ionela

Re: Exist DB drops DOCTYPE on Save

Posted: Tue Apr 30, 2013 6:58 pm
by bpopp
Thanks for the info. We're currently just testing, so I haven't committed to a version, but we're currently using 2.0 (build 20130207). If I need to upgrade to a newer version, I can.

Just curious, but do you have any idea why it drops the DOCTYPE? How else would a client application identify which schema to use? I could see rewriting absolute references to a server-specific DTD, but I don't really understand why you would want to remove the DOCTYPE altogether?

Is there a better way to tell Oxygen what kind of document is being opened?

Re: Exist DB drops DOCTYPE on Save

Posted: Fri May 03, 2013 6:04 pm
by adrian
Hi,

From what I've been told, the reason for this is that eXist-db wouldn't validate XML against DTD anyway, only against XML Schema. So I believe they considered the DOCTYPE useless since eXist-db didn't handle DTDs. If you use XML schema it's fine.

If you want Oxygen to detect the documents without the DTD, you could alter the Association rules from the document type (Options > Preferences, Document Type Association) and make it more generic (e.g use only the Root local name). Note that by using more generic rules it's possible that some of the documents will be accidentally detected as being of that type.

Regards,
Adrian

Re: Exist DB drops DOCTYPE on Save

Posted: Fri May 03, 2013 11:57 pm
by bpopp
Yeah, I tried that, but since oxygen uses the class attribute to style DITA content in the editor, and the class attribute is applied via the DTD, which is assigned using catalog files, which are mapped using public ID's (ie. doctypes), the author tab is missing any styling unless I add a DOCTYPE with the correct ID.

At least, this is how I think it works. Frankly the integration of DITA OT and Oxygen is kind of a mystery to me.

I would switch to schemas, but I've done quite a bit of specialization using DTD's and I'm not sure how/if that works.

I tried adding the processing instruction and that worked (thanks for that). I'd love to know how to turn this on globally if anyone knows.