Exist DB drops DOCTYPE on Save

Having trouble installing Oxygen? Got a bug to report? Post it all here.
bpopp
Posts: 37
Joined: Tue Nov 30, 2010 7:34 pm

Exist DB drops DOCTYPE on Save

Post 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
ionela
Posts: 402
Joined: Mon Dec 05, 2011 6:08 pm

Re: Exist DB drops DOCTYPE on Save

Post 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
Ionela Istodor
oXygen XML Editor and Author Support
bpopp
Posts: 37
Joined: Tue Nov 30, 2010 7:34 pm

Re: Exist DB drops DOCTYPE on Save

Post 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?
adrian
Posts: 2855
Joined: Tue May 17, 2005 4:01 pm

Re: Exist DB drops DOCTYPE on Save

Post 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
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
bpopp
Posts: 37
Joined: Tue Nov 30, 2010 7:34 pm

Re: Exist DB drops DOCTYPE on Save

Post 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.
Post Reply