Validating a Custom DTD

by J. David Eisenberg

25 Reader Comments

Back to the Article
  1. Try to validate this site: http://bednarz.nl Link to validatation: http://validator.w3.org/check?uri=http://bednarz.nl/
    Funny isnt it?

    Copy & paste the code below to embed this comment.
  2. Hey,

    Just off the top of my head, removing the ugly “]>” at the top of documents with internal subsets can be done with a little [removed]

    with (document.body) for (var i=0;i<2;++i) if (/]>/.test(childNodes[ i ].data))removeChild(childNodes[ i ]);

    Of course, it’s not ideal, but seems to do the job. It loops over the first two elements since different browsers place the characters in different positions. Originally I thought to simply strip the first two body child nodes, but realized that’s more prone to worst-case scenarios.

    The script can even be placed in the head tags without being attached to an onload event, since it depends on contents that’re already parsed. Should remove the node as soon as it hits the script.

    Copy & paste the code below to embed this comment.
  3. Why go through all this trouble of creating custom stuff? Is your client really ready to pay for all this? Is it justified over time? Will the site structure stay the same long enough for this to work? I think for smaller websites this takes way to much time.

    Do like the idea though

    Copy & paste the code below to embed this comment.
  4. I’m confused?  Why not use attributes in a different namespace?  EG:

    <input type=“text” name=“yourName” myns:required=“true” />

    That way you aren’t touching the XHTML DTDs at all…

    Copy & paste the code below to embed this comment.
  5. So where can I find a module, library or app that will take some of my database schemas from my content manglement system and generate a valid DTD so I don’t shoot my food clean off (something a bit … well alot less expensive than XMLSpy ya’know) ?

    Copy & paste the code below to embed this comment.