Output for Example 3: Validating with XMLSchemaCache (C-C++)
This topic shows the expected output for the following examples:
When you build and run any of these examples, their output should appear as follows:
Validation succeeded for sc-valid.xml
======================
<?xml version="1.0"?>
<x:catalog xmlns:x="urn:books">
<book id="bk101">
<author>Gambardella, Matthew</author>
<title>XML Developer's Guide</title>
<genre>Computer</genre>
<price>44.95</price>
<publish_date>2000-10-01</publish_date>
<description>An in-depth look at creating applications
with XML.</description>
</book>
</x:catalog>
Validation failed on sc-notValid.xml
=====================
Reason: Element 'cost' is unexpected according to content model of parent elemen
t 'book'.
Expecting: price.
Source: <cost>44.95</cost>
Line: 7
This is because the correct and valid name for the element in use at this location in the XML documents is <price/>
, not <cost/>
.