Hi Ed, That could happen if the parser threw an exception from parse before the Document node is created, for instance from an IOException thrown from an unsuccessful attempt to open the URL you specified. I don't see a try/catch block in your code snippet. Is the parser returning normally?
"Murphy, Ed" <[EMAIL PROTECTED]> wrote on 03/02/2005 05:54:26 PM: > Hi, > > I'm using the DOMParser with validation and I would like to be able to > validate the XML that I'm sucking in and parse what I can up to wherever an > error might occur. Currently, the document reference is coming back null. Is > this possible? > > I'm porting & enhancing some code so I'm not totally clear on what all the > settings below are doing and the various documentation I've scrounged > (sun.com, apache.org, etc.) haven't answered my question. All comments > welcome. > > Regards, > Ed > > Some technical stuff... > > String xmlDocument = "some_xml_file.xml"; > > DOMParser parser = new DOMParser(mySymbolTable, myGrammarPool) > parser.setFeature("http://xml.org/sax/features/namespaces", true); > parser.setFeature("http://xml.org/sax/features/validation", true); > parser.setFeature("http://apache.org/xml/features/validation/schema", true); > parser.setFeature("http://apache.org/xml/features/validation/schema-full-che > cking", true); > parser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage", > "http://www.w3.org/2001/XMLSchema"); > parser.parse(xmlDocument); > Document document = parser.getDocument(); > > This e-mail and any attachments are intended only for use by the > addressee(s) named herein and may contain legally privileged and/or > confidential information. If you are not the intended recipient of this > e-mail, you are hereby notified any dissemination, distribution or copying > of this email, and any attachments thereto, is strictly prohibited. If you > receive this email in error please immediately notify the sender and > permanently delete the original copy and any copy of any e-mail, and any > printout thereof. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > Michael Glavassevich XML Parser Development IBM Toronto Lab E-mail: [EMAIL PROTECTED] E-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]