XSD Tutorials - Herong's Tutorial Examples - v5.23, by Herong Yang
XMLPad Crash When Validating Non-Conforming XML Documents
This section describes a failed test of validating a non-conforming XML document with the assigned XML Schema file (XSD), XMLPad Crashed.
In order to see how XMLPad handles multiple validation errors, let's add a new attribute to our invalid XML document, first_html_xsd_invalid.xml and try the validation function again.
1. Run XMLPad and click menu File > Open. Select c:\herong\first_html_xsd_invalid.xml in the "Open" dialog box. XMLPad displays the XML document in the edit window:
<?xml version="1.0" encoding="utf-8"?> <html xsi:noNamespaceSchemaLocation="file:///C:/herong/first_html.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <body> <p>My first HTML document in XML format.</p> </body> </html>
2. Add the "bgcolor" attribute inside the "body" element:
<?xml version="1.0" encoding="utf-8"?> <html xsi:noNamespaceSchemaLocation="file:///C:/herong/first_html.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <body bgcolor="#eeeeee"> <p>My first HTML document in XML format.</p> </body> </html>
3. Click menu XML > Validate. Surprisingly, XMLPad crashed with a Windows system error box: "Access violation at address 00A1C15E in module 'coreobj70.bpl'. Read of address 00000028".
4. Click OK to close the error message box, and save the modified XML document as \xsd\first_html_xsd_invalid_attribute.xml.
This version of XMLPad, "WMHelp XMLPad Version 3.0.1.0 Pro Edition, Build 11/13/2006" seems to has a serious code bug, if the XML document has an invalid XML attribute. Let's hope this bug will be fixed in the next release.
Good news, XMLPad 3.0.2.1 has fixed this bug now. 2 errors are displayed in the output area:
Table of Contents
►XML Editor and Schema Processor - XMLPad
Creating and Editing XML Documents
Creating and Editing XML Schema Documents
Assigning XML Schema to XML Documents
Validating XML Documents with Assigned XSD
Validating Non-Conforming XML Documents
►XMLPad Crash When Validating Non-Conforming XML Documents
Generating XML Schema Diagrams
Generating XML Schema Documentations
Java API for XML Processing - JAXP
JAXP - XML Schema (XSD) Validation
Xerces2 Java Parser - Java API of XML Parsers
Introduction of XSD Built-in Datatypes
"string" and Its Derived Datatypes
"decimal" and Its Derived Datatypes
"dateTime" and Its Related Datatypes
Miscellaneous Built-in Datatypes
Facets, Constraining Facets and Restriction Datatypes
"simpleType" - Defining Your Own Simple Datatypes
Identity-Constraints: unique, key and keyref
Assertion as Custom Validation Rules
XML Schema Location and Namespace in XML Documents
Overriding Element Types in XML Documents