473,698 Members | 2,450 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DTDs, www & validation

I've been wandering around the results of numerous googles for several
hours without reaching a conclusive solution, so I'm dipping a tentative
toe back in ciwah...

I've been persuaded here in the past that serving xhtml is a bad thing (tm).

I want the extra constraints xhtml imposes.

It has been suggested before to create a DTD which requires these &
includes all the requirements of HTML 4.01 & validate against that.

I've downloaded such a document from
http://www.spartanicus.utvinternet.i...1-stricter.dtd which I'm
sure looks familiar to all the regulars here.

My questions are pretty simple to state:

How do I make use of this to achieve the above?

I know I can declare <!DOCTYPE HTML SYSTEM
"http://www.spartanicus .utvinternet.ie/html401-stricter.dtd">
(though I'd first either enquire as to whether I should use this url or
duplicate the file on my own server).

However I'm concerned as to whether some browsers will do something
undesirable in their interpretation of my pages when they see this,
rather than a standard public declaration.

Also, http://www.spartanicus.utvinternet.ie/no-xhtml.htm which links to
the above DTD, declares itself as HTML 4.01.

This leads me to wonder, am I supposed to use the !DOCTYPE HTML SYSTEM
form only for development validation & then replace this with a !DOCTYPE
HTML PUBLIC referring to HTML 4.01 prior to the site going live?

However, if that is what one should do, why not just declare an XHTML
1.0 doctype while developing & then replace this with the html 4.01 type
prior to going live to achieve an equivalent effect?

Is there an ideal solution?

Along the way, which resources do the readers here use for validation?
Software installed locally & if so, what, or the online services of w3c
or wdg?

Lastly, for a current project I'm forced to use DreamweaverMX20 04; can
it be persuaded to validate against a custom dtd?

Perhaps there's a different & better solution to this whole problem.

--
Michael
m r o z a t u k g a t e w a y d o t n e t
Jul 23 '05 #1
81 4644
Michael Rozdoba <mr**@nowhere.i nvalid> wrote:
I've downloaded such a document from
http://www.spartanicus.utvinternet.i...1-stricter.dtd which I'm
sure looks familiar to all the regulars here.

My questions are pretty simple to state:

How do I make use of this to achieve the above?
I merely configured my local validator to use my custom DTD rather than the
W3C's DTD when it sees the W3C's standard DOCTYPE declaration. My custom
DTD is more restrictive than the W3C's DTD, so if a document validates
against my DTD, then it will validate against the W3C's DTD as advertised.

Technically, if your custom DTD allows markup that the W3C's DTD doesn't
allow (e.g., http://www.cs.tut.fi/~jkorpela/html/strict.dtd), then you're
guilty of false advertizing if you use one of the W3C's standard DOCTYPE
declarations. But I think that's the lesser evil in these days of browsers
with DOCTYPE sniffing.

FWIW, I don't bother using the DTD to enforce XML-like requirements that
all attributes be quoted, that optional closing tags be used, etc. For
that, I use a tool that adds quotes, closing tags, etc.:
http://www.jclark.com/sp/spam.htm
Along the way, which resources do the readers here use for validation?


I've got a copy of nsgmls installed locally:
http://www.jclark.com/sp/nsgmls.htm

I use makefiles to run an HTML preprocessor and other programs to
automatically generate and validate HTML documents from preprocessor
source, data files, etc.
--
Darin McGrew, mc****@stanford alumni.org, http://www.rahul.net/mcgrew/
Web Design Group, da***@htmlhelp. com, http://www.HTMLHelp.com/

"Cheaters never win; they just finish first." - Johhny Hart
Jul 23 '05 #2
Michael Rozdoba <mr**@nowhere.i nvalid> writes:
I want the extra constraints xhtml imposes.
Uh, all of them?

<http://groups-beta.google.com/group/alt.html/msg/bab970becd5a41d 3>

might answer some of your questions, also some you forgot (groups-beta
is bloody annoying, BTW).
This leads me to wonder, am I supposed to use the !DOCTYPE HTML SYSTEM
form only for development validation & then replace this with a
!DOCTYPE HTML PUBLIC referring to HTML 4.01 prior to the site going
live?
No; you can just use the public identifier for HTML 4.01, and override
that locally. If you haven't, you should look into (X)Emacs which
allows for using your private DTD for the editing part, not just after
the fact control.
Lastly, for a current project I'm forced to use DreamweaverMX20 04; can
it be persuaded to validate against a custom dtd?


Since when does Dreamweaver ship with a validating system?
--
| ) Più Cabernet,
-( meno Internet.
| ) http://bednarz.nl/
Jul 23 '05 #3
Darin McGrew wrote:
I merely configured my local validator to use my custom DTD rather
than the W3C's DTD when it sees the W3C's standard DOCTYPE
declaration.
That was why I asked a later question about where posters validate -
local looks like a better solution as one has more control. This seems
much more practical.
My custom DTD is more restrictive than the W3C's DTD, so if a
document validates against my DTD, then it will validate against the
W3C's DTD as advertised.
Indeed.
Technically, if your custom DTD allows markup that the W3C's DTD
doesn't allow (e.g., http://www.cs.tut.fi/~jkorpela/html/strict.dtd),
then you're guilty of false advertizing if you use one of the W3C's
standard DOCTYPE declarations.
Quite - not something I'd do intentionally; anyhow, I'm sure I'm
incompetent enough to make up for that with other errors.
But I think that's the lesser evil in these days of browsers with
DOCTYPE sniffing.

FWIW, I don't bother using the DTD to enforce XML-like requirements
that all attributes be quoted, that optional closing tags be used,
etc. For that, I use a tool that adds quotes, closing tags, etc.:
http://www.jclark.com/sp/spam.htm
Interesting. Thanks, I'll look into that, though I think I'd rather be
in the habit of writing them myself. As long as I am writing code by
hand I'd rather write it the way I mean it to end up, iyswim.
Along the way, which resources do the readers here use for
validation?

I've got a copy of nsgmls installed locally:
http://www.jclark.com/sp/nsgmls.htm


That I definitely will pay a visit to shortly.
I use makefiles to run an HTML preprocessor and other programs to
automatically generate and validate HTML documents from preprocessor
source, data files, etc.


Sounds like fun. I think I'll not get into that for the time being - got
enough on my plate atm. Cheers.

--
Michael
m r o z a t u k g a t e w a y d o t n e t
Jul 23 '05 #4
Eric B. Bednarz wrote:
Michael Rozdoba <mr**@nowhere.i nvalid> writes:

I want the extra constraints xhtml imposes.

Uh, all of them?


Erm, probably not - bad choice of wording. The only ones I had in mind
were closing of elements & quoting of attributes. Though I have no
immediate objections to any constraints which force greater separation
of content & presentation. Does xhtml impose additional constraints
outside of those?
<http://groups-beta.google.com/group/alt.html/msg/bab970becd5a41d 3>

might answer some of your questions, also some you forgot
Thanks :)
(groups-beta
is bloody annoying, BTW).
I've not made my mind up - without getting too OT, what's annoying you
the most?
This leads me to wonder, am I supposed to use the !DOCTYPE HTML SYSTEM
form only for development validation & then replace this with a
!DOCTYPE HTML PUBLIC referring to HTML 4.01 prior to the site going
live?

No; you can just use the public identifier for HTML 4.01, and override
that locally.


Which again implies local validation. I'll try to sort that out now.
If you haven't, you should look into (X)Emacs which
allows for using your private DTD for the editing part, not just after
the fact control.


I wonder if I can do that with vim? I'm using vim not as I know it yet
but because I like it & am trying to force myself to learn to use it ;)
I needed a good editor which doesn't require a gui; forget why I plumped
for vi et al rather than emacs.

That all said, I'm required to use DW & also need to use it in order to
learn how to use it - as part of a course module - for my current
project, so the more closely I can integrate a validation solution with
DW the better.

I've already had to edit a couple of its config files manually to get it
to stop choosing transitional dtds which afaic is wasting my time - not
as friendly as I was told it is. That said, the code it produces doesn't
look too bad & it seems to let me stay in control most of the time.
Lastly, for a current project I'm forced to use DreamweaverMX20 04; can
it be persuaded to validate against a custom dtd?

Since when does Dreamweaver ship with a validating system?


I can't claim for certain it does, however it does allow one to validate
documents one way or another. Also, I've read some third party
documentation which implies it has it's own validation code.

If I wasn't in the middle of several downloads I'd kill my net
connection & try validating a few files. Will do that later.

This is in respect of DW MX2004 v7.0 btw.

--
Michael
m r o z a t u k g a t e w a y d o t n e t
Jul 23 '05 #5
In article <41************ **********@news .zen.co.uk>,
Michael Rozdoba <mr**@nowhere.i nvalid> writes:
I've been persuaded here in the past that serving xhtml is a bad thing (tm).
I'd be inclined to call it neutral in the real world. Neither good nor
bad (unless you get carried away).
I want the extra constraints xhtml imposes.
You can get that very easily.
See http://valet.webthing.com/page/parsemode.html
It has been suggested before to create a DTD which requires these &
includes all the requirements of HTML 4.01 & validate against that.


That's the hard way, and leaves you at the mercy of browser quirks.

--
Nick Kew

Nick's manifesto: http://www.htmlhelp.com/~nick/
Jul 23 '05 #6
Michael Rozdoba <mr**@nowhere.i nvalid> wrote:
I know I can declare <!DOCTYPE HTML SYSTEM
"http://www.spartanicus .utvinternet.ie/html401-stricter.dtd">
(though I'd first either enquire as to whether I should use this url or
duplicate the file on my own server).

However I'm concerned as to whether some browsers will do something
undesirable in their interpretation of my pages when they see this,
rather than a standard public declaration.
Unlikely (I'm not aware of any that do), but it's possible.
Also, http://www.spartanicus.utvinternet.ie/no-xhtml.htm which links to
the above DTD, declares itself as HTML 4.01.

This leads me to wonder, am I supposed to use the !DOCTYPE HTML SYSTEM
form only for development validation & then replace this with a !DOCTYPE
HTML PUBLIC referring to HTML 4.01 prior to the site going live?


As you've realised it revolves around how you validate, if you want to
use one of the online validators then you'd have to use a custom system
doctype and upload the DTD to your server. (linking to a DTD on someone
else's server is not nice and it makes you dependant on that server)

If you use a local validator then for DTDs that use a subset of the
public DTD, (no new elements), you can use the public doctype and
override the location of the DTD locally to a local DTD. (I've elected
to omit the uri from the doctype declaration but this isn't the best
way).

Personally I use ARV as a local Windows validator (
http://www.arealvalidator.com ) Note that it has a limitation: it can
only validate files on the local file system, not on a server.

From the link Eric provided you will have understood that certain
differences between XHTML and HTML like mandatory attribute quoting and
element case sensitivity are not governed by the DTD but by the SGML
stuff that goes with it.

I'll expand the bit on validating against a custom DTD on the no-xhtml
document later.

--
Spartanicus
Jul 23 '05 #7
Nick Kew wrote:
In article <41************ **********@news .zen.co.uk>,
Michael Rozdoba <mr**@nowhere.i nvalid> writes:

I've been persuaded here in the past that serving xhtml is a bad thing (tm).

I'd be inclined to call it neutral in the real world. Neither good nor
bad (unless you get carried away).


Last time I innocently tried that around here I got an intellectual
kneecapping :) - you wouldn't be suggesting this isn't the real world
would you? ;)
I want the extra constraints xhtml imposes.


You can get that very easily.
See http://valet.webthing.com/page/parsemode.html


Yes, that popped up recently. Another handy check.
It has been suggested before to create a DTD which requires these &
includes all the requirements of HTML 4.01 & validate against that.


That's the hard way, and leaves you at the mercy of browser quirks.


You mean if a document is made public with such a DTD still in place?
That was what I feared :/

Ah well, no harm. I've gone down the suggested route of installing local
validation via "A Real Validator 1.11" & used it to override the HTML
4.01 DTD with http://www.spartanicus.utvinternet.i...1-stricter.dtd

I think this gives me most of what I want. Though atm I see it won't let
me close empty tags. Is that a bad thing to want to do with something
claiming to be HTML 4.01? I'd rather have my docs in a format as close
to XML as possible, whilst still being valid HTML 4.01.

If it can be done, any pointers to altering the DTD appropriately? If
it's a case of RTFM, an ptrs to that? Cheers.

--
Michael
m r o z a t u k g a t e w a y d o t n e t
Jul 23 '05 #8
Michael Rozdoba <mr**@nowhere.i nvalid> wrote:
I think this gives me most of what I want. Though atm I see it won't let
me close empty tags. Is that a bad thing to want to do with something
claiming to be HTML 4.01? I'd rather have my docs in a format as close
to XML as possible, whilst still being valid HTML 4.01.


Closing empty tags makes it invalid HTML. Well, sorta, depending on the
empty tag. But if it *is* valid HTML, then it isn't what you wanted. For
example, in HTML,

<img src=... alt=... />

is technically equivalent to

<img src=... alt=...>>

or

<img src=... alt=...>&gt;

It doesn't matter that much for tags like <img> or <br> that appear in the
BODY: You just get a few '>' characters scattered here and there. But for
tags like <link> that appear in the HEAD, it causes problems, because the
text content (the extra '>' characters) closes the HEAD.

Appendix C compatability relies on browsers ignoring this bit of SGML-based
trivia. Most do, but not all.
--
Darin McGrew, mc****@stanford alumni.org, http://www.rahul.net/mcgrew/
Web Design Group, da***@htmlhelp. com, http://www.HTMLHelp.com/

"You can't strengthen the weak by weakening the strong."
Jul 23 '05 #9
Michael Rozdoba <mr**@nowhere.i nvalid> wrote:
Though atm I see it won't let
me close empty tags. Is that a bad thing to want to do with something
claiming to be HTML 4.01?
Of course it is, it's not allowed under HTML.
I'd rather have my docs in a format as close
to XML as possible, whilst still being valid HTML 4.01.


Feel free to author in X(HT)ML if it has a real benefit to you (the
ability to use XML tools on the data for example), you should then use
those XML tools to generate HTML from the X(HT)ML and serve that to
clients.

--
Spartanicus
Jul 23 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3020
by: Luklrc | last post by:
Hi, I'm having to create a querysting with javascript. My problem is that javscript turns the "&" characher into "&amp;" when it gets used as a querystring in the url EG: /mypage.asp?value1=1&amp;value2=4&amp; ... which of course means nothing to asp.
9
3416
by: Ray | last post by:
I need to convert the normal calendar to show the week no., the period no. and the financial year. The financial year format is as follows:- Date start: 2 May, 2005 7 days a week, 4 weeks a period and 13 periods a year. normally 52 weeks per year but one 53-week a year every 6 years. The 53th week is included in period 13. Can someone advise any idea how to construct such conversion.
9
3134
by: wardy1975 | last post by:
Hi All, Looking for a little expert advice on a few web standards issues. I am currently trying to understand the impact of web standards for a web application I work with. I have been doing a lot of research in the areas of XHTML and WAI compliance, and am attempting to come up with a recommendation for our product in terms of standards level compliance. Ideally, I would like to be at XHTML 1.0 Strict. However, in my reading I have...
14
5929
by: Arne | last post by:
A lot of Firefox users I know, says they have problems with validation where the ampersand sign has to be written as &amp; to be valid. I don't have Firefox my self and don't wont to install it only because of this, so I hope some of you gurus can enlighten me with this :) In what circumstances can the "&amp;" in the source code be involuntary changed to "&" by a browser when or other software, when editing and uploading the file to the web...
5
1306
by: Andy Dingley | last post by:
How can I best make a composite DTD by including one DTD inside another ? There's a pre-existing DTD in an external Apache project. I'd like to make use of this within our internal project, suitably extended and wrapped. With the aid of an internal and external subset I can do this, as follows: <?xml version="1.0"?> <!DOCTYPE Container
0
1257
by: Kza | last post by:
Hi, I have a project that works at home, but not at the customers location, where their network is not on the internet. This is the error: An exception occurred! Type:NetAccessorException, Message:The host/address 'www.asam.net' could not be resolved Fatal error encountered during schema scan
0
1682
by: Mudiya Dissa | last post by:
Hi, I have some code on my application like the following <% redirectUrl = "mypage.asp?type=100&id=something&view=10 'some more asp code
1
1836
by: MayoM | last post by:
My form has some simple validation in the Before Update event. If the validation fails the code ends with DoCmd.CancelEvent The form also has an Update command button. This simply runs Me.Refresh When the button is clicked, Me.Refresh triggers the Before Update code. If the validation fails and DoCmd.CancelEvent is executed, I get Error 2001 "You cancelled the previous operation" on the Me.Refresh statement.
0
8675
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8604
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9160
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
6521
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4370
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2331
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2002
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.