You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Nithya <ni...@india.hp.com> on 2004/03/12 05:30:35 UTC

problem in validating

Hi
I am a new member to this group and also am new to schema validation. I have
the following problem in my code.

I am using xerces 2.4

I have attached Test.xml, Product.xsd and XMLTest1.java.

The code compiles fine and the SOP of the root element is also displayed
fine. But i guess no validation is done because even if i modify the tag
names in Test.xml, no error is reported.

Please help at the earliest!!

Thanks
nithya



Re: problem in validating

Posted by Nithya <ni...@india.hp.com>.
hi

Thanks for your reply.. 
I did both the steps that you had mentioned. 

I changed the "Books" tag in the Test.xml to "Books1" but there was no error reported. 

Please let me know if i am missing something. How is the error during validation reported? 
Also which version of xerces.jar do i use?

nithya
  ----- Original Message ----- 
  From: purushotham 
  To: xerces-j-user@xml.apache.org 
  Sent: Friday, March 12, 2004 11:08 AM
  Subject: Re: problem in validating


  Hi,

  In xsd file add 
   elementFormDefault="qualified" to schema tag.

  in Java file uncomment

      domBuilder.setFeature("http://xml.org/sax/features/validation",true);

  It should work fine...


  Since you have target namespace you must by default you want the element in instance to be assigned to this target space. 


  Purushotham


  Nithya <ni...@india.hp.com> wrote:
    Hi
    I am a new member to this group and also am new to schema validation. I have
    the following problem in my code.

    I am using xerces 2.4

    I have attached Test.xml, Product.xsd and XMLTest1.java.

    The code compiles fine and the SOP of the root element is also displayed
    fine. But i guess no validation is done because even if i modify the tag
    names in Test.xml, no error is reported.

    Please help at the earliest!!

    Thanks
    nithya












    Shakespeare
    0517053616



    Donald Trump
    05146553616






























    > ATTACHMENT part 4 java/* name=XMLTest1.java
    ---------------------------------------------------------------------
    To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
    For additional commands, e-mail: xerces-j-user-help@xml.apache.org


------------------------------------------------------------------------------
  Do you Yahoo!?
  Yahoo! Search - Find what you're looking for faster.

Re: problem in validating

Posted by purushotham <pu...@yahoo.com>.
Hi,
 
In xsd file add 
 elementFormDefault="qualified" to schema tag.
 
in Java file uncomment
 
    domBuilder.setFeature("http://xml.org/sax/features/validation",true);

It should work fine...
 
 
Since you have target namespace you must by default you want the element in instance to be assigned to this target space. 
 
 
Purushotham


Nithya <ni...@india.hp.com> wrote:
Hi
I am a new member to this group and also am new to schema validation. I have
the following problem in my code.

I am using xerces 2.4

I have attached Test.xml, Product.xsd and XMLTest1.java.

The code compiles fine and the SOP of the root element is also displayed
fine. But i guess no validation is done because even if i modify the tag
names in Test.xml, no error is reported.

Please help at the earliest!!

Thanks
nithya













Shakespeare
0517053616



Donald Trump
05146553616































> ATTACHMENT part 4 java/* name=XMLTest1.java
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org

---------------------------------
Do you Yahoo!?
Yahoo! Search - Find what you�re looking for faster.