Hi Vijay BTW Vijar, could you CC the list for archive purposes, others may experience similar problems as yours.
----- Original Message ----- From: "vijay" <[EMAIL PROTECTED]> > Dear Sir, > Thanks.I got the reason for that by ur help. As u said it was > because of the type B problem. > Here i am facing another problem.Actually i have defined constraints for > uniqueness and ID in the schema.But my program is not validating for that > while it works when i check my XML file through XML-SPY editor. >Dear Sir > suggest me how i can check ID and Uniqueness using DOM4j. I'm not totally sure I understand your question - is it that the Xerces validation isn't working at all or that the validation isn't correct? Are you trying to validate uniqueness and ID relationships using XML Schema? Just for the record, what version of Xerces are you using? Right now there are 2 main ways to validate using XML Schema... a) Use a recent version of Xerces. Then if you find any problems with Xerces not correctly validating your XML Schema instance document, try mailing the xerces list. b) try using Sun's Multi Schema Validator library (MSV). There's a sample program of it in use in dom4j/src/samples/validate/MSVDemo.java James > > > Waiting for ur response. > > > Vijay Gupta > > > > > > > > > > -----Original Message----- > From: James Strachan [mailto:[EMAIL PROTECTED]] > Sent: Monday, October 15, 2001 2:53 AM > To: vijay > Cc: [EMAIL PROTECTED] > Subject: Re: want ur help > > > Hi Vijay > > Without a stack trace of the exception I can't be absolutely certain but I > suspect the problem is either > > a) you don't have a recent xerces.jar on your classpath; support for XML > Schema is fairly recent, so version 1.4.2 or later should do. Might as well > try the latest version available. > > b) you have a version of crimson.jar in your classpath, in front of > xerces.jar. > > To tell whether its a) or b), the stack trace should help - if the not > recognised exception comes from org.apache.crimson package then its b) else > its probably a). > > James > ----- Original Message ----- > From: "vijay" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Monday, October 15, 2001 6:22 PM > Subject: want ur help > > > > Dear Sir, > > > > > > I am getting the exception > > > > org.xm..sax.SAXNotRecognizedException : Property: > > > http://apache.org/xml/properties/schema/external-noNamespaceSchemaLoaction' > > > > during the execution of a java code that vaildates an xml file against a > > schema using dom4j. > > > > Pls help me out from this problem. > > Here i am also pasting the source code.. > > > > > > import AbstractDemo; > > > > import org.dom4j.Document; > > import org.dom4j.Element; > > import org.dom4j.io.OutputFormat; > > import org.dom4j.io.SAXReader; > > import org.dom4j.io.XMLWriter; > > import org.dom4j.util.XMLErrorHandler; > > > > import org.xml.sax.ErrorHandler; > > import org.xml.sax.SAXParseException; > > > > /** Validates a document using Xerces and an XML Schema. > > */ > > > > public class XercesDemo extends AbstractDemo { > > > > public static void main(String[] args) { > > run( new XercesDemo(), args ); > > } > > > > public XercesDemo() { > > } > > > > public void run(String[] args) throws Exception { > > if ( args.length < 1) { > > printUsage( "no XML document URL specified" ); > > return; > > } > > > > parse( args[0] ); > > } > > > > protected Document parse(String uri) throws Exception { > > SAXReader reader = new SAXReader(); > > > > reader.setValidation(true); > > > > // specify the schema to use > > reader.setProperty( > > > > > "http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation" > > , "personal.xsd"); > > > > // add an error handler which turns any errors into XML > > XMLErrorHandler errorHandler = new XMLErrorHandler(); > > reader.setErrorHandler( errorHandler ); > > > > // now lets parse the document > > Document document = reader.read(uri); > > > > // now lets output the errors as XML > > XMLWriter writer = new XMLWriter( > > OutputFormat.createPrettyPrint() ); > > writer.write( errorHandler.getErrors() ); > > > > return document; > > } > > } > > > > > > Waitnig for response. > > > > > > Vijay Gupta > > > _________________________________________________________ > Do You Yahoo!? > Get your free @yahoo.com address at http://mail.yahoo.com > _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com _______________________________________________ dom4j-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/dom4j-user
