Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Authoring and Using Custom Schemas Backgrounder

Visual Studio .NET 2003

To add and support a new value for the targetSchema property, you need to create a new markup language schema (.xsd) file. It might be useful to copy an existing .xsd file from one of the default folders for schemas available to all Visual Studio .NET projects:

...\Common7\Packages\schemas\html
...\Common7\Packages\schemas\xml

To configure a new markup language schema, add an .xsd file to your active project and open it for editing in the Schema Designer. Insert vs: schema annotations as needed to define how the Visual Studio Integrated Development Environment (IDE) will automatically complete and validate the markup for an element. For more information about creating .xsd schema files, see the following topics:

In this new schema, you will define each element and property of the markup language, and describe valid markup structures; that is, the possible combinations of elements and attributes that are permitted within this version of the language. For more information about designing markup language schemas, see the following topics:

You will need to store your custom schema document in a location where Visual Studio .NET can find it. Save the .xsd schema file in your active project folder (for use by that one project), or in the Visual Studio .NET default folder for schemas (for use by any project). To use your new schema, open an HTML or XML document for editing and set its targetSchema property to the name of your new schema.

Note   The targetSchema property specifies the targetNamespace URI of the schema. In an HTML or Web Form document, this adds a <meta> element. In an XML file, setting this property adds an xmlns attribute to the root element. In an ASP .NET user control, this adds a targetSchema attribute to the directive. For more information, see targetSchema Property and Setting the targetSchema Property of an HTML Document.

For further background on schemas, see:

  • Introduction to XML Schemas
  • MSDN Online XML Developer Center (http://msdn.microsoft.com/xml)
  • World Wide Web Consortium (W3C) Web site (http://www.w3.org/)

For more information on using schemas, see the following topics:

Visual Studio .NET may include additional HTML and XML schemas in future releases. For more information, select Check for Updates from the Visual Studio .NET Help menu.

See Also

HTML and XML Schema Extensibility | Creating Scripts and Editing Event Handlers in HTML Designer

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.