| Summary: | XML editor does not support ANT scripts | ||
|---|---|---|---|
| Product: | [WebTools] WTP Source Editing | Reporter: | Michael Giroux <michael.giroux> |
| Component: | wst.xml | Assignee: | David Williams <david_williams> |
| Status: | CLOSED INVALID | QA Contact: | |
| Severity: | normal | ||
| Priority: | P2 | CC: | analogue, d_a_carver, for.work.things, marc.adams |
| Version: | 0.7 | ||
| Target Milestone: | 1.5.3 M153 | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
|
Description
Michael Giroux
It appears that the ant editor recognizes the build file markup and associated itself with that file. I created an XML file named NewFile.xml and added the project element referenced in the original bug report. It opened the file in the ant editor as the bug states. When I opened it with the XML editor, I got a dialog saying that the content type of the file isn't associated with the XML editor but it could be defined in the content type preferences. I would think this is a "works as designed" as the Ant editor is standard to the eclipse platform - I can't think of an instance where you would have the WTP XML editor but not the ant editor. If there is a disagreement, and the consensus is that the XML editor should be associated with build files, then I would be glad to take a look at it. The problem is this -- not all xml documents that contain a <project> root element are build files. For example, I have an xml document that is describing a construction project: <project name="Giroux" > <description> BUILD A HOUSE </description> <tasks> <task> get permit </task> </tasks> </project> This file works as expected. Now if you add a default="something" to the project root, <project name="Giroux" default="something"> the ANT editor decides this is an ANT script with invalid content, and it is no longer possible to open with the XML editor. I have even tried to qualify the element with an xmlns to prevent ANT editor from taking control: <project name="Giroux" default="something" xmlns="my.com"> It seems to me that given the flexability of XML, it is possible that some application will be able to define an xml document that happens to look like an ANT script. All that is needed is a root named 'project' with a 'default' attribute. This seems too aggressive to me. I hope others will agree that it should always be possible to open a file with the XML editor regardless of whether the ANT editor has been associated or not. Yes, we all agree and have debated this issue many times. Part of the problem is that the "ant lanuage" is really not recognizable in a very predictable way. That is, an ant file can contain almost anything. But, part of the problem is with the XML Editor. We need to provide our own (custom) FileDocumentProvider, which, I belive lies in our hands. After that, there may still be less that satisfactory behavior for some cases, that could be tweaked, but that FileDocumentProvider is needed first. This seems to work in 1.5.3. Can't duplicate error. Verified. I'm running WTP 1.5.3. This bug appears to have been resolved. *** Bug 130977 has been marked as a duplicate of this bug. *** Reporter verified this is working in 1.5.3, so closing. (I'm resolving as invalid just because I'm not sure if we actually put in any code to fix this. ANT may have fixed it on their end) closing. |