Skip to main content



      Home
Home » Language IDEs » ServerTools (WTP) » XML validation always downloads DTD/Schemas?
XML validation always downloads DTD/Schemas? [message #114205] Mon, 27 June 2005 14:29 Go to next message
Eclipse UserFriend
Originally posted by: jens.ja-web.de

I tried now several products which are based on eclipse and WTP, namely
MyEclipseIDE and Exadel Studio and I always have this slightly annoying
behavior:

When an XML file gets saved (or the project gets build) the XML (or all
of them) get validated. This validation always takes quite some time and
I note high network activity during that time. So I guess the validation
process downloads schema information from the URLs provided in the files.

But shouldn't the necessary DTD/XSD files be already on the local
machine (XML Catalog) and used instead of always going online?


Is this a limitation of the current status and will be fixed later or is
there something wrong in my configuration of WTP?


thanks
Jens
Re: XML validation always downloads DTD/Schemas? [message #114254 is a reply to message #114205] Mon, 27 June 2005 21:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bob.objfac.com

WTP supports a limited version of XML Catalog. I believe it's supported
as an extension. There has been quite a bit of discussion of it in this
newsgroup. Try searching for "xml catalog".

Bob

Jens Ansorg wrote:
> I tried now several products which are based on eclipse and WTP, namely
> MyEclipseIDE and Exadel Studio and I always have this slightly annoying
> behavior:
>
> When an XML file gets saved (or the project gets build) the XML (or all
> of them) get validated. This validation always takes quite some time and
> I note high network activity during that time. So I guess the validation
> process downloads schema information from the URLs provided in the files.
>
> But shouldn't the necessary DTD/XSD files be already on the local
> machine (XML Catalog) and used instead of always going online?
>
>
> Is this a limitation of the current status and will be fixed later or is
> there something wrong in my configuration of WTP?
>
>
> thanks
> Jens
Re: XML validation always downloads DTD/Schemas? [message #114307 is a reply to message #114254] Mon, 27 June 2005 23:21 Go to previous messageGo to next message
Eclipse UserFriend
Hi Jens,

As Bob said, the WTP does include an XML catalog. Those files required for
validation that the WTP has been granted permission to redistribute are
included in the catalog by default. The WTP includes an internet cache as
well (that is disabled by default) that will, you guessed it, cache remote
resources to reduce the validation delay.

Lawrence
Re: XML validation always downloads DTD/Schemas? [message #114480 is a reply to message #114254] Tue, 28 June 2005 17:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jens.ja-web.de

Bob Foster wrote:
> WTP supports a limited version of XML Catalog. I believe it's supported
> as an extension. There has been quite a bit of discussion of it in this
> newsgroup. Try searching for "xml catalog".

Ok, in the ExadelStudio there are about 20 entries in the catalog.

But one for Hibernate is missing. So I created a User Specified entry
URI:
file:C:\path_to_the_DTD\hibernate.sourceforge.net\hibernate- configuration-3.0.dtd
Key Type: Public ID
Key: -//Hibernate/Hibernate Mapping DTD 3.0//EN


but now I get an error at Validation:

"Referenced file contains errors
(http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd). For more
information, right click on the message and select "Show Details..." "

Details:
"The errors below were detected when validating the file
"hibernate-mapping-3.0.dtd" via the file "TTerminTypen.hbm.xml". In
most cases these errors can be detected by validating
"hibernate-mapping-3.0.dtd" directly. However it is possible that
errors will only occur when hibernate-mapping-3.0.dtd is validated in
the context of TTerminTypen.hbm.xml."

And

"The markup declarations contained or pointed to by the document type
definition must be well-formed." Location: Line 1


I do not get this errors without the custom catalog entry, when
validation goes to the internet


so what about those errors?


thanks,
Jens
Re: XML validation always downloads DTD/Schemas? [message #114513 is a reply to message #114480] Wed, 29 June 2005 12:43 Go to previous messageGo to next message
Eclipse UserFriend
Hi Jens,

I'm not very familiar with the hibernate DTD's. Can you post a sample XML
file that demonstrates this problem?

Lawrence
Re: XML validation always downloads DTD/Schemas? [message #114550 is a reply to message #114480] Wed, 29 June 2005 15:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bob.objfac.com

Shouldn't that URI be:

file:///C:/path_to_the_DTD/hibernate.sourceforge.net/hiberna te-configuration-3.0.dtd

file:/// for a local absolute path and no \ in URIs.

Bob

Jens Ansorg wrote:
> Bob Foster wrote:
>
>> WTP supports a limited version of XML Catalog. I believe it's
>> supported as an extension. There has been quite a bit of discussion of
>> it in this newsgroup. Try searching for "xml catalog".
>
>
> Ok, in the ExadelStudio there are about 20 entries in the catalog.
>
> But one for Hibernate is missing. So I created a User Specified entry
> URI:
> file:C:\path_to_the_DTD\hibernate.sourceforge.net\hibernate- configuration-3.0.dtd
>
> Key Type: Public ID
> Key: -//Hibernate/Hibernate Mapping DTD 3.0//EN
>
>
> but now I get an error at Validation:
>
> "Referenced file contains errors
> (http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd). For more
> information, right click on the message and select "Show Details..." "
>
> Details:
> "The errors below were detected when validating the file
> "hibernate-mapping-3.0.dtd" via the file "TTerminTypen.hbm.xml". In
> most cases these errors can be detected by validating
> "hibernate-mapping-3.0.dtd" directly. However it is possible that
> errors will only occur when hibernate-mapping-3.0.dtd is validated in
> the context of TTerminTypen.hbm.xml."
>
> And
>
> "The markup declarations contained or pointed to by the document type
> definition must be well-formed." Location: Line 1
>
>
> I do not get this errors without the custom catalog entry, when
> validation goes to the internet
>
>
> so what about those errors?
>
>
> thanks,
> Jens
>
Re: XML validation always downloads DTD/Schemas? [message #114761 is a reply to message #114550] Thu, 30 June 2005 09:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jens.ja-web.de

Bob Foster wrote:
> Shouldn't that URI be:
>
> file:///C:/path_to_the_DTD/hibernate.sourceforge.net/hiberna te-configuration-3.0.dtd
>
>
> file:/// for a local absolute path and no \ in URIs.
>

If so then it's a bug in the Diaog for creating userdefined catalog
entries. I did not enter that manually.

file a bug report?


Jens
Re: XML validation always downloads DTD/Schemas? [message #114799 is a reply to message #114761] Thu, 30 June 2005 16:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bob.objfac.com

I would.

Bob

Jens Ansorg wrote:
> Bob Foster wrote:
>
>> Shouldn't that URI be:
>>
>> file:///C:/path_to_the_DTD/hibernate.sourceforge.net/hiberna te-configuration-3.0.dtd
>>
>>
>> file:/// for a local absolute path and no \ in URIs.
>>
>
> If so then it's a bug in the Diaog for creating userdefined catalog
> entries. I did not enter that manually.
>
> file a bug report?
>
>
> Jens
Re: XML validation always downloads DTD/Schemas? [message #114824 is a reply to message #114480] Thu, 30 June 2005 20:10 Go to previous messageGo to next message
Eclipse UserFriend
Jens Ansorg wrote:

> But one for Hibernate is missing. So I created a User Specified entry
> URI:
>
file:C:path_to_the_DTDhibernate.sourceforge.nethibernate-con figuration-3.0.dtd
> Key Type: Public ID
> Key: -//Hibernate/Hibernate Mapping DTD 3.0//EN


> but now I get an error at Validation:

> "Referenced file contains errors
> (http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd). For more
> information, right click on the message and select "Show Details..." "

It's likely the case that the DTD you've registerd has references to other
DTD's that you have not registered. Often you need to copy entire
subtrees of DTD's into a directory any register at least the 'root' dtd in
our catalog.

Of course it would be nice if the XML Catalog would traverse all the links
in your DTD and prompt you to provide referenced files ... but that's an
feature request that no one has opened yet.. AFAIK.
Re: XML validation always downloads DTD/Schemas? [message #117730 is a reply to message #114824] Thu, 07 July 2005 16:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jens.ja-web.de

Craig Salter wrote:
> Jens Ansorg wrote:
>> file:C:path_to_the_DTDhibernate.sourceforge.nethibernate-con figuration-3.0.dtd
>>
>>
>> Key Type: Public ID
>> Key: -//Hibernate/Hibernate Mapping DTD 3.0//EN
>>
>> but now I get an error at Validation:
>
> It's likely the case that the DTD you've registerd has references to
> other DTD's that you have not registered. Often you need to copy entire
> subtrees of DTD's into a directory any register at least the 'root' dtd
> in our catalog.
>

not quite but close :)

Finally got around to look at the issue again. Turns out it's the stupid
user again :(

There are two types of hibernate xml files and two different DTDs.
I created an catalog entry for Mapping but pointed to the configuration
DTD. Once I realized and fixed that and created the second entry it
seems to work well now. No more internet access when doing a Validation
on a hibernate file


thanks
Jens
Re: XML validation always downloads DTD/Schemas? [message #123959 is a reply to message #114205] Thu, 21 July 2005 08:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Sebastian.Petzelberger.Aformatik.com

> When an XML file gets saved (or the project gets build) the XML (or all
> of them) get validated. This validation always takes quite some time and
> I note high network activity during that time. So I guess the validation
> process downloads schema information from the URLs provided in the files.

If I just open the xml-editor, eclipse goes to the internet for the dtd.

> But shouldn't the necessary DTD/XSD files be already on the local
> machine (XML Catalog) and used instead of always going online?

Shouldn't eclipse look at the jar files in the class path before looking
to the xml catalog? (When I put the dtd themselves in the classpath, it is
ok.)

I am using hibernate and my hibernate.cfg.xml starts with:
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
" http://hibernate.sourceforge.net/hibernate-configuration-3.0 .dtd">

The dtd's are in the hibernate3.jar in my classpath at the location
org.hibernate.

Is this a hibernate problem? Should the dtd's be at the root in the jar?
Re: XML validation always downloads DTD/Schemas? [message #124278 is a reply to message #123959] Thu, 21 July 2005 18:36 Go to previous messageGo to next message
Eclipse UserFriend
Sebastian Petzelberger wrote:
> Shouldn't eclipse look at the jar files in the class path before looking
> to the xml catalog? (When I put the dtd themselves in the classpath, it
> is ok.)
>
> I am using hibernate and my hibernate.cfg.xml starts with:
> <!DOCTYPE hibernate-configuration PUBLIC
> "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
> " http://hibernate.sourceforge.net/hibernate-configuration-3.0 .dtd">
>
> The dtd's are in the hibernate3.jar in my classpath at the location
> org.hibernate.
>
> Is this a hibernate problem? Should the dtd's be at the root in the jar?

No, the XML editor doesn't look into .jar files for DTD files
unless, maybe, you've opened an XML file from within a .jar file.
It has no knowledge of Java build paths nor directly how to deal
with .jar files at all. The DTD should be extracted from the .jar
files and added to the XML Catalog. If I understand the setup
properly, Hibernate should be encouraged to contribute their DTDs
into the XML Catalog as a feature of their plugins.

--
- Nitin
Re: XML validation always downloads DTD/Schemas? [message #124429 is a reply to message #124278] Thu, 21 July 2005 22:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bob.objfac.com

Why? Won't resolution follow a jar: URI?

Bob

Nitin Dahyabhai wrote:
> Sebastian Petzelberger wrote:
>
>> Shouldn't eclipse look at the jar files in the class path before
>> looking to the xml catalog? (When I put the dtd themselves in the
>> classpath, it is ok.)
>>
>> I am using hibernate and my hibernate.cfg.xml starts with:
>> <!DOCTYPE hibernate-configuration PUBLIC
>> "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
>> " http://hibernate.sourceforge.net/hibernate-configuration-3.0 .dtd">
>>
>> The dtd's are in the hibernate3.jar in my classpath at the location
>> org.hibernate.
>>
>> Is this a hibernate problem? Should the dtd's be at the root in the jar?
>
>
> No, the XML editor doesn't look into .jar files for DTD files unless,
> maybe, you've opened an XML file from within a .jar file. It has no
> knowledge of Java build paths nor directly how to deal with .jar files
> at all. The DTD should be extracted from the .jar files and added to
> the XML Catalog. If I understand the setup properly, Hibernate should
> be encouraged to contribute their DTDs into the XML Catalog as a feature
> of their plugins.
>
Re: XML validation always downloads DTD/Schemas? [message #124493 is a reply to message #124429] Fri, 22 July 2005 01:33 Go to previous messageGo to next message
Eclipse UserFriend
>>>
" http://hibernate.sourceforge.net/hibernate-configuration-3.0 .dtd">

Bob Foster wrote:
> Why? Won't resolution follow a jar: URI?

Well, actually yes, it will :) The editor doesn't distinguish it in
any way from the http: reference that Sebastian is using, though.
It might be found in the catalog, it might just connect to the URL
and get the DTD's contents automatically. It depends on how the
preferences have been set.

--
- Nitin
Re: XML validation always downloads DTD/Schemas? [message #124629 is a reply to message #124278] Fri, 22 July 2005 06:17 Go to previous message
Eclipse UserFriend
Originally posted by: Sebastian.Petzelberger.Aformatik.de

> No, the XML editor doesn't look into .jar files for DTD files
...
> It has no knowledge of Java build paths nor directly how to deal
> with .jar files at all.

The XML-Editor not, but the Java-Perspective does. The Java-Perspective
opens the XML-Editor with the XML file. Couldn't the Java-Perspective look
for the DTD and give it to the XML-Editor? Would this be a useful feature?

> The DTD should be extracted from the .jar
> files and added to the XML Catalog.

Yes, this works. And it is ok for me.
Previous Topic:How can I dev one struts web application use the WTP?
Next Topic:IWAB0014E Unexpected exception occured.java.lang.NoClassDefFoundError: javax/act
Goto Forum:
  


Current Time: Thu May 08 15:01:45 EDT 2025

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

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

Back to the top