The Custom XHTML 1.1 Strict DTD.

Accessible Theme Preference:

About Accessible Themes.

Purpose of the Content.

This is a test page for a modified XHTML 1.1 Strict DTD. It is a custom DTD hosted on Boinkin Chipmunks that has been adjusted to include the target attribute.

The DTD Declaration is:

<!DOCTYPE html PUBLIC "-//BoinkinChipmunks//DTD XHTML 1.1 Enhanced//EN"
"http://www.boinkinchipmunks.com/dtd/modified/xhtml1-target.dtd">

The Logic behind this Custom DTD.

This custom DTD was developed to overcome issues with validation of code and to allow for an efficient of method of allowing links to open within a new window from any current Web page.

Various JavaScript techniques are used on many Web sites to overcome the problems with W3C validation when the target attribute is necessary within the standard XHTML 1.1 DTD. JavaScript, in my view, is overused, has produced a plethora of security issues and presents problems for Web visitors who have JavaScript disabled. Whenever a more direct method is available that performs the same function as a JavaScript function, I will always use the more direct method.

Since by definition of XHTML in that it is defined as being extensible, development of a custom XHTML 1.1 DTD, that included the W3C XHTML 1.1 Target Module made sense. The target attribute has not been deprecated within XHTML by the W3C.

In fact, the working draft, released 16 February 2007, of the proposed XHTML 1.1, Module-based XHTML, Second Edition [EXT – Opens in a New Window] specification includes the Target Module within the DTD's core base.

Use of the target Attribute.

There are instances when a judicious use of the target attribute makes sense, e.g. whenever comparison of content from one page to another is helpful or necessary for the Web visitor.

Whenever a page opens into a new window, the link needs to inform the user that such will occur.

This is a test link of the target attribute:   Keyboard Shortcut Keys for Boinkin Chipmunks [Opens in a New Window].


Issues Encountered Developing the Custom DTD.

During the development of this custom DTD, several issues were encountered. I undoubtedly believe that other developers may not have encountered these same problems if given the same task. Problems, more often than not, are minimized based upon objective, structures taken to achieve the objective, knowledge and level of skill.

XML Parsing Errors.

Initial development of the DTD produced errors in both Firefox and Safari. During parsing of the Web page, errors of the following were produced: XML Parsing Error: undefined entity.

The special entities are those entities coded as alpha characters [HTML entities] for such things as non–breaking spaces or the short hyphen, e.g., &nbsp; and &ndash;.

Normally, Web browsers load these entities automatically for HTML documents even with an omitted DOCTYPE declaration. Firefox and Safari, however, appear to load these entities only for known W3C Document Types and not for custom document types. Firefox, for example, will render the content as XML instead of XHTML.

There are two solutions to this parsing problem. One is to embed the W3C entities directly into the custom DTD [since Firefox does not read the DTD, this will not solve the problem] or, preferably, discontinue the use of HTML entities and code them as numeric Unicode [Numeric Character References, NCR] values.

Be careful of using non–standard values of 128 through 159. Use their four character replacements, instead.

For myself, this is a difficult transition since, for years, I have coded special characters using their HTML Friendly equivalent. HTML Special Characters [EXT] is extremely handy and worth a hard copy printout.

Most HTML named entities will, also, cause problems within any XML document.

Be sure to preface the DTD with the proper encoding: encoding="utf-8". The entire DTD code with the XML declaration should be as follows:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//BoinkinChipmunks//DTD XHTML 1.1 Enhanced//EN"
"http://www.boinkinchipmunks.com/dtd/modified/xhtml1-target.dtd">

ASP.Net Errors.

Be sure to include the proper XML name–space with the code, e.g.:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">

CSS Friendly Control Adapters.

The CSS Friendly Control Adapters are a set of modified ASP.NET adapters that produce non–table based CSS layouts. These control adapters include a JavaScript function whenever the target attribute is specified. When this modified XHTML 1.1 DTD is used, the Web Control Adapter Extender file will need modified to remove the JavaScript for the target attribute.

MIME Type Content Delivery.

This Web site uses, for the bulk of its content, a XHTML 1.1 Strict DTD. Actually, it uses a custom XHTML 1.1 Strict DTD but the same issues are present when any XHTML DTD is used, also throughout the site, within the ASP.NET framework.

Most modern browsers, except Microsoft's Internet Explorer, recognize the content MIME type of application/xhtml+xml. Any content served as a XHTML should be rendered by the browser as application/xhtml+xml.

Microsoft's NET runtime version 2.0 does not inherently deliver XHTML content with the appropriate MIME type. Instead, it delivers it as text/html.

Microsoft has provided a work–around to enable its .NET version 2.0 framework to deliver XHTML content as application/xhtml+xml to modern browsers that support the MIME type of application/xhtml+xml.

This work–around entails placing the following code within the global.asx file:

<%@ Application Language="VB" %>
<script runat="server">
Sub Application_PreSendRequestHeaders(ByVal s As Object, _
ByVal e As EventArgs)
If Array.IndexOf(Request.AcceptTypes, _
"application/xhtml+xml") > -1 Then
Response.ContentType = "application/xhtml+xml"
End If
End Sub
</script>
.

The above method forces all ASP.NET content to be rendered as application/xhtml+xml within .NET framework 2.0 in browsers that support the XHTML MIME. In all other browsers, the content is delivered as text/html.

I have not, yet, researched how the newly released .NET framework version 3.5 handles HTTP Content Type delivery.

Miscellaneous Rendering and Validation Issues.

There are two more issues that should be addressed if using XHTML DTDs within .NET framework 2.0. These apply, also, to use of custom XHTML DTDs. Please note that how these issues may have either changed or been resolved within .NET framework 3.5 are unknown by this author at the time this article was written.

Strict DTD Rendering.

The .NET framework 2.0 renders content, by default, with a transitional based format. To render content in a Strict XHTML format, the web.config file will need to be adjusted.

The following code will need to added between the system.web tags:

<xhtmlConformance mode="Strict"/>

Validation of the Code within the W3C Validation Engine.

To accommodate validation of the Web content within the W3C validation engine, the engine's specifications will need to be added to the ADD.browser file contained within the App_Browsers folder.

The following code will need to be added between the browsers tags within the ADD.browser file:

<browser id="w3cValidator" parentID="default">
<identification>
<userAgent match="^W3C_Validator" />
</identification>
<capture>
<userAgent match="^W3C_Validator/(?'version'(?'major'\d+)(?'minor'\.\d+)\w*).*" />
</capture>
<capabilities>
<capability name="browser" value="w3cValidator" />
<capability name="majorversion" value="${major}" />
<capability name="minorversion" value="${minor}" />
<capability name="version" value="${version}" />
<capability name="w3cdomversion" value="1.0" />
<capability name="xml" value="true" />
<capability name="tagWriter" value="System.Web.UI.HtmlTextWriter" />
</capabilities>
</browser>

Validation Check of the Content Page.

Use the following link to check for validation: Check for Validation of the Web Page [External and Opens in a New Window].

Addendum.

I have noticed some interest in the custom DTDs that have been created for this Web site. There is some hot linking occurring to these DTDs along with some specialty JavaScript files. Hot linking is a bad practice. It can pose a significant security risk to those external sites that have hot linked external files. Besides that, it just plain discourteous and disrespectful.

If you wish to use them on your servers, e-Mail me and ask. I would strongly advise against further hot links to any content on this site.

Thank you.

Comments.

If you find any discrepancies or issues with my logic or what has been presented, please e-Mail:  that guy at Boinkin Chipmunks.


Skip the Keyboard Shortcut List and go to the End of the Page.

The Keyboard Shortcut List.

Shortcut Key, Two.
INTERNAL LINK: Jump to the General Page Menu.
Shortcut Key, Five.
Jump to the Copyright Notice.
Shortcut Key, Six.
Jump to the Safety Policy.
Shortcut Key, Seven.
Jump to the Privacy Policy.
Shortcut Key, Eight.
Jump to the Terms of Use.
Shortcut Key, Nine.
Jump to the Contact Page.
Shortcut Key, Zero.
Jump to the Keyboard Shortcut Links Table.
Shortcut Key, t.
INTERNAL LINK: Jump to the Top of the Page.

End of the content page.