Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>To prevent Visual Studio incorrectly warning you that the <code>"Element 'legend' occurs too few times"</code> you need to correct Visual Studio's HTML and XHTML validation files.</p> <p>VS will then treat the <code>&lt;legend&gt;</code> tag as optional inside a <code>&lt;fieldset&gt;</code> tag (as per the spec).</p> <p>To do so, there are two files you need to edit: <code>html_5.xsd</code> and <code>xhtml_5.xsd</code>. For VS2010 these are found in (e.g.):</p> <p><code>C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Packages\schemas\html\</code></p> <p>Steps to take:</p> <ol> <li><p>Close Visual Studio</p></li> <li><p>Using a text editor open the file <code>html_5.xsd</code> found in the folder above.</p></li> <li><p>Locate the following line:</p> <p><em>(note there are two lines which are similar, the first is correct, the second needs editing)</em>:</p> <blockquote> <p><code>&lt;xsd:element name="legend" type="legendType" minOccurs="1" maxOccurs="1" /&gt;</code></p> </blockquote></li> <li><p>Edit the line to read:</p> <blockquote> <p><code>&lt;xsd:element name="legend" type="legendType" minOccurs="0" maxOccurs="1" /&gt;</code></p> </blockquote></li> <li><p>Save the file</p></li> <li><p>Repeat the process for the file <code>xhtml_5.xsd</code> which is in the same folder</p></li> </ol> <p>Now start Visual Studio and view your HTML5 file - the warning will be gone.</p> <p>I hope that helps others, and I hope the .xsd files will be corrected in a future update.</p> <p><strong>UPDATE:</strong></p> <p>The line you need to find may be:</p> <blockquote> <p><code>&lt;xsd:element ref="legend" minOccurs="1" maxOccurs="1" vs:firstchild="true"/&gt;</code></p> </blockquote> <p>If so, change the <code>minOccurs="1"</code> attribute to <code>minOccurs="0"</code></p>
    singulars
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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