From: Dannes W. <da...@ex...> - 2012-01-06 09:50:44
|
Hi Robert, On 5 Jan 2012, at 20:27 , Robert Han wrote: > The issue happens when I stored this article.xml file to eXist, then open it in Java Client editor, if I added in a λ to it, eXist will raise an error and this is what I intend to resolve. I replayed the scenario, there are a few things to mention...... (0) Preparing eXist-db the file catalog.xml (webapps/WEB-INF/) should be updated with the following line for your DTD: <public publicId="-//WORLDBOOK//ARTICLE//2.0//EN" uri="entities/article.dtd"/> you provided some additional files (article.dtd, a .mod file and some more DTDs), these should be stored in the existdb 'entities' directory (or what ever directory you specify in the file catalog.xml) (1) Add and preserve doctype The provided example file does not contain a reference to any grammar (DTD in this case). Because of the absence of this info, the Xerces parser of eXist-db is not able to know which grammar must be used for validation. I saw that you found out about the <?exist-serialize indent="yes" output-doctype="yes"?> PI to preserve the doctype. I had to put it on a subtile different location: <!DOCTYPE article PUBLIC "-//WORLDBOOK//ARTICLE//2.0//EN" "http://nowhere"> <?exist-serialize indent="yes" output-doctype="yes"?> <article id="830074" status="final" revised-date="09/17/2010" revised-by="Leigh Daeuble" product="sdeol"> (2) Add additional entities When I retried to store the document (step one), I found out that I forgot to add some of the entity files you provided: "Caused by: java.io.FileNotFoundException: /Users/......./trunk-new/webapp/WEB-INF/entities/mathml2-qname-1.mod (No such file or directory)" The feedback is clear, I copied the files to the location suggested. Restart is not necessary. Now if I store the document, the document is accepted. Reopening the document shows that document in tact. To verify if XML validation works, I change <title>foobaar<title> into <title1>foobaar<title1> . Now, when storing the document I see the expected validation feedback: "The XML parser reported a problem: error at (4,13) : Element type "title1" must be declared." (3) Store document with the &lamda; entity the last step..... let's add the "&lamda;" entity to the title <title>FooBar&lamda;</title> store document, close panel, open document; now is shows: <title>FooBarΛ</title> as hoped........ Robert: can I share the xml documents DTDs and entities files with the MailingList? I think more people might be interested in how it works. cheers Dannes |