Hello,
Here is what Bryan Hogan wrote sometime back:
VA contains only rudimentary support for validation of XML documents against a schema. The primary goal of the schema support in VAST was to enable support for Web services. The Web services support uses XML schemas to map incoming XML data into corresponding Smalltalk objects. Some validation occurs as part of this mapping, but full schema validation is not supported.
. . . I had a simple example but it does not work but shows the basic idea. The schema file is (address-schema.xsd):
- Code: Select all
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="fullName" type="xs:string"/>
</xs:schema>
. . . and the xml file is (addressdoc.xml):
- Code: Select all
<?xml version="1.0"?>
<fullName xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="address-schema.xsd">Scott</fullName>
. . . the st code is:
- Code: Select all
| parser |
parser := AbtXmlDOMParser newValidatingParser.
parser parseURI: 'C:\temp\addressdoc.xml'
. . . however, the parser will throw an exception and a 'AbtXmlDOMParser newNonValidatingParser' will always parse it as being correct.
--tc