« Return to Thread: Doctype and encoding storage

Re: Doctype and encoding storage

by Wolfgang Meier-2 :: Rate this Message:

Reply to Author | View in Thread

> Am I wrong?  How to keep these lines when storing document in eXist
> database?  The encoding is very important for me: how to be sure that
> eXist will store/retrieve it correctly ?

Neither the XML declaration nor the doctype are part of the document
model. With respect to the character encoding, eXist relies on Java's
unicode handling, so once the text of the document has been parsed, it
will be processed as unicode, no matter what encoding the file used on
disk. When writing out a document, it is the job of the serializer to
choose an output encoding. Use the serialization options to determine
which encoding is used.

eXist also stores the doctype declaration in the document's metadata,
but will not print it out by default when serializing the document
(mainly to avoid potential issues with internal entity declarations).
DTD's are always a bit problematic as they are themselves not XML.

Wolfgang

------------------------------------------------------------------------------
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open

 « Return to Thread: Doctype and encoding storage