You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Srikanth Vedire <Sr...@email.mot.com> on 2001/09/18 18:36:42 UTC

validation with schema

Hello All,

I'm trying to see the validation capabilities of the parser. I'm running
DOMPrint -s personal-schema.xml
personal-schema.xml is a sample xml file provided as part of the release
and it has a schema defined with it.

The element "name" has an attribute called "salary" which is an integer.
So I modified one of the lines in the personal-schema.xml such that the
salary is non-integer like:
--  <person id="one.worker" salary="AAA">

So when I run the DOMPrint, it doesn't complain about the modified
attribute.

I even deleted the person's required attribute of "id" from the xml file
and the parser still doesn't complain.

Since I'm new to XML, I'm not sure if I'm doing something wrong or if
the executable is not actually doing any schema validation.

I haven't changed any code from the xerces release (1.5.1 version).

Thanks in advance,
Srikanth



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


Re: validation with schema

Posted by Khaled Noaman <kn...@ca.ibm.com>.
You need to run the parser with namespace enabled (-n option).

Khaled

fsv003@shemp.ftw.paging.mot.com wrote:

> Hello All,
>
> I'm trying to see the validation capabilities of the parser. I'm running
> DOMPrint -s personal-schema.xml
> personal-schema.xml is a sample xml file provided as part of the release
> and it has a schema defined with it.
>
> The element "name" has an attribute called "salary" which is an integer.
> So I modified one of the lines in the personal-schema.xml such that the
> salary is non-integer like:
> --  <person id="one.worker" salary="AAA">
>
> So when I run the DOMPrint, it doesn't complain about the modified
> attribute.
>
> I even deleted the person's required attribute of "id" from the xml file
> and the parser still doesn't complain.
>
> Since I'm new to XML, I'm not sure if I'm doing something wrong or if
> the executable is not actually doing any schema validation.
>
> I haven't changed any code from the xerces release (1.5.1 version).
>
> Thanks in advance,
> Srikanth
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


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