QA


Q&A

Q.

If web browsers don't know how to display XML documents, how is it that XHTML documents can be viewed in web browsers?

A.

XHTML represents the one exception to the rule about XML documents not being viewable without the aid of stylesheets. Because HTML documents are directly viewable in web browsers, even without the help of stylesheets, it only makes sense that XHTML documents should be viewable as well. However, you still must use stylesheets if you want control over the layout and formatting details of XHTML documents.

Q.

What happens if I don't validate my XHTML documents?

A.

Nothing happens, as least for now. Web browsers currently treat XHTML documents with the same leniency that they handle HTML documents, so you can get away with creating invalid documents if you want. However, this goes against the whole premise of XHTML, which is to demand the creation of highly accurate documents. The idea is that browsers and web-based applications may at some point validate XHTML documents. So you should make an effort to police your own documents and make sure they are valid before publishing them on the Web.




Sams Teach Yourself XML in 24 Hours
Sams Teach Yourself XML in 24 Hours, Complete Starter Kit (3rd Edition)
ISBN: 067232797X
EAN: 2147483647
Year: 2005
Pages: 266

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net