|
What is XHTML Used for?Posted by Chris FullerWednesday, October 28, 2009 |
XHTML is an effective way to combine store authored content that may require manipulation when presented back to the user through a web browser.
If you just need to present static content, then HTML is good enough, but if you want to be able to mix-in dynamic content with your static, authored content, then XHTML is the way to go.
XHTML is HTML, except with XML rules enforced. Here is a good
explanation of the differences between HTML and XHTML:
http://www.w3schools.com/XHTML/xhtml_html.asp
The Document Object Model (DOM) is a cross-platform and
language-independent convention for representing and interacting with
objects in XML, XHTML or HTML.
Authored content, as it applies to systems I've worked with, is a
combination of words, images and formatting that can be saved in a
file system or database and presented to users
as they navigate through a web site. The authored content that I've
worked with is mostly static, and is saved as XHTML so that dynamic
elements can be added where appropriate, then presented back to a user through a web browser.
Dynamic content is content that is built from data. Most of this
time, the data will come from a systems database, but the data could
just as easily come from internal or external services. Charts and reports are good
example of dynamic content.
The main benefit of XHTML is that if you store authored content to a
file or a database as XHTML, you can be confident that when you read
your system can be load it into a DOM object. This means that you can
allow users to author their own HTML documents, enforce XHTML standard
when you store the data and avoid run-time issues when mixing in
static authored content with dynamic content. By loading it into a DOM
object we are able to leverage the DOM object to manipulate the HTML. Manipulating a DOM object is much simpler doing text manipulations on raw HTML.