You need to call validate if you want to validate the XML that was
processed. If you don't want to validate, don't call it.
The javadoc gives a good example of how to find the errors.
I think it's a common to expect that you'd set an option ahead of time
and expect it to be validated when it's parsed, however that's not how
it works.
Let us know if it works.
Brian
Chandra, Mani wrote:
Rajiv & Brain,
Thanks for your responses.
I am not calling validate(XmlOptions).
I expect it to be validated when I call
RootElementDocumentFactory.parse(InputStream).
Why should I explicitly call validate ()?
Did I understand right?
Thanks,
Mani
------------------------------------------------------------------------
*From:* Rajiv Balachandran [mailto:[EMAIL PROTECTED]
*Sent:* Wednesday, June 01, 2005 6:49 PM
*To:* [email protected]
*Subject:* RE: Unique Constraint
Hi Mani,
It would be helpful to see the entire schema that you have to see why
this is happening. XmlBeans does have some JUnit tests cases for the
unique constraint. These gives a good idea of the usage. You will need
to check out the svn sources for this. The test schema can be found at
svnroot\test\cases\xbean\scomp\idConstraints\Constraint.xsd and Junit
cases can be found at
svnroot\test\src\scomp\idConstraint\detailed\KeyKeyref.java
(testUnique(),testUniqueIllegal1(),testUniqueIllegal2()).
Hope this helps.
Rajiv
------------------------------------------------------------------------
*From:* Chandra, Mani [mailto:[EMAIL PROTECTED]
*Sent:* Wednesday, June 01, 2005 2:17 PM
*To:* '[email protected]'
*Subject:* Unique Constraint
Hi All,
I have defined a UNIQUE constraint for my schema and the constraint is
not validated when I parse the XML.
Any light on this?
<xs:unique name="mykey">
<xs:selector xpath="Item"/>
<xs:field xpath="item"/>
</xs:unique>
Thanks & Regards,
Mani
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]