Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Cannot open certain xml file with xml editor
Cannot open certain xml file with xml editor [message #59279] Thu, 30 December 2004 22:47 Go to next message
Eclipse UserFriend
Originally posted by: will70.gmail.com

Hello,

I'm having this strange behaviour when I open an xml file with a certain
tag. I did some research and found some related bugs to my problem in the
eclipse bug database (Bug 78340).

I created a simple xml file that looks like the following:

<?xml version="1.0" encoding="UTF-8"?>
<project>
<parent>
<child>
<property></property>
</child>
</parent>
</project>

and I get the following error message when I reopen it in the XML Source
Page Editor:
Cannot open default editor on Sample.xml. Editor could not be initialized.

The culprit is the <project> tag and it has to be the first tag in the xml
file.


On the other hand the following xml file opens correctly in the XML Source
Page Editor:
<?xml version="1.0" encoding="UTF-8"?>
<parent>
<child>
<property>
<project></project>
</property>
</child>
</parent>

Here the <project> tag is nested.

I just want to know if this is a bug or it's just happening to me.

thxs,

Will
Re: Cannot open certain xml file with xml editor [message #59304 is a reply to message #59279] Fri, 31 December 2004 02:12 Go to previous messageGo to next message
David Williams is currently offline David WilliamsFriend
Messages: 722
Registered: July 2009
Senior Member
On Thu, 30 Dec 2004 22:47:58 +0000 (UTC), Will Lopez <will70@gmail.com> wrote:

> <?xml version="1.0" encoding="UTF-8"?>
> <project>
> <parent>
> <child>
> <property></property>
> </child>
> </parent>
> </project>

An interesting test case. It is similar to the bug you reference.
In this case, the "eclipse system" is recognizing this as an "ant build file"
(due to the initial 'project' tag) so does not create the structuredDocument
our editor is expecting.

We (WTP editors) do have some work to do to allow/enable this kind of use,
but I'm wondering ... is it really an ant file you are creating? If so, you could use
the ant editor in the short term. (guess you'd have to "manually" associate your
file to the ant editor, for now, since another bug 37688 is still not fixed/enhanced.

I'll add these remarks to bug 78340.
Re: Cannot open certain xml file with xml editor [message #59387 is a reply to message #59304] Fri, 31 December 2004 03:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: will70.gmail.com

David Williams wrote:

> We (WTP editors) do have some work to do to allow/enable this kind of use,
> but I'm wondering ... is it really an ant file you are creating?

I noticed this problem when I was trying to open a maven.xml file.
Re: Cannot open certain xml file with xml editor [message #59412 is a reply to message #59279] Fri, 31 December 2004 04:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: will70.gmail.com

I'd like to add that even after I removed the initial <project> tag with
the text editor, I was still unable to open the file with the XML Source
Page Editor. Only after I restarted eclipse was I able to open the file.

Will

Will Lopez wrote:

> Hello,

> I'm having this strange behaviour when I open an xml file with a certain
> tag. I did some research and found some related bugs to my problem in the
> eclipse bug database (Bug 78340).

> I created a simple xml file that looks like the following:

> <?xml version="1.0" encoding="UTF-8"?>
> <project>
> <parent>
> <child>
> <property></property>
> </child>
> </parent>
> </project>

> and I get the following error message when I reopen it in the XML Source
> Page Editor:
> Cannot open default editor on Sample.xml. Editor could not be initialized.

> The culprit is the <project> tag and it has to be the first tag in the xml
> file.


> On the other hand the following xml file opens correctly in the XML Source
> Page Editor:
> <?xml version="1.0" encoding="UTF-8"?>
> <parent>
> <child>
> <property>
> <project></project>
> </property>
> </child>
> </parent>

> Here the <project> tag is nested.

> I just want to know if this is a bug or it's just happening to me.

> thxs,

> Will
Re: Cannot open certain xml file with xml editor [message #59435 is a reply to message #59304] Fri, 31 December 2004 05:05 Go to previous message
Frank Sauer is currently offline Frank SauerFriend
Messages: 18
Registered: July 2009
Junior Member
David Williams wrote:
> On Thu, 30 Dec 2004 22:47:58 +0000 (UTC), Will Lopez <will70@gmail.com>
> wrote:
>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <project>
>> <parent>
>> <child>
>> <property></property>
>> </child>
>> </parent>
>> </project>
>
>
> An interesting test case. It is similar to the bug you reference.
> In this case, the "eclipse system" is recognizing this as an "ant build
> file"
> (due to the initial 'project' tag) so does not create the
> structuredDocument
> our editor is expecting.
>
> We (WTP editors) do have some work to do to allow/enable this kind of use,
> but I'm wondering ... is it really an ant file you are creating? If so,
> you could use
> the ant editor in the short term. (guess you'd have to "manually"
> associate your
> file to the ant editor, for now, since another bug 37688 is still not
> fixed/enhanced.
>
> I'll add these remarks to bug 78340.

What happens if you add a DOCTYPE before the <project> tag or a
namespace to it? Will the Ant editor still take preference?

Frank Sauer
Previous Topic:Access Violation from Tomcat
Next Topic:lost setup jndi/jdbc
Goto Forum:
  


Current Time: Thu Dec 26 13:27:41 GMT 2024

Powered by FUDForum. Page generated in 0.03958 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top