Bogdan Verbenets
Bogdan Verbenets

Reputation: 26936

how to import a schema to a XML file

How do you import an XML schema from a *.xsd file to an XML file? What instructions should you use? When I write something like:

<xs:schema xmlns:xs="http://schemas.microsoft.com/wix/2006/wi">
        <xs:include schemaLocation="wix.xsd"/>
</xs:schema>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"></Wix>

then I get "the document can't contain multiple root elements"

Upvotes: 0

Views: 1919

Answers (2)

Michael Kay
Michael Kay

Reputation: 163262

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
  xsi:schemaLocation="http://schemas.microsoft.com/wix/2006/wi wix.xsd"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>

Upvotes: 1

dogbane
dogbane

Reputation: 274522

Use an import or include.

Upvotes: 2

Related Questions