Jimmy George wrote:
The examples you gave are all part of the XML specification. XHTML is really just a predefined set of tags and rules made with the XML standards. Well-formedness is one of those items, and one item of that is being sure that all tags have a closing tag, when you specify a tag with ' />' ending sequence you are specifying that the open and end tag are one and the same, but you *are* specifying the close tag.Hello AllThis is not really CGI talk but I am interested in the statement that XHTML is a subset od XML and a parser should be available in the CGI library.
The closing tag idea is just one of the differences, the cutting out of most formatting tags is obviously a big one as well. The real key is content over format. But you are correct XHTML is *cleaner* but in lots of ways, less garbage (not that that would bother most perl'ers :-)) in the way of formatting tags, proper 'syntax', etc.To my mind XHTML is a cleaner version of HTML in that any opening tag has to have a closing tag. e.g. a <p> tag has to have a </p> tag to close that particular block. BUT when we have something like a <hr> where no closing tag was required in HTML we now have to put a '/' in there. That is the <hr> now becomes <hr /> - not compulsory right now but it will be soon.
Technically they did have closing tags, just no one used them because the browsers made it acceptable not to, it wasn't that they didn't exist (don't worry I am just as guilty as everyone else :-), and I admit it). The work will be frontloaded rather than backloaded which is why all of this is important, you are correct in thinking that a parser must look for both types of open and close tags, but the key is that theoretically once a parser is written for any given language it is 100% universal for that language, there *should* be no special quirks for any one person's or company's (i.e. M$ or Netscape) "style" of HTML, because if it ain't well formed it don't count.So we can still search for an opening tag in XHTML as we did in HTML. They are still used. Then if you want to you can look for another text string starting with < and see if it contains a /. That makes it a closing tag or a single tag entity. The clue here is the gap before the /> It sounds easy I suppose but there will be some work involved because of all the single entity tags that never before had closing ones.
Of course don't think the war is over, we now get to fight the battle of which parser is better ;-), but this can be a much more friendly battle. So now we can just throw in which perl XML parser a person uses, you know: Red Hat rules and Mandrake sucks, vim rules and emacs sucks, Gnome rules and KDE sucks, XML::Simple rules and blah::blah sucks...etc. I hope everyone's non-scientific poll software is tuned and ready, another unwinnable where both sides are correct battle brewing ;-)..............
http://danconia.org
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]