|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
Xhtml - <html xmlns=...> question.
Hi,
I am updating my HTML to the xhtml 1.0 specification to make any updates later involving XML easier. At the moment my <html> tag looks like: <html xml:lang="en" lang="en"> But I see that some people add the following: <html xmlns="http://www.w3.org/1999/xhtml"> Is it needed, and what does it do? I want to keep everything to specification and know what everything in the file does. Thanks for your help!
__________________
Cheers, Michael Bray |
|
#2
|
|||
|
|||
|
It declares the main namespace. If you were to save your document as .xml instead of .html, and expected it to render as XHTML, you would need the xmlns="bla" declaration inside the root element.
|
|
#3
|
|||
|
|||
|
Slight clarification of what jkd explained: regardless of what extension you save the file with, to be an XHTML conforming document the xmlns attribute must be "present" with that value. Actually, the attribute is declared with a fixed value in the DTD, so if you don't specify it in your document it will still be valid. If you do specify it, it must have that value. See XHTML 1.0: The Extensible HyperText Markup Language: 3.1.1 Strictly Conforming Documents.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > Xhtml - <html xmlns=...> question. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|