Bug 116615 - Use a publicID in the DOCTYPE of the compilation XML log
Summary: Use a publicID in the DOCTYPE of the compilation XML log
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC All
: P3 enhancement (vote)
Target Milestone: 3.2 M5   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-16 02:32 EST by Maarten Coene CLA
Modified: 2006-02-15 05:57 EST (History)
3 users (show)

See Also:


Attachments
Proposed fix (1.17 KB, patch)
2005-11-23 15:06 EST, Olivier Thomann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Maarten Coene CLA 2005-11-16 02:32:46 EST
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
Comment 1 Philipe Mulet CLA 2005-11-16 04:40:23 EST
Feels a good suggestion.
Comment 2 Olivier Thomann CLA 2005-11-16 08:51:18 EST
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.
Comment 3 David Williams CLA 2005-11-17 13:50:39 EST
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. 


Comment 4 Olivier Thomann CLA 2005-11-17 20:07:15 EST
Thank you for your comment. Very helpful.
I'd like to get an official answer from the foundation since this involves
Eclipse.org.
Comment 5 Olivier Thomann CLA 2005-11-23 15:02:35 EST
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?
Comment 6 Olivier Thomann CLA 2005-11-23 15:06:05 EST
Created attachment 30503 [details]
Proposed fix

Waiting for PMC approval to release.
Comment 7 Bjorn Freeman-Benson CLA 2005-11-24 15:57:04 EST
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.
Comment 8 Olivier Thomann CLA 2005-12-17 09:40:00 EST
Fixed and released in HEAD.
Comment 9 Maxime Daniel CLA 2006-02-15 05:57:46 EST
Verified for 3.2 M5 using build I20060214-0010.