Share via


Output for Example 1: Validating with noNamespaceSchemaLocation (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 nn-valid.xml  
=====================================  
<?xml version="1.0"?>  
<catalog>  
    <book xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'  
          xsi:noNamespaceSchemaLocation="nn.xsd"  
          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>  
</catalog>  
  
Validation failed on nn-notValid.xml  
====================================  
Reason: Element 'cost' is unexpected according to content model of parent element 'book'.  
  
Expecting: price.  
  
Source:       <cost>44.95</cost>  
Line: 8  

This is because the correct and valid name for the element in use at this location in the XML documents is <price/>, not <cost/>.