Hi Mukul, On Thu, Jun 11, 2009 at 3:35 PM, Mukul Gandhi <[email protected]>wrote:
> Hi Hiranya, > I think, an easy way to do this is to try building an XSModel > pragmatically. > > Here is a sample code fragment which does this: > > XSLoaderImpl xsLoader = new XSLoaderImpl(); > XSModel xsModel = xsLoader.loadURI(xsdUri); This approach seems to be working. It logs error messages when the XSD is invalid. But how do I know if something went wrong at Java code level? Is there any return value or exception that I could capture in my code? Thanks, Hiranya > > We can't build an XSModel, from an invalid XML Schema document. The > call, loadURI would give an error in case of invalid Schema documents. > > On Thu, Jun 11, 2009 at 2:36 PM, Hiranya > Jayathilaka<[email protected]> wrote: > > Hi Folks, > > > > I would like to know how I can validate an XML schema (1.0) document > using > > Xerces2. I want to validate a given XML schema document against the > schema > > for schemas programmatically. Can somebody please provide me the > > instructions on the right way to do this in Java? A pointer to a sample > code > > fragment is most appreciated. > > > > Also can somebody tell me whether validating a schema causes any imported > > schema documents to be validated? > > > > Thanks, > > Hiranya > > > > -- > > Hiranya Jayathilaka > > Software Engineer; > > WSO2 Inc.; http://wso2.org > > E-mail: [email protected]; Mobile: +94 77 633 3491 > > Blog: http://techfeast-hiranya.blogspot.com > > > -- > Regards, > Mukul Gandhi > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > -- Hiranya Jayathilaka Software Engineer; WSO2 Inc.; http://wso2.org E-mail: [email protected]; Mobile: +94 77 633 3491 Blog: http://techfeast-hiranya.blogspot.com
