On Wed, 13 Feb 2013 07:36:26 -0800, Geert Josten <[email protected]> wrote:
> Hi Karthik, > > > > If you let MarkLogic parse such doctypes properly (using document-load, > document-get or unquote), you would see it gets stripped away. That is > conform XML recommendation. The doctype would have no use inside > MarkLogic, > so I wouldn’t bother inserting it at storage within MarkLogic. Instead, > add > the doctype on output. You can specify output options within a specific > XQuery file, or you can specify it in general for an App Server in the > Admin interface. > > Just to expand a bit. The DOCTYPE header is not valid as a literal in XQuery, so if you were trying to add it to your content via XQuery, that is why you got the error. MarkLogic does not do DTD validation, so the presence or absence of the header will not materially affect how the XML is processed. If you want the header to appear when you output the content again, this can be achieved through serialization parameters. You can configure these for the appserver, or in your query header. e.g. declare option xdmp:output "doctype-public=-/NLM/DTD Test//En"; declare option xdmp:output "doctype-system=Test.dtd"; //Mary > > I have a requirement to add a DOCTYPE header to a xml document stored in > MarkLogic DB. > > <!DOCTYPE Test PUBLIC "-//NLM//DTD Test //EN" "Test.dtd"> > > > > If I try to insert a document with the above DOCTYPE header, I am getting > “Unexpected token syntax error, unexpected Junk_”. > > I didn’t face any issue when I try to insert documents with XSD mapping. > > Is it possible to insert documents with DOCTYPE header? _______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
