Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This topic shows the expected output for the following examples:
Example 1: Validating with noNamespaceSchemaLocation (JScript)
Example 1: Validating with noNamespaceSchemaLocation (Visual Basic)
Example 1: Validating with noNamespaceSchemaLocation (C/C++)
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/>
.