Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Custom XML Validation on top of schema validation
Custom XML Validation on top of schema validation [message #173375] Thu, 06 July 2006 15:50 Go to next message
Brian Jakubik is currently offline Brian JakubikFriend
Messages: 140
Registered: July 2009
Senior Member
Im trying to implement custom validation, on top of the schema validation.

What WTP gives me out of the box is great (schema validation), but i want to
add on top of that specific things that the schema cannot catch (such as
presence/absence of certain tags when the parent has attributes set, ...)

I have the extension point org.eclipse.wst.validation.validator with
org.eclipse.wst.xml.core.internal.validation.core.Helper and my own run
class that basically ends up to the XMLValidator now, and it runs when the
file is saved.

Now I want to nix the XMLValidator and do my own thing here. My question is
this, what should I do from here, do I get a DOM and check the things from
that, Is there a way to extend the SAX parse to catch it, or something else
I dont know about... I have never used SAX before and am somewhat new to
the validation thing.

Hope all that makes sense.

I thank you for your suggestions.

Cheers
Brian J
Re: Custom XML Validation on top of schema validation [message #174152 is a reply to message #173375] Wed, 12 July 2006 17:47 Go to previous messageGo to next message
Lawrence Mandel is currently offline Lawrence MandelFriend
Messages: 486
Registered: July 2009
Senior Member
Hi Brian,

>Now I want to nix the XMLValidator and do my own thing here. My question
is
>this, what should I do from here, do I get a DOM and check the things
from
>that, Is there a way to extend the SAX parse to catch it, or something
else
>I dont know about... I have never used SAX before and am somewhat new to

>the validation thing.

You can use either method. Here is a simplified overview. DOM is useful if
you need to build the entire model before validating, as is the case with
WSDL. For example, if you want to check that references amoung elements
are correct. SAX is lighter weight than DOM and is useful if you want to
check the current element. For example, if you want to implement naming
convention checks where all you're checking is the name of the current
element.

You can find more information about DOM and SAX from the Xerces site [1]
and from the W3C [2].

[1] http://xerces.apache.org
[2] http://www.w3.org/DOM/

Lawrence
Re: Custom XML Validation on top of schema validation [message #174459 is a reply to message #174152] Fri, 14 July 2006 14:57 Go to previous message
Brian Jakubik is currently offline Brian JakubikFriend
Messages: 140
Registered: July 2009
Senior Member
Thanks Lawrence,
Here is what I ended up doing, my runtime side has rules validation that i
need, and I wanted to try to reuse that, I ahve my validator action ...
setup very similar to the XML validator, and instead of using the XML one, I
use mine and return the XMLValidationreport with my errors in it.

Works as I would like it to, although I am implementing and using some
internal/provisional classes, but it is experimanetal for now.

<lmandel@ca.ibm.com> wrote in message news:e93cjk$hqa$2@utils.eclipse.org...
> Hi Brian,
>
>>Now I want to nix the XMLValidator and do my own thing here. My question
> is
>>this, what should I do from here, do I get a DOM and check the things
> from
>>that, Is there a way to extend the SAX parse to catch it, or something
> else
>>I dont know about... I have never used SAX before and am somewhat new to
>
>>the validation thing.
>
> You can use either method. Here is a simplified overview. DOM is useful if
> you need to build the entire model before validating, as is the case with
> WSDL. For example, if you want to check that references amoung elements
> are correct. SAX is lighter weight than DOM and is useful if you want to
> check the current element. For example, if you want to implement naming
> convention checks where all you're checking is the name of the current
> element.
>
> You can find more information about DOM and SAX from the Xerces site [1]
> and from the W3C [2].
>
> [1] http://xerces.apache.org
> [2] http://www.w3.org/DOM/
>
> Lawrence
Previous Topic:What does WTP actually do at "Run at Server"-time?
Next Topic:How is a Dynamic web project deployed ?
Goto Forum:
  


Current Time: Thu Apr 18 00:16:21 GMT 2024

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

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

Back to the top