Following the answers to my last question How do I embed elements in character content using Closure XML? I implemented a subclass of cxml: sax-proxy handler (a specific case of a broadcast handler). Unfortunately, it looks like an error in the library, but it is trying to create XML with internal document type definitions, but the document is not valid XML.
That is, by starting the parser with the command:
(with-open-file (out #P"teste.xml" :if-exists :supersede :direction :output) (let ((h (make-instance 'preproc :chained-handler (cxml:make-character-stream-sink out)))) (cxml:parse #P"harem.xml" h :validate t)))
where the harem.xml file begins (see doctype):
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE colHAREM SYSTEM "harem.dtd"> <colHAREM versao="Segundo_dourada_com_relacoes_14Abril2010"> <DOC DOCID="H2-dftre765"> <p>...
the command produces in the output file teste.xml:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE colHAREM SYSTEM "harem.dtd"<!ELEMENT EM #PCDATA> <!ATTLIST EM ID CDATA #REQUIRED> <!ATTLIST EM CATEG CDATA #IMPLIED> <!ATTLIST EM TIPO CDATA #IMPLIED> <!ATTLIST EM COMENT CDATA #IMPLIED> <!ATTLIST EM SUBTIPO CDATA #IMPLIED> <!ELEMENT ALT (#PCDATA|EM)*> <!ELEMENT OMITIDO (#PCDATA|EM|ALT|p)*> <!ELEMENT colHAREM (DOC)*> <!ATTLIST colHAREM versao CDATA #REQUIRED> <!ELEMENT p (#PCDATA|EM|OMITIDO|ALT)*> <!ATTLIST p xml:space (default|preserve) "default"> <!ELEMENT DOC (#PCDATA|p|OMITIDO)*> <!ATTLIST DOC DOCID CDATA #REQUIRED> > <colHAREM versao="Segundo_dourada_com_relacoes_14Abril2010"> ...
That is, the handler writes the DTD inside the output, but not so, without declarations inside [ and ] . Is this a bug in the library or in my code?
source share