Community
Participate
Working Groups
Hi, I use the Eclipse JDT compiler in Ant and I log the compilation results in an XML file. Afterwards, I process this XML file to generate some reports. However, because the DOCTYPE declaration in the XML-compilation-log uses a SYSTEM id instead of a PUBLIC id, I'm having problems with processing this XML file in Ant. For instance, the current XML log looks like this: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE compiler SYSTEM "compiler.dtd"> <compiler name="Eclipse Java Compiler" copyright="Copyright IBM Corp 2000, 2005. All rights reserved." version="v_579_R31x, 3.1.1 release"> ... </compiler> Could this be changed to something like this: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE compiler PUBLIC "-//IBM Corp 2000//DTD Eclipse JDT Compiler//EN" "compiler.dtd"> <compiler name="Eclipse Java Compiler" copyright="Copyright IBM Corp 2000, 2005. All rights reserved." version="v_579_R31x, 3.1.1 release"> ... </compiler> This would allow the use of the <xmlcatalog> element in Ant, which can be used for instance in the <xslt> task to transform the XML log. There is a workaround I use to solve this problem: you can copy the compiler.dtd file to the same directory as where the XML log file is located. But I would rather avoid the copy-step. regards, Maarten
Feels a good suggestion.
I think I should expose these headers in a .properties file. It would then be possible to modify the xml headers without recompiling the code.
Oliver, your proposed doctype on newsgroup sounds good: "-//Eclipse.org//DTD Eclipse JDT Compiler//EN" I would suggest a version number in there, though ... you just *might* change it in the future :) I would, also, encourage you to use full URL when reference the dtd (and, to truly host it somewhere on eclipse.org. So, something like <!DOCTYPE compiler PUBLIC "-//Eclipse.org//DTD Eclipse JDT 3.2.561 Compiler//EN" "http://www.eclipse.org/jdt/compiler561.dtd"> or similar. having the full URL means people really could validate a file that uses it, even if DTD was not "local" (in the catalog, or same directory). The version number is technically for the DTD, not literally the JDT Compiler, so you may need to come up with some simplication, depending on how often you'd think it might change (if nearly every version of compiler, then just as well have "in synch" versions of dtd ... but if almost never, then 3.0 might suffice .). Here's some quicky found references to what all those fields in the public id mean: http://www.blooberry.com/indexdot/html/tagpages/d/doctype.htm http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/doctype.asp if they help any.
Thank you for your comment. Very helpful. I'd like to get an official answer from the foundation since this involves Eclipse.org.
I will release the following DOCTYPE. <!DOCTYPE compiler PUBLIC "-//Eclipse.org//DTD Eclipse JDT 3.2.001 Compiler//EN" "http://www.eclipse.org/jdt/core/compiler_32_001.dtd">. Philippe, could you please ensure that this is fine with the PMC?
Created attachment 30503 [details] Proposed fix Waiting for PMC approval to release.
The EMO is ok with this solution at this time. If bug 111923 changes the naming policies it might change a future URL. But that's then and this is now.
Fixed and released in HEAD.
Verified for 3.2 M5 using build I20060214-0010.