Skip to main content

xml validating

1 reply [Last post]
anishreddy249
Offline
Joined: 2010-09-04
Points: 0

i am developing a business component of xml and in java by using jaxp.
In which i want to validate an xml with schema

i have written a method which take xml file as a param and schema name as a param and i have done validation of xml based on schema.if xml document violates any rules
iam throwing exception related to violation.

But my problem is suppose i pass an xml which contains schema,but i pass other schema .Then it is validating according to that schema and iam throwing exception.

But i should get result as schema can not be found.

can any one give inputs/idea/ to resolve this issue

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
derari
Offline
Joined: 2010-06-10
Points: 0

A bit of code would be helpfull. How are you validating?
I guess the validator assumes that the schema you provide is just the right one for the xml file and does not further check this.