That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. Copyright © 1993, 2017, Oracle and/or its affiliates. But I can't figure out the "no namespace in the XML file" situation (other than rewriting the XMLfile to include an xmlns: attribute at the root, but that's too ugly to think about).
In the earlier tutorials we saw how to build a JDOM2 document using SAXBuilder. Now lets look at an example that shows how to specify an XSD externally. But I can't figure out the "no namespace in the XML file" situation (other than rewriting the XML file to include an xmlns: attribute at the root, but that's too ugly to think about). Stripping out all the specific namespace references in the XSD file, and then using String.I tried, among many other things: File Stream xsd Stream = File. Empty as the target namespace in the code, lets me validate "unqualified" XML files.And also, this is NOT correct: "If you just need to check if XML file is well formed, successful loading into XMLReader object is usually enough." It is not enough.Pull parsers operate on stream and if you have a large enough file they will not know it is well formed until it is read to the end.Open Read(schema File); Xml Text Reader xsd TR = new Xml Text Reader(xsd Stream); Xml Schema Collection schema Coll = new Xml Schema Collection();schema Coll. Open Read(file Name); Xml Text Reader xml TR = new Xml Text Reader(xml Stream); Xml Validating Reader xml Reader = new Xml Validating Reader(xml TR);xml Reader.