The compiler never complains about the markup code

T

Tony

This below markup code is not valid XHTML . As you can see I use DOCTYPE
XHTML 1.0 strict and I also
have selected in the Target Schemafor validation XHTML 1.1.
This Target Schema for validation is shown if you right click at the top in
a blank area and select HTML Source Editing.

So my question is that it seems to me that the compiler doesn't care
anything about checking for XHTML ?
I read a book and here they say the following
"You can also configure the level of error checking Visual Studio performs
for markup in your .aspx files. Usually you'll want to set the level of
validation to match the doctype that you're using. Unfortunately Visual
Studio doesn't take this step automatically. Instead it's up to you to
choose the level of validation you want from the drop-down list in the HTML
Source editing toolbar.(If the HTML Source Editing toolbar is not currently
displyed, right-click the toolbar strip and choose HTML Source Editing) The
most common validation choices are
HTML 4.01, HTML 1.0 Transitional and XHTML 1.1. For xample, if you choose
XHTML 1.0 Transitional or XHTL 1.1 you'll recieve a warning in the Error
List if your web page includes syntax that's not lgal in XHTML, like
inorrect capitalizaton, an obsolete formatting attribute, or an element
that'n not properly closed,. You'll still be able to run your web page but
you'll kno that your page isn't completely consistet with the XHTML
standard".

The book is wrong because I never get any error when I for example have
different capitalizaton or a tag is not correct closed.


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<DIV>
<!-- This is invalid in XHTML -->
<p>This paragraph is not written according to XHTML syntax.

<p> testing</P>
<!-- This is also invalid in XHTML -->
<img src="/images/xhtml.gif">
</div>
</form>
</body>
</html>

//Tony
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top