From: Jason S. <js...@in...> - 2011-04-08 18:03:56
|
I have an answer. Please correct this analysis if it is wrong. The doctype is handled by org.exist.storage.serializers.NativeSerializer, around line 92. If you set the "output-doctype" property to "yes", it will emit the doctype here. Making a leap, it looks like DocumentImpl returns an org.exist.dom.DocumentTypeImpl. It looks like this class implements only a tiny subset of the DTD spec and ignores the rest. So in other words, except for DTDs that are exactly like XHTML doctype declarations, it won't work. It doesn't recognize or store more complex information. Does that sound like a fair assessment? I will be the first to admit that I could be misreading this. Jason Smith ________________________________ From: Jason Smith [js...@in...] Sent: Friday, April 08, 2011 11:31 AM To: Casey Jordan; Wolfgang Meier Cc: exi...@li... ml Subject: Re: [Exist-open] Propagating doctype definition in XQuery No, this is not meant to be critical. If I can solve this problem, it will help alot with resistance to adopting eXist within my company. I tried the flag with a document that looks like this: <!DOCTYPE dmodule [ <!ENTITY ICN-S1000DBIKE-AAA-DA23000-0-U8025-00532-A-04-1 SYSTEM "DOCATO_ABSTRACT_ID_3055" NDATA cgm> <!NOTATION cgm PUBLIC "-//USA-DOD//NOTATION Computer Graphics Metafile//EN"> ]> <dmodule ... What I got back was: <!DOCTYPE dmodule> <dmodule ... So while this is encouraging - further than I've gotten with this before - I'm still missing something. Here is the serializer code I am using: Serializer serializer = broker.getSerializer(); serializer.setProperty("output-doctype", "yes"); serializer.serialize(document, out); Seems pretty simple. What can I do to troubleshoot this? Jason Smith ________________________________ From: Casey Jordan [cas...@jo...] Sent: Friday, April 08, 2011 11:02 AM To: Wolfgang Meier Cc: exi...@li... ml Subject: Re: [Exist-open] Propagating doctype definition in XQuery Gentlemen, There is no reason to argue DTD vs schema because I wholly believe that schema is the right way to go. However, our SaaS product caters to a large community of technical writers and businesses which are still using DTD's and probably will be for at least a few years. We cannot demand that our customers switch to xml schema, its just not feasible when talking with multi billion dollar companies and puts us at a disadvantage in the market. So while I appreciate that philosophically moving from DTD to schema is the right idea, there are also real world problems with this. I also understand that since it is not part of the spec this becomes problematic. However I really need to be able to: 1.) Get the DTD to be added to the document when opened in webdav 2.) Get the DTD to be added back into the files when backups are run or when files are exported 3.) Get the DTD in files that are added to a zip archive using the compression module. Currently in 1.4.1 I am not seeing any of this happening. I will look into the output-doctype="yes|no" (Thanks Wolfgang), however I am not sure that this will solve all three of these problems. I am sorry if I am being over critical about this, it was not my intention. I do very much appreciate the feedback on this thread. Cheers, Casey On Fri, Apr 8, 2011 at 12:48 PM, Wolfgang Meier <wol...@ex...<mailto:wol...@ex...>> wrote: The main reason why eXist does not output a doctype declaration is that there's no way for it to know if the DTD was completely loaded from an external source or parts of it were passed as internal subsets within the doctype declaration itself. That's the entire problem! If we output the doctype declaration by default, the document may become invalid. But as has been said before, eXist does store the doctype declaration in the document metadata and if asked to do so, it can print it out. There's a serialization option output-doctype="yes|no" for this. Wolfgang ------------------------------------------------------------------------------ Xperia(TM) PLAY It's a major breakthrough. An authentic gaming smartphone on the nation's most reliable network. And it wants your games. http://p.sf.net/sfu/verizon-sfdev _______________________________________________ Exist-open mailing list Exi...@li...<mailto:Exi...@li...> https://lists.sourceforge.net/lists/listinfo/exist-open -- -- Casey Jordan easyDITA a product of Jorsek LLC "CaseyDJordan" on LinkedIn, Twitter & Facebook Cell (585) 348 7399 Office (585) 239 6060 easydita.com<http://easydita.com> This message is intended only for the use of the Addressee(s) and may contain information that is privileged, confidential, and/or exempt from disclosure under applicable law. If you are not the intended recipient, please be advised that any disclosure copying, distribution, or use of the information contained herein is prohibited. If you have received this communication in error, please destroy all copies of the message, whether in electronic or hard copy format, as well as attachments, and immediately contact the sender by replying to this e-mail or by phone. Thank you. |