Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I would assume that in the first scenario you've entered the <code>&lt;</code> between the <code>&lt;xs:schema&gt;</code> and <code>&lt;/xs:schema&gt;</code> tags, since for e.g. would only be valid inside the document element content.</p> <p>Since <code>xs</code> prefix is not bound to any namespace, or in general one namespace for which VS does not have the XSD, the Intellisense processor doesn't really know what to suggest beyond what's expected in any XML; hence, the 3 things you see.</p> <p>When you type <code>&lt;</code> above the <code>&lt;xs:schema&gt;</code>, the editor is not constrained by a context (as previously given by <code>&lt;xs:schema&gt;</code>), so VS goes through all the loaded XSDs for that document (<code>foo.xsd</code> being one of them) and gives you, in addition to the XML defaults, all the <strong>global elements</strong> found in <code>foo.xsd</code>; hence the more things you see.</p> <p>I think that the confusion is increased by what seems to be a convenience the VS editor provides in that it associates the XML namespace URI with an actual XSD location. This is cool, but not standard. In the design of XML namespaces, there is no relationship between the value of an XML namespace URI and the XML Schema location which targets the same XML namespace. In other words, having declared a (default) XML namespace in the form of:</p> <p><code>xmlns="C:\Users\Win7Guru\Documents\Visual Studio 2012\Projects\foo.xsd"</code></p> <p>there is no standard specification which would instruct a processor to consistently look up a schema for that namespace, using the namespace value itself.</p> <p>While many consider good practice to have a namespace URI as an URL that resolves to an actual resource on the Internet, many others would prefer the use of URNs as a better approach to avoid to some degree the confusion created here.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload