xml : how to reference a .xsd file at .xml file?

Viewed 76991

I want to see xml file in browser as I define in .xsd file. Please check the following two files for me and point out what do I need to do. These two files are under same folder.

employee.xml

 <?xml version="1.0"?>

<employee xmlns="http://www.w3schools.com" 
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
          xsi:schemaLocation="employee.xsd">

  <firstname>John</firstname>
  <lastname>Smith</lastname>
</employee>

employee.xsd

<xs:element name="employee">
  <xs:complexType>
    <xs:sequence>
      <xs:element name="firstname" type="xs:string" fixed="red" />
      <xs:element name="lastname" type="xs:string"/>
    </xs:sequence>
  </xs:complexType>
</xs:element>
1 Answers
Related