I know of a work-around. If the element is global, you can create a new copy of that element and its child elements by using importNode and then append the new copy to a new document which you can validate.
If the element is locally defined, then I think that validation is meaningless because the local element has no meaning without its context. Take my words with caution though. I am not an XML Schema expert. Alex Quoting Jos van den Oever <[EMAIL PROTECTED]>: > Hello Ramin, > > I have to deal with XML Schema's that are defined elsewhere. > > Imagine a document with two required elements <a/> and <b/>. I don't > have <a/> but only <b/>. Now I want to now if <b/> is valid, even > though the complete document is not valid, because <a/> lacks. > > If XSModel wasn't readonly, I could make a ripped version of a given > Schema and use that for validation. It wouldn't be very > straightforward though. > > Cheers, Jos > > On Fri, 19 Nov 2004 12:03:16 -0500, [EMAIL PROTECTED] > <[EMAIL PROTECTED]> wrote: > > > > In your XML schema, just define the rule for that one element. > > > > Cheers, > > -ramin > > > > > > > > > > > > > > "Jos van den Oever" <[EMAIL PROTECTED]> > > > > 11/19/2004 11:59 AM > > > > Please respond to > > [EMAIL PROTECTED]; Please respond to > > "Jos van den Oever" <[EMAIL PROTECTED]> > > > > > > To [EMAIL PROTECTED] > > > > cc > > > > Subject validate a single element > > > > > > > > > > > > > > > > Hello all, > > > > Is it possible to validate only parts of an XML document with Xerces? This > > > would be useful in Web Services were data typing is done by specifying XML > > > Schema single types or elements. > > > > Cheers, Jos > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]