Bug 23638

Summary: The line numbers for Ant build scripts that include other xml files are misleading
Product: [Eclipse Project] Platform Reporter: Markus Kohler <kohler>
Component: AntAssignee: Platform-Ant-Inbox <platform-ant-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 Keywords: core
Version: 2.0.1   
Target Milestone: 2.1 M5   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Markus Kohler CLA 2002-09-17 09:06:48 EDT
Our build.xml files typically include at least one other file using the XML
include mechnism : 

?xml version="1.0"  encoding="iso-8859-1"?>
<!DOCTYPE project   [
<!ENTITY common SYSTEM "file:../Build/Ant/common.xml">
]>

<project name="SomeProject" default="main" basedir=".">
  
&common;

The problem is that the line numbers for errors (when running the script) in
these files are incorrect (or at least misleading). 
It seems to me that the lines of the included file are also counted. 
I get line numbers which are greater than the number of lines in my build.xml file.
Comment 1 Darin Wright CLA 2002-11-15 13:37:48 EST
Needs investigation
Comment 2 Darin Wright CLA 2002-12-04 10:35:12 EST
This bug conflicts with bug 23392. Bug 23392 states that entity expands do not 
work.
Comment 3 Darin Swanson CLA 2003-01-01 15:01:40 EST
I cannot reproduce the problem.
Note that this is using 2.1 M4.

---build.xml----
<?xml version="1.0"  encoding="iso-8859-1"?>
<!DOCTYPE project   [
<!ENTITY common SYSTEM "file:common.xml">
]>

<project name="SomeProject" default="main2" basedir=".">
  
&common;

<target name="main2" depends="main">
	<echo message= "Main2">
</target>
</project>

---common.xml---
<target name="main">
	<!-- do stuff -->
	<echo message= "Main"/>
	<echo message= "Main2"/>
	<echo message= "Main3"/>
	<echo message= "Main4"/>
	<echo message= "Main5"/>
</target>

Error message I recieve:
BUILD FAILED: file:c:/1115/ApacheCon/scripts/23638.xml:12: Expected "</echo>" 
to terminate element starting on line 11.
Comment 4 Markus Kohler CLA 2003-01-06 03:48:20 EST
I guess it's an Ant 1.4.1 problem.