Working With XML Schemas
See Also
Like DTDs, XML schemas specify the valid grammar of an XML document. Schemas
have several advantages over DTDs, such as better extensibility, support
of namespaces and data types, and an XML code base. In the IDE, you can create
XML schemas and edit them in the Source Editor. You can also use schemas as
XML document constraints and validate your XML documents against them.
To create an XML schema:
- From the main window, choose File > New
File.
- Expand the XML folder and select XML Schema.
- Specify a name and location for the file and click Finish.
A new XML schema node (
)
is created in the Files window.
To edit an XML schema:
- Right-click the XML schema node in the Files window.
- Choose Edit from the pop-up menu.
The schema is displayed in the Source Editor.
To validate an XML schema:
- Right-click the schema in the Files window.
- Choose Validate XML Schema.
To reference an XML schema in an XML document:
- Add the following to the XML document's root element:
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation= "schema location"
- See Also
- Validating an XML Document
- Editing an XML Document
- Creating a DTD
- About XML Schema Tools
Legal Notices