Validate XML fragment against XML Schema XSD
Hello,
I'm not able to find solution to this problem:
I have XML document (lets say doc.xml) and it's schema (doc.xsd). doc.xml consist of elements (XML fragment) that represents templates, that are to be edited by user in raw form (user edits pure XML - tags, attributes, etc). And after user has made the changes I want to validate this element (XML fragment) against the schema, but I have the schema only for whole document,NOT particular elements of document.
I've tried standard way through JAXP and some other approaches but every time I've run into same problem: API allows me to validate only against the schema, that specifies the root element the same as root element in myXML fragment. In other word if I want to validate XML fragments then I have to have schema file foreach fragment even if I have schema file forwhole document which theXML fragmentare part of.
Have you any idea how to solve this?
Kind regards
goerge
PS: Sorry for my English :)

