Discussion on:

11
Comments

Join the conversation!

Follow via:
RSS
Email Alert
0 Votes
+ -
Given that I have a site full of clean, hand-coded HTML, how do I migrate it, and how do I know if the migrated code is syntactically correct? What tools exist to do this?

The W3C has an online validation form (http://validator.w3.org/), so that covers the second part of the problem.

But what tools can be used to help automate conversion?
You might examine Tidy (see: http://www.w3.org/People/Raggett/tidy/)

Use the command line "tidy -config tidy_config.txt -m index.html" with the tidy_config.txt below. You should receive a validated, inline css added, and XHTML converted result file "index.htm". Errors are printed out into tidy_found_errs.txt, warnings are suppressed.
Caveat: The input file must not have too much heavy HTML errors. If, clean it first. The input file will be replaced when using the command options described above.

// sample config file for HTML tidy
indent: auto
indent-spaces: 2
tab-size: 2
wrap: 0
markup: yes
clean: yes
enclose-text: yes
input-xml: no
output-xml: no
output-xhtml: yes
add-xml-decl: yes
add-xml-space: no
doctype: loose
input-xml: no
show-warnings: no
numeric-entities: yes
quote-marks: yes
quote-nbsp: yes
quote-ampersand: no
break-before-br: no
uppercase-tags: no
uppercase-attributes: no
wrap-asp: no
char-encoding: latin1
show-warnings: no
error-file: tidy_found_errors.txt
new-inline-tags: cfif, cfelse, math, mroot,
mrow, mi, mn, mo, msqrt, mfrac, msubsup, munderover,
munder, mover, mmultiscripts, msup, msub, mtext,
mprescripts, mtable, mtr, mtd, mth
new-blocklevel-tags: cfoutput, cfquery
new-empty-tags: cfelse
There are limits to how much content can be separated from presentation. craigslist.org displays cities in font sizes proportional to the activity on their sites. Is font size then purely presentation?

Apart from certain niche successes, such as B2B, library information, and newsfeeds, most Web folks wonder, I think, what XML buys them? What does XML do which can't be done with HTML 4.01 and PHP? With XML you need to buy into XSLT and DTDs and various other standards of representing information and processing it, e.g., SOAP, but that seems to go a long way around to get to the point.

I can see XML as a useful metatool, in the same way BNF is for syntax, but having everyone go out and do XML simply ignores the added intellectual burden of working through those layers of interpretation. As a hack it's admirable. As a day-to-day process, it sucks.

The thing which might save XML is W3C's Semantic Web. From what I see, however, it has a *long* way to go. Furthermore, there are many parties out there who might consider it contrary to their interests and simply might not play along, or may frustrate it simply because doing so is fun.
0 Votes
+ -
Go now to csszengarden.com and click through the different designs. Take a look at the source code.

This is what you get when you separate content from presentation; want to change the design across the site? No problem -- just change one file. Of course, you have to know what you're doing: gone are the days when you can throw up some sloppy, buggy HTML code and expect the browser to render it properly.
0 Votes
+ -
Older
duckboxxer 6th Jul 2004
For those of us that still must support older browsers, how do they react to XHTML? Would one need 2 versions of things to deal with the likes of Netscape 4x?
Netscape 4.x IE4.x are not DTD aware, so they will render XHTML, HTML 4.01 strict, et al. the same way they handle HTML 3.2. That is to say very poorly.

I struggled with the old browser problem for a while, but then decided that I couldn't encourage my customers to use them. Netscape 4.x is going on 6+ years old, and if you have a PC with IE4 on it, you probably have a spam spewing infected zombie on your hands because you haven't patched in something like 4 years.

I have some Solaris based customers and have gotten them to switch from NS 4.7 (it still comes standard even on the latest version of Solaris) to Opera & Mozilla with no problems.

I direct my older browser customers to mozilla.org and Opera.com and let them make thier own choice.

That said, if you design to either the HTML or XHTML spec, the newer DTD aware browsers won't have any problems rendering your page. You'll even find that your pages don't look too different between browsers, thus elimitating the requirement of different pages for different browsers.

Dreamweaver MX 2004 even has the ability to create XHTML pages from the start. A tool well worth it's price.

Happy coding
What is a customer can't or won't upgrade, we are stuck using IE 5.5 because we cannot upgrade to IE6 because of changes in the microsoft DAO and MDAC. In turn our customers cannot upgrade because their customers do not want to foot a multi million pound bill to upgrade their internet browsers. it doesn't matter to them what they use, then only browse a local Intranet (well actually multiple sites are connected together via VPN). so you see they have no reason to spend a few million upgrading.
It's neither here nor there for our customers what they use because again they don't have 'out-side' access.
For us it is a problem, we cannot upgrade because we cannot break compatibilty of our development environments.
So what value does XHTML have? - none to me.
0 Votes
+ -
If you can't upgrade to IE 6 because of changes MS made to DAO and MDAC then go for a browser that doesn't mess with the operating system - Mozilla (or Firefox).

Why would you need to spend millions upgrading? You can get a modern, fast, secure, standards compliant browser for free - Mozilla (or Firefox).

And don't believe the MS hype about other browsers being hard to use or open source software having huge support costs, to the average user Mozilla looks almost the same as IE.
The client don't have an internet connection, so the browser is not important to them.

in the mean time, even with usnig Mozilla (which isn't ideal because we also develop intranet sites that interact (sensibly) with the local machine using activeX) we are still left with a buggy IE install that has to be on al windows machine, that we still cannot apply ervice packs or security patches to...

Mozill does loko the same as IE, but it would cost moer to support as some parts don't work exactly the same as IE, and we'd have to redevelop active X applications, either to java, or just not be able to use them -thats where the cost comes in with alternative browsers.

It would cost millions to upgrade, because there are millions of clients, in technitian time alone it is a large amount...
and as I said before, the comany in question only uses an intranet, security is not an issue, -so if it's not broken, they certianly won't spend millions trying to fix it.

FYI: Mozill is not the only free browser, both Opera and Internet Explorer are also free.
0 Votes
+ -
I don't like to criticise, and I know that the article author is not able to control the format of website on which his work appears, but...

It seems a bit odd to recommend use of XHTML on a page that doesn't even use standards HTML, let alone XHTML. Surely a site that recommends site best practices should at least have a DOCTYPE on its own pages?

But then, in fairness, the Microsoft pages on IE6 standards compliance aren't standards compliant either!!! (Although I note that the equivalent pages on their competitor's sites are standards compliant.)

BTW, back on the topic of XHTML, it seems that putting the '?xml...' XML declaration on the document will put IE6 and Opera 7.0-7.03 into non-standards mode, so that is probably to be avoided if you want to avoid inconsistent cross-browser rendering. See this link for details:

http://www.hut.fi/u/hsivonen/doctype.html

/david
0 Votes
+ -
Good Spot
rstones12 1st Sep 2004
Nice catch on the DOCTYPE and XHTML. I have put IE on the back burner and am now using Firefox 90% of the time, with very little problems.

MB
Keyboard Shortcuts:
Prev
Next
Toggle
Join the conversation
Formatting +
BB Codes - Note: HTML is not supported in forums
  • [b] Bold [/b]
  • [i] Italic [/i]
  • [u] Underline [/u]
  • [s] Strikethrough [/s]
  • [q] "Quote" [/q]
  • [ol][*] 1. Ordered List [/ol]
  • [ul][*] · Unordered List [/ul]
  • [pre] Preformat [/pre]
  • [quote] "Blockquote" [/quote]

Join the TechRepublic Community and join the conversation! Signing-up is free and quick, Do it now, we want to hear your opinion.