Tomáš Zato
Tomáš Zato

Reputation: 53338

How can I create anything in Visual Studio XML schema editor?

I'm trying to create schema file for my XML data format. I started by creating a xsd file:

new file dialog Visual Studio 2012

A GUI tab appeared with promising menu options:

image description

I'd like to define element and appropriate attribute names for my format. But if I click add, all I get is this:

visual studio xsd editor

I also tried to write element name in the text data:

xsd file

It's underlined and reports error. Nothing is added. So how should I add stuff in the schema?

Upvotes: 0

Views: 1151

Answers (1)

Michael Mainer
Michael Mainer

Reputation: 3475

Change <Generator></Generator> to <xs:element name="Generator"/> or <xs:element name="Generator"></Generator> if you have further definitions for the element. Element definitions need to be defined within the XMLSchema namespace.

I'm not much of a fan of the designer in VS. Without looking it up, you can right-click on an xsd in the Solutions Explorer and use Open With (or something like that), to get some options for opening the file. It should allow you to change the default editor for XML and XSD files.

Upvotes: 1

Related Questions