Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » XML Validations show only in editor area
XML Validations show only in editor area [message #185307] Wed, 20 December 2006 12:19 Go to next message
Eclipse UserFriend
Originally posted by: ndoikov.curamsoftware.com

Hi,

We are using the StructuredTextEditor to display XML content. The
StructuredTextEditor is embedded in a MultiPageEditor. It all works fine and
validations performed by the org.eclipse.wst.xml.core plug-in also work
fine. However, the validation errors are displayed in the editor area only.

Is there an easy and straightforward way to make org.eclipse.wst.xml.core
plug-in to display validation errors in the Problems View as well?

Thanks,
Nikolai
Re: XML Validations show only in editor area [message #185325 is a reply to message #185307] Wed, 20 December 2006 19:11 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: valentinbaciu.hotmail.com

Hi Nikolai,

There are two distinct phases of validation for XML: as-you-type and
manual/build. The first one is invoked when you type in the editor and the
second when you select validate from a file's context menu or automatically
on resource changes if the validation builder is added to a project. If you
use a dynamic web project the validation builder is added to your project on
creation. If you use a simple project (no nature) you can add the builder
using the project's properties page.

For XML, both validation phases make use of the same validation code invoked
by different frameworks. The as-you-type source annotations are produced by
a source validator delegate controlled by notifications from the editor.The
validation errors that show up in the problems view are produced by a
validator registered with the WTP validation framework. Unlike the source
(as-you-type) validation, the manual/build validators are not selected based
on content type, but rather by using a file's extension. For an example,
have a look at the validator registered by the org.eclipse.wst.xml.core
plugin. The extension point for this type of validator is
org.eclipse.wst.validation.validator.

Back to your scenario now: is your XML content saved in a file with an
extension other than XML? In that case I think you can try registering a
validator similar to the XML one, target it to know about your file
extension and either re-using or extending the XML validator code.

I hope this helps.

Regards,
Valentin

"Nikolai Doikov" <ndoikov@curamsoftware.com> wrote in message
news:emb9or$n3h$1@utils.eclipse.org...
> Hi,
>
> We are using the StructuredTextEditor to display XML content. The
> StructuredTextEditor is embedded in a MultiPageEditor. It all works fine
> and validations performed by the org.eclipse.wst.xml.core plug-in also
> work fine. However, the validation errors are displayed in the editor area
> only.
>
> Is there an easy and straightforward way to make org.eclipse.wst.xml.core
> plug-in to display validation errors in the Problems View as well?
>
> Thanks,
> Nikolai
>
Re: XML Validations show only in editor area [message #185365 is a reply to message #185325] Thu, 21 December 2006 14:56 Go to previous message
Eclipse UserFriend
Originally posted by: ndoikov.curamsoftware.com

Hi Valentin,

Thanks very much for the information. It helped a lot.

Yes, I use different file extensions, not .xml. Following your suggestion I
registered a validator for my file extensions, using the
org.eclipse.wst.validation.validator extension point. I used the Validator
class from org.eclipse.wst.xml.core plug-in. Everything worked fine. I got
the build validation errors displayed in the Problems View together with the
as-you-type errors in the editor area.

Next step is to put a wrapper around the Validator class as I need to
perform some additional validations as well.

Thanks,
Nikolai



"Valentin Baciu" <valentinbaciu@hotmail.com> wrote in message
news:emc1t1$816$1@utils.eclipse.org...
> Hi Nikolai,
>
> There are two distinct phases of validation for XML: as-you-type and
> manual/build. The first one is invoked when you type in the editor and the
> second when you select validate from a file's context menu or
> automatically on resource changes if the validation builder is added to a
> project. If you use a dynamic web project the validation builder is added
> to your project on creation. If you use a simple project (no nature) you
> can add the builder using the project's properties page.
>
> For XML, both validation phases make use of the same validation code
> invoked by different frameworks. The as-you-type source annotations are
> produced by a source validator delegate controlled by notifications from
> the editor.The validation errors that show up in the problems view are
> produced by a validator registered with the WTP validation framework.
> Unlike the source (as-you-type) validation, the manual/build validators
> are not selected based on content type, but rather by using a file's
> extension. For an example, have a look at the validator registered by the
> org.eclipse.wst.xml.core plugin. The extension point for this type of
> validator is org.eclipse.wst.validation.validator.
>
> Back to your scenario now: is your XML content saved in a file with an
> extension other than XML? In that case I think you can try registering a
> validator similar to the XML one, target it to know about your file
> extension and either re-using or extending the XML validator code.
>
> I hope this helps.
>
> Regards,
> Valentin
>
> "Nikolai Doikov" <ndoikov@curamsoftware.com> wrote in message
> news:emb9or$n3h$1@utils.eclipse.org...
>> Hi,
>>
>> We are using the StructuredTextEditor to display XML content. The
>> StructuredTextEditor is embedded in a MultiPageEditor. It all works fine
>> and validations performed by the org.eclipse.wst.xml.core plug-in also
>> work fine. However, the validation errors are displayed in the editor
>> area only.
>>
>> Is there an easy and straightforward way to make org.eclipse.wst.xml.core
>> plug-in to display validation errors in the Problems View as well?
>>
>> Thanks,
>> Nikolai
>>
>
>
Previous Topic:Tomcat in SLL mode
Next Topic:API to launch JSP wizard
Goto Forum:
  


Current Time: Tue Apr 16 07:18:57 GMT 2024

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

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

Back to the top