You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xmlbeans.apache.org by "baisa, darwin" <da...@ips.invensys.com> on 2007/06/27 12:43:34 UTC

Validation Errors.

Can any one help me to get Validation errors when we validate a node or
file? The method validate() is giving whether the node is valid or not.
But I am unable to get the validation errors. When I validate a XML file
against a XSD using "validate.cmd" its giving detailed list errors. Is
there any way in API to get these lists of errors?

 

Regards,

Darwin Baisa

 




Confidentiality Notice:
The information contained in this electronic message and any attachment(s) to this message are intended for the exclusive use of the recipient(s) and may contain confidential, privileged or proprietary information. If you are not the intended recipient, please notify the sender immediately, delete all copies of this message and any attachment(s). Any other use of the E-Mail by you is prohibited.


Re: Validation Errors.

Posted by Jacob Danner <ja...@gmail.com>.
This is really more of a question for the user group so including that
list with this email.

To get error information on the validation errors you need to use an
XmlOptions with an errorListener set.
I think this is covered in the documentation, but just in case here is
a snippet of how you might do this.

List err = new LinkedList();
XmlOptions xo = XmlOptions().setErrorListener(err);
XmlObject.validate(xo);

The  err object  will now be populated if any valdation errors occured
then you can cast the list item  to an XmlError and get the same
information you saw using validate.cmd.

-Jacob Danner


On 6/27/07, baisa, darwin <da...@ips.invensys.com> wrote:
> Can any one help me to get Validation errors when we validate a node or
> file? The method validate() is giving whether the node is valid or not.
> But I am unable to get the validation errors. When I validate a XML file
> against a XSD using "validate.cmd" its giving detailed list errors. Is
> there any way in API to get these lists of errors?
>
>
>
> Regards,
>
> Darwin Baisa
>
>
>
>
>
>
> Confidentiality Notice:
> The information contained in this electronic message and any attachment(s)
> to this message are intended for the exclusive use of the recipient(s) and
> may contain confidential, privileged or proprietary information. If you are
> not the intended recipient, please notify the sender immediately, delete all
> copies of this message and any attachment(s). Any other use of the E-Mail by
> you is prohibited.
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


Re: Validation Errors.

Posted by Jacob Danner <ja...@gmail.com>.
This is really more of a question for the user group so including that
list with this email.

To get error information on the validation errors you need to use an
XmlOptions with an errorListener set.
I think this is covered in the documentation, but just in case here is
a snippet of how you might do this.

List err = new LinkedList();
XmlOptions xo = XmlOptions().setErrorListener(err);
XmlObject.validate(xo);

The  err object  will now be populated if any valdation errors occured
then you can cast the list item  to an XmlError and get the same
information you saw using validate.cmd.

-Jacob Danner


On 6/27/07, baisa, darwin <da...@ips.invensys.com> wrote:
> Can any one help me to get Validation errors when we validate a node or
> file? The method validate() is giving whether the node is valid or not.
> But I am unable to get the validation errors. When I validate a XML file
> against a XSD using "validate.cmd" its giving detailed list errors. Is
> there any way in API to get these lists of errors?
>
>
>
> Regards,
>
> Darwin Baisa
>
>
>
>
>
>
> Confidentiality Notice:
> The information contained in this electronic message and any attachment(s)
> to this message are intended for the exclusive use of the recipient(s) and
> may contain confidential, privileged or proprietary information. If you are
> not the intended recipient, please notify the sender immediately, delete all
> copies of this message and any attachment(s). Any other use of the E-Mail by
> you is prohibited.
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org