This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
I am attempting to do basic schema-validation of xml data using a DOMParser, (latest Apache). I am using an InputSource wrapping a byte full of XML data, i.e. not an XML file. When validation is turned OFF, the parser is happy and parses the data fine. But when trying to validate the data, the parser always throws the SAXExceptions "Document is invalid: no grammar found." and "Document root element "transmittal", must match DOCTYPE root "null". ...implying to me that it cannot locate either the schema schema or the instance schema The root node attributes in the XML data are: <rootNodeName xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="rootNodeName.xsd"> I have tried every form for specifying the noNamespaceSchemaLocation that I can think of... For example: - fully qualified path - "file:rootNodeName.xsd" - setting the systemId (of the InputSource) to the base path of the schema file location - ??? Any ideas on how I have to specify this information? TIA jr