Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Associate Schema with XML 1

Status
Not open for further replies.

rac2

Programmer
Joined
Apr 26, 2001
Messages
1,871
Location
US
How do you associate the schema file with the xml file?

The xml file named surveyCA.xml -

Code:
<?xml version=&quot;1.0&quot; ?>
<ozsurvey>
  <state>California Collections of Baum and Oz</state>
   . 
   . 
   .
</ozsurvey>

The schema file named ozsurvey.xsd -
Code:
<?xml version=&quot;1.0&quot;?>
<schema xmlns=&quot;[URL unfurl="true"]http://www.w3.org/2001/XMLSchema&quot;[/URL]
        xmlns:xsi=&quot;[URL unfurl="true"]http://www.w3.org/2001/XMLSchema-instance&quot;>[/URL]

<element name=&quot;ozsurvey&quot;>
  <complexType content=&quot;elementOnly&quot;>
    <sequence>
     . 
     . 
     .
    </sequence>
  </complexType>
</element>

</schema>
 
You should use the <xsd:include> statament like:
<?xml version=&quot;1.0&quot; ?>
<xsd:include schemaLocation=&quot;ozsurvey.xsd&quot;/>
<ozsurvey>
<state>California Collections of Baum and Oz</state>
.
.
.
</ozsurvey>
[red]Nosferatu[/red]
We are what we eat...
There's no such thing as free meal...
once stated: methane@personal.ro
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top