Discuss: Validating a Custom DTD
by J. David Eisenberg
- Editorial Comments
22 Ugly internal subset workaround
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.
posted at 08:41 pm on February 21, 2005 by Dan O'Brien
23 the use
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
posted at 02:16 am on February 25, 2005 by Yves Peeters
24 What about using attributes in a different NameSpa
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…
posted at 10:32 am on February 25, 2005 by Peter McEvoy
25 so where's the out-of-the-box tool?
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) ?
posted at 04:22 am on February 26, 2005 by Mean Dean
Discussion Closed
New comments are not being accepted, but you are welcome to explore what people said before we closed the door.
Got something to say?
Discuss this article. We reserve the right to delete flames, trolls, and wood nymphs.
Create a new account or sign in below if you’d like to leave a comment.
Subscribe to this article's comments: RSS (what’s this?)






21 Try this
Try to validate this site: http://bednarz.nl Link to validatation: http://validator.w3.org/check?uri=http://bednarz.nl/
Funny isnt it?
posted at 02:00 pm on February 17, 2005 by Pubso