Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   HTML (http://www.velocityreviews.com/forums/f31-html.html)
-   -   what would be the equivalent line in HTML (http://www.velocityreviews.com/forums/t164119-what-would-be-the-equivalent-line-in-html.html)

John Salerno 02-03-2006 08:59 PM

what would be the equivalent line in HTML
 
I have this line in my XHTML template:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

If I create an HTML file instead, what should I put in the html tag instead?

Steve Pugh 02-03-2006 09:01 PM

Re: what would be the equivalent line in HTML
 
John Salerno wrote:
> I have this line in my XHTML template:
>
> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
>
> If I create an HTML file instead, what should I put in the html tag instead?


<html lang="en">

Steve


Dylan Parry 02-03-2006 09:07 PM

Re: what would be the equivalent line in HTML
 
Pondering the eternal question of "Hobnobs or Rich Tea?", John Salerno
finally proclaimed:

> If I create an HTML file instead, what should I put in the html tag
> instead?


From the XHTML version, you get:

<html lang="en">

That's all there is to is. It is also important to make sure that you
get the correct language code in there. "en" refers to British English,
so if you are using American English it should be "en-us" (with similar
alterations for Canadian "en-ca" and Australian "en-au" English).

--
Dylan Parry
http://webpageworkshop.co.uk -- FREE Web tutorials and references

John Salerno 02-03-2006 09:20 PM

Re: what would be the equivalent line in HTML
 
Dylan Parry wrote:
> Pondering the eternal question of "Hobnobs or Rich Tea?", John Salerno
> finally proclaimed:
>
>> If I create an HTML file instead, what should I put in the html tag
>> instead?

>
> From the XHTML version, you get:
>
> <html lang="en">
>
> That's all there is to is. It is also important to make sure that you
> get the correct language code in there. "en" refers to British English,
> so if you are using American English it should be "en-us" (with similar
> alterations for Canadian "en-ca" and Australian "en-au" English).
>


Thanks guys, seems simple enough! But should there be anything
additional in the html tag? Or is that other stuff just XHTML extras?

cwdjrxyz 02-04-2006 05:40 AM

Re: what would be the equivalent line in HTML
 

John Salerno wrote:
> Dylan Parry wrote:
> > Pondering the eternal question of "Hobnobs or Rich Tea?", John Salerno
> > finally proclaimed:
> >
> >> If I create an HTML file instead, what should I put in the html tag
> >> instead?

> >
> > From the XHTML version, you get:
> >
> > <html lang="en">
> >
> > That's all there is to is. It is also important to make sure that you
> > get the correct language code in there. "en" refers to British English,
> > so if you are using American English it should be "en-us" (with similar
> > alterations for Canadian "en-ca" and Australian "en-au" English).
> >

>
> Thanks guys, seems simple enough! But should there be anything
> additional in the html tag? Or is that other stuff just XHTML extras?


In fact "that other stuff" may be a validation error in one or all of
the 3 html 4.01 flavors. Always use the correct Doctype and take your
code to the W3C html validator. It is especially fussy about the
Doctype and html/xhtml tags, and it usually will tell you if there is
an error in them. One error that surprises some people the first time
it happens is that, unlike most html(not xhtml) tags, the Doctype tag
is case sensitive. That is one reason why it is nice to store your
Doctypes somewhere so that you only have to copy and paste them to
avoid typos.


Andy Dingley 02-04-2006 01:27 PM

Re: what would be the equivalent line in HTML
 
On Fri, 03 Feb 2006 21:20:10 GMT, John Salerno
<johnjsal@NOSPAMgmail.com> wrote:

> > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">


>Thanks guys, seems simple enough! But should there be anything
>additional in the html tag? Or is that other stuff just XHTML extras?


XML extras really. This is why they're one of the few changes from HTML
4.01 -> XHTML. XHTML never really adds anything new, it just
reformulates HTML 4.01 in XML


xmlns="http://www.w3.org/1999/xhtml"
is a "namespace", as described here
http://www.w3.org/TR/REC-xml-names/

Arjun might pop up to explain why namespaces were badly designed, but
they are a vaulable feature of XML (maybe they were done badly, but
they're still useful).

Namespaces do a couple of things - they're an alternative to a doctype
and can be used to refer to an XML Schema instead. Secondly they're an
easy way to include elements from multiple schemas, so that you can very
easily embed Dublin Core or SVG elements into your HTML in a valid and
easily processed manner.

Sadly namespaces are an XML feature, definitly not SGML. So for
"Appendix C" XHTML, they are of no use whatsoever. They don't hurt
anything when used like this, but neither are they visible to web agents
that are receiving XHTML labelled as text/html.

You should always include the xhtml default namespace in an XHTML
document, whether it's Appendix C or not. But if you take namespaces
further and try to include namespaced elements, then you're no longer
looking like vaguely valid HTML and you've stepped ouside Appendix C.
Things may start to break at this point!

It's maybe worth reading the old HTML guidance on processing unknown
items in a HTML document. These are well-supported and have allowed much
useful work to be done, even with the worst invalidities. Perhaps
they've also encouraged such practices..... Unknown attributes should
be ingnored silently. Unknown elements should be ignored, but their
contents rendered (as if the element wasn't there)
http://www.w3.org/TR/REC-html40/appe...tes.html#h-B.1

So use bizarre attributes without too much worry, but be careful of
elements with content, lest that content suddenly appear in your HTML
page where you weren't expecting it.



xml:lang="en" is described in the XML spec.
http://www.w3.org/TR/2004/REC-xml-20.../#sec-lang-tag

and mentioned in the XHTML spec here
http://www.w3.org/TR/xhtml1/#C_7

Note that although this is a standard XML feature, it's not an implicit
feature. You still need to define the attribute in the application's
DTD, hence the XHTML DTD contains the following snippet.

<!-- internationalization attributes
lang language code (backwards compatible)
xml:lang language code (as per XML 1.0 spec)
dir direction for weak/neutral text
-->
<!ENTITY % i18n
"lang %LanguageCode; #IMPLIED
xml:lang %LanguageCode; #IMPLIED
dir (ltr|rtl) #IMPLIED"
>


This attribute is in turn part of the %attrs; entity, and so is allowed
on most XHTML elements (any of them, except for elements used in <head>)


Harlan Messinger 02-04-2006 05:57 PM

Re: what would be the equivalent line in HTML
 
Dylan Parry wrote:
> Pondering the eternal question of "Hobnobs or Rich Tea?", John Salerno
> finally proclaimed:
>
>> If I create an HTML file instead, what should I put in the html tag
>> instead?

>
> From the XHTML version, you get:
>
> <html lang="en">
>
> That's all there is to is. It is also important to make sure that you
> get the correct language code in there. "en" refers to British English,
> so if you are using American English it should be "en-us" (with similar
> alterations for Canadian "en-ca" and Australian "en-au" English).
>


In fact, "en" refers to English. If you want to specify British English,
you use en-gb.

dorayme@optusnet.com.au 02-04-2006 11:10 PM

Re: what would be the equivalent line in HTML
 

Dylan Parry wrote:

> "en" refers to British English,
> so if you are using American English it should be "en-us" (with similar
> alterations for Canadian "en-ca" and Australian "en-au" English).
>

This fair dinkum, there is an au? Deadset? Well well! Think I will go
have a dingo's breakfast...



All times are GMT. The time now is 06:11 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.