Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 59764 - XML include syntax not fully supported by Ant editor?
Summary: XML include syntax not fully supported by Ant editor?
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Ant (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 M9   Edit
Assignee: John-Mason P. Shackelford CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 69460 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-04-23 06:13 EDT by Andrew Premdas CLA
Modified: 2004-07-07 14:59 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Premdas CLA 2004-04-23 06:13:54 EDT
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE project [
    <!ENTITY properties SYSTEM "file:properties.xml">
]>

causes an error in the ant editor which complains about not being able to 
find "file:properties.xml" (FileNotFoundException).

Fixed by removing "file:" but ant editor should (?) recognise the file prefix 
as not being part of the filename.

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE project [
    <!ENTITY properties SYSTEM "properties.xml">
]>

works fine.

file: syntax works with ant 1.5.3 and 1.6.1 and is as used in Java Development 
with Ant.
Comment 1 Darin Swanson CLA 2004-04-28 18:48:10 EDT
Well if it is in Java Development with Ant we had better support it :-)
Comment 2 Darin Swanson CLA 2004-04-29 01:07:24 EDT
Well we get some of the blame but I would like to lay most of the blame on the 
Crimson parser not accepting the "file:" prefix...man I HATE XML parsing :-)

Apache Ant ships with Xerces there for they guarantee the XML parser they are 
using. The Xerces parser correctly handles "file:". We do not ship with Xerces 
so we get the JAXP parser...which defaults to the Crimson implementation on 
JDK 1.4.*

So the final story is that we had some tweaks to set the context classloader 
so that if the user specifies Xerces on their Ant runtime classpath (global) 
the Ant editor "uses" the Xerces parser and correctly handles "file:"

After changing the global classpath to have or not to have the xerces JARs, 
you have to force the reparsing of the Ant editor. I have logged bug 60366.

Changes to:
AntModel: sets the thread context classloader appropriately so that the Xerces 
parser is found and used

ProjectHelper: moved away from using the Apache Ant JAXPUtils as this caches 
the parser in a static var. Changed to lazy init the FileUtils as well.

Created the two nls helper files: ProjectHelperMessages.java and 
ProjectHelperMessages.properties.
Comment 3 Darin Swanson CLA 2004-04-29 01:08:25 EDT
Please verify John-Mason.
Comment 4 Andrew Premdas CLA 2004-04-29 05:48:02 EDT
Darin,

Thanks for sorting this. A question though. As Ant 1.6.1 ships with 
XercesImpl.jar, shouldn't the Ant 1.6.1 plugine ship with this library too. 
Then you can guarantee (sort of) that eclipse's ant builder will parse in the 
same way as Ant.

All best

Andrew
Comment 5 Darin Swanson CLA 2004-04-29 08:12:59 EDT
No problem.
Apache Ant has shipped with a Xerces implementation for some time. 
Before I took over the Ant integration is was decided that the Ant plugin 
should not contain Xerces; likely because in the past Eclipse had a separate 
Xerces plugin.  
I will talk this over with others but it think this would be unlikely to 
change especially as we are late in 3.0
Comment 6 Darin Swanson CLA 2004-07-07 14:59:44 EDT
*** Bug 69460 has been marked as a duplicate of this bug. ***