It shows how to refer to the XML Schema from the instance document.
You used the XML Schema to determine whether your instance document was schema valid.
File: Schema.xsd
<?xml version="1.0"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:target="http://www.java2java.com/name"
targetNamespace="http://www.java2java.com/name"
elementFormDefault="qualified">
<element name="name">
<complexType>
<sequence>
<element name="first" type="string" />
<element name="middle" type="string" />
<element name="last" type="string" />
</sequence>
<attribute name="title" type="string" />
</complexType>
</element>
</schema>
File: Data.xsl
<?xml version="1.0"?>
<name xmlns="http://www.java2java.com/name"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.java2java.com/name name5.xsd"
title="Mr.">
<first>John</first>
<middle>Joh</middle>
<last>Doe</last>
</name>
|