Re: ASP.NET Internationalization bug?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Juan T. Llibre

    Re: ASP.NET Internationalization bug?

    re:
    !I found an MSDN document that explains why what I'm trying to do should work

    Lee,

    From :



    "A special attribute named xml:lang may be inserted in documents to specify the
    language used in the contents and attribute values of any element in an XML document."

    If anything, I can see xml:lang being declared for specific content values, for example :

    <p xml:lang="en-GB">What colour is it?</p>
    <p xml:lang="en-US">What color is it?</p>

    Then, an xml parser could identify regional US and British spellings but, given that *all* the attribute values
    must be in English in an html doc, what would be the purpose of declaring xml:lang for the html markup ?

    A similar explanation is given here :


    ---000---
    <SECTION>
    <DESCRIPTION xml:lang="en">
    Caesar begins by describing the geography of Gaul.
    </DESCRIPTION>
    <QUOTE xml:lang="la">
    Gallia est omnis divisa in partes tres, quarum unam incolunt Belgae,
    aliam Aquitani, tertiam qui ipsorum lingua Celtae, nostra Galli appellantur.
    </QUOTE>
    ---000---

    That's perfectly good usage for xml:lang, as a parser could selectively identify content in different languages.

    But, it seems to me that setting xml:lang for the html tag's *attribute* values is unneeded, since they must
    be in English, and they must be attributes set to a language identifier, as defined by IETF RFC 4646
    (http://www.ietf.org/rfc/rfc4646.txt).

    So, I think that requisite pretty well establishes the futility
    of setting xml:lang for all the attributes in an html document.

    If anything, it seems that the xml:lang attribute is included in the
    html server tag for compatibility purposes, or perhaps out of ignorance.

    If there's a need to identify that the *contents* of a particular markup tag are in a
    specific language, that identification can be included in the tag itself, for example :

    <div lang="MX-es" xml:lang="MX-es">
    Algo de contenido en español mejicano.
    </div>

    That makes a lot more sense than setting xml:lang for the attribute values in the html tag.



    Juan T. Llibre, asp.net MVP
    asp.net faq : http://asp.net.do/faq/
    foros de asp.net, en español : http://asp.net.do/foros/
    =============== =============== ========
    "Lee C." <no.spam@spamme r.comwrote in message news:%23ocUnoI2 IHA.2188@TK2MSF TNGP04.phx.gbl. ..
    >I found an MSDN document that explains why what I'm trying to do should work.
    >
    ASP.NET Web Server Controls Overview

    >
    Note the distinction between HTML Server Controls and Web Server Controls in the document. Also, note the explanation
    of "pass-through" attributes for HTML Server Controls.
    >
    Two quotes that sum it up:
    1. Any HTML element on a page can be converted to an HTML server control by adding the attribute runat="server".
    2. You can add any attributes you need to an HTML server control and the page framework will render them without
    any change in functionality.
    >
    , Lee
    >
    "Lee C." <no.spam@spamme r.comwrote in message news:Oe38JYI2IH A.4772@TK2MSFTN GP03.phx.gbl...
    >Juan,
    >>
    >I appreciate your trying to help, but you're wrong, and you are the one who is confused. :]
    >>
    >I am *not* disputing that when inserted programmaticall y, the xml:lang attribute renders to the browser. I did just
    >that as a work around (right after I discovered this bug); but, I should not have to.
    >>
    >I am *not* confusing html attributes with runat="server" attributes, as you call them. Using your logic, none of the
    >declarative (html) attributes should render to the browser after I add the runat="server" in ASP.NET; yet all of them
    >(xmlns, lang, and dir) do--except xml:lang.
    >>
    >I started with an html element with 4 attributes (xmlns, lang, xml:lang, and dir) all set declaratively. With *no*
    >5th attribute of runat="server", all 4 attributes render. If I add the 5th attribute of runat="server", which does
    >not and should not render, I no longer get all 4 attributes that should render (xmlns, lang, xml:lang, and dir), I
    >only get 3 (xmlns, lang, and dir). My logic says I should get 4, your says I should get 3? It would be 4 or 0, and
    >4 is right. Not 0...and not 3.
    >>
    >When I add runat="server", it does not magically make the xml:lang attribute a server-side attribute, while keeping
    >the other three attributes as "html" attributes. All four are still "html" attributes--which should render.
    >>
    >I think the simplification of my example may be confusing you. It is odd that, in my example, I set runat="server"
    >but do not have any server-side attributes. (I have all 4 as literal strings, for simplicity of an example.) Well,
    >in my real-world use, I do have server-side attributes, which I want set declaratively (no code-beside and no
    >script). I have:
    >>
    ><html runat="server" xmlns="http://www.w3.org/1999/xhtml"
    > xml:lang="<%$ Resources:Globa lLang, ContentAudience Language %>"
    > lang="<%$ Resources:Globa lLang, ContentAudience Language %>"
    > dir="ltr">
    >>
    >Both of those declarative explicit localization expressions should work without my having to write any more
    >"procedural " (code-beside) code or script. It actually does work fine for the lang attribute--as it should; but not
    >for the xml:lang attribute--***which is a bug***.
    >>
    >, Lee
    >>
    >"Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message news:u0WzB9H2IH A.4188@TK2MSFTN GP04.phx.gbl...
    >>re:
    >>!I think you are misunderstandin g, Juan.
    >>>
    >>Well, I think you are misunderstandin g *me*.
    >>>
    >>re:
    >>!I had the xml:lang attribute in the html tag (declaratively) , like this:
    >>>...and it renders to the browser, as it should.
    >>>
    >>Yes, because it's standard html.
    >>>
    >>re:
    >>!If I simply add runat="server"
    >>>
    >>That declares the control to run server side.
    >>>
    >>For any attribute to be programmed server-side you need a script,
    >>just as you need a script to modify any server control's attributes.
    >>>
    >>Did you run the sample page I sent ?
    >>>
    >>It iterates throught the attributes for the html server control,
    >>and shows that the xml:lang attribute *is* added programmaticall y.
    >>>
    >>re:
    >>!If I simply add runat="server", leaving in the xml:lang attribute that
    >>!renders without runat="server", all of the (declarative) attributes are
    >>!rendered to the browser--except the xml:lang attribute! That is a bug.
    >>>
    >>I think you're confusing html attributes with runat="server" attributes.
    >>>
    >>Html attributes can be inserted in normal html.
    >>Server-side attributes must be inserted in code.
    >>>
    >>Maybe I'm not explaining this as well as I should.
    >>Try to get someone else's opinion on this matter, if you don't accept mine.
    >>>
    >>>
    >>>
    >>Juan T. Llibre, asp.net MVP
    >>asp.net faq : http://asp.net.do/faq/
    >>foros de asp.net, en español : http://asp.net.do/foros/
    >>============= =============== ==========
    >>"Lee C." <no.spam@spamme r.comwrote in message news:enam1gH2IH A.4552@TK2MSFTN GP04.phx.gbl...
    >>>>I think you are misunderstandin g, Juan. I had the xml:lang attribute in the html tag (declaratively) , like this:
    >>>>
    >>><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US" dir="ltr">
    >>>>
    >>>...and it renders to the browser, as it should.
    >>>>
    >>>If I simply add runat="server", leaving in the xml:lang attribute that renders without runat="server", all of the
    >>>(declarative ) attributes are rendered to the browser--except the xml:lang attribute! That is a bug.
    >>>>
    >>><html runat="server" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US" dir="ltr">
    >>>>
    >>>Cordially,
    >>>Lee
    >>>>
    >>>>
    >>>"Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message news:eyrwjUH2IH A.3920@TK2MSFTN GP02.phx.gbl...
    >>>>Here's a full example which shows that the xml:lang attribute is added programmaticall y :
    >>>>>
    >>>>attributes. aspx:
    >>>>----------------------
    >>>><%@ Page Language="C#" AutoEventWireup ="True" %>
    >>>><html xmlns="http://www.w3.org/1999/xhtml" runat="server" id="Myid" >
    >>>><script language="C#" runat="server">
    >>>>void Page_Load(Objec t sender, EventArgs e)
    >>>>{
    >>>>Myid.Attrib utes.Add("xml:l ang", "es");
    >>>>Message.Inn erHtml = "<h4>The html control attributes collection contains:</h4>";
    >>>>IEnumerat or keys = Myid.Attributes .Keys.GetEnumer ator();
    >>>>while (keys.MoveNext( ))
    >>>>{
    >>>>String key = (String)keys.Cu rrent;
    >>>>Message.Inn erHtml += key + "=" + Myid.Attributes[key] + "<br />";
    >>>>}
    >>>>}
    >>>></script>
    >>>><head id="Head1" runat="server">
    >>>><title>Th e html control attributes collection</title>
    >>>></head>
    >>>><body>
    >>>><form id="Form1" runat="server">
    >>>><h3>HtmlCon trol Attribute Collection Example</h3>
    >>>><br />
    >>>><span id="Message" enableviewstate ="false" runat="server" />
    >>>></form>
    >>>></body>
    >>>></html>
    >>>>----------------
    >>>>>
    >>>>I don't think it's a bug to have to add an attribute programmaticall y,
    >>>>because the runat="server" tag only *declares* the html control as a programmable control.
    >>>>>
    >>>>To actually program it, you must use a script.
    >>>>>
    >>>>>
    >>>>>
    >>>>>
    >>>>Juan T. Llibre, asp.net MVP
    >>>>asp.net faq : http://asp.net.do/faq/
    >>>>foros de asp.net, en español : http://asp.net.do/foros/
    >>>>=========== =============== ============
    >>>>"Lee C." <no.spam@spamme r.comwrote in message news:e0rLaPG2IH A.4772@TK2MSFTN GP03.phx.gbl...
    >>>>>Thanks, Juan.
    >>>>>>
    >>>>>I already added similar code to a page event in my masterpage code-beside.
    >>>>>>
    >>>>> elHtml.Attribut es.Add("xml:lan g", Resources.Globa lLang.ContentAu dienceLanguage)
    >>>>>>
    >>>>>To me, that is a temporary workaround. I still want to understand whether the "eating" of the attribute I
    >>>>>original ly
    >>>>>posted about is a bug, or if this is actually happening for a reason.
    >>>>>>
    >>>>>Cordiall y,
    >>>>>Lee
    >>>>>>
    >>>>>>
    >>>>>"Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message news:%23gBUqSC2 IHA.4772@TK2MSF TNGP03.phx.gbl. ..
    >>>>>>Hi, Lee.
    >>>>>>>
    >>>>>>re:
    >>>>>>!<html runat="server" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US" dir="ltr">
    >>>>>>!no xml:lang attribute is rendered to the browser!
    >>>>>>!Remove the runat="server", and, voila, the xml:lang attribute is rendered.
    >>>>>>>
    >>>>>>Try this :
    >>>>>>>
    >>>>>><html xmlns="http://www.w3.org/1999/xhtml" runat="server" id="someID">
    >>>>>>>
    >>>>>><script runat="server">
    >>>>>>someID.At tributes("xml:l ang") = "en-US"
    >>>>>></script>
    >>>>>>>
    >>>>>>>
    >>>>>>>
    >>>>>>Juan T. Llibre, asp.net MVP
    >>>>>>asp.net faq : http://asp.net.do/faq/
    >>>>>>foros de asp.net, en español : http://asp.net.do/foros/
    >>>>>>========= =============== ==============
    >>>>>>>
    >>>>>>"Lee C." <nomail@spam.co mwrote in message news:O%23KsAQA2 IHA.4572@TK2MSF TNGP03.phx.gbl. ..
    >>>>>>>>I think I have discovered a bug in ASP.NET, related to I18N.
    >>>>>>>>
    >>>>>>>In ASP.NET 3.5 I have to set runat="server" on the html element to use explicit expressions. It appears that
    >>>>>>>ASP.NE T
    >>>>>>>eats the xml:lang attribute on the html element when it is set to runat="server".
    >>>>>>>>
    >>>>>>>Of course I want to replace the hardcoded "en-US" values with (resource) explicit expressions; but, for
    >>>>>>>simplici ty,
    >>>>>>>try this:
    >>>>>>>>
    >>>>>>><html runat="server" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US" dir="ltr">
    >>>>>>>>
    >>>>>>>...And you will find that no xml:lang attribute is rendered to the browser! Remove the runat="server", and,
    >>>>>>>voila,
    >>>>>>>the
    >>>>>>>xml:la ng attribute is rendered. :[
    >>>>>>>>
    >>>>>>>...Any ideas?
    >>>>>>>>
    >>>>>>>Cordiall y,
    >>>>>>>Lee
    >>>>>>>>
    >>>>>>>>
    >>>>>>>
    >>>>>>>
    >>>>>>>
    >>>>>>
    >>>>>>
    >>>>>
    >>>>>
    >>>>>
    >>>>
    >>>>
    >>>
    >>>
    >>
    >>
    >
    >



  • Lee C.

    #2
    Re: ASP.NET Internationaliz ation bug?

    Juan,

    In theory, I like your idea of investigating "the standard"; but, in
    practice it has serious problems, as it often does. First, you are
    referring to the XML standard, which is not as appropriate as HTML and XHTML
    standards. Second, none of them are crystal clear on best practices for
    I18N. There is a lot of *legal* (by the standard) syntax, that makes no
    sense, or makes some sense without being clearly best. The W3C site often
    states something to the effect of, "some are doing this, some are doing
    that, on your own site, at least do something and only time will tell what
    is best."

    Check out these fine examples, which mirror my syntax, on the W3C site.

    Internationaliz ation Best Practices: Specifying Language in XHTML & HTML
    Content



    Tutorial: Declaring Language in XHTML and HTML (Draft)


    Juan, you wrote:
    But, it seems to me that setting xml:lang for the html tag's *attribute*
    values is unneeded, since they must
    be in English, and they must be attributes set to a language identifier,
    as defined by IETF RFC 4646
    (http://www.ietf.org/rfc/rfc4646.txt).
    You're not setting it for "the tag's *attribute*", you're setting it for the
    *contents*, all contents, of the element (unless overridden by a
    sub-setting), which makes perfect sense so that I don't have to set it
    individually on every child element--that is the power of a hierarchy! You
    seem to be focused on the technical, with some misunderstandin g, versus the
    spirit of what we're trying to accomplish: telling user agents who our
    intended audiences is, by language, as best we can...which is why I'm *also*
    setting lang in the HTTP headers and in page meta tags.

    , Lee


    "Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message
    news:OYI4upK2IH A.5140@TK2MSFTN GP02.phx.gbl...
    re:
    !I found an MSDN document that explains why what I'm trying to do should
    work
    >
    Lee,
    >
    From :
    >

    >
    "A special attribute named xml:lang may be inserted in documents to
    specify the
    language used in the contents and attribute values of any element in an
    XML document."
    >
    If anything, I can see xml:lang being declared for specific content
    values, for example :
    >
    <p xml:lang="en-GB">What colour is it?</p>
    <p xml:lang="en-US">What color is it?</p>
    >
    Then, an xml parser could identify regional US and British spellings but,
    given that *all* the attribute values
    must be in English in an html doc, what would be the purpose of declaring
    xml:lang for the html markup ?
    >
    A similar explanation is given here :

    >
    ---000---
    <SECTION>
    <DESCRIPTION xml:lang="en">
    Caesar begins by describing the geography of Gaul.
    </DESCRIPTION>
    <QUOTE xml:lang="la">
    Gallia est omnis divisa in partes tres, quarum unam incolunt Belgae,
    aliam Aquitani, tertiam qui ipsorum lingua Celtae, nostra Galli
    appellantur.
    </QUOTE>
    ---000---
    >
    That's perfectly good usage for xml:lang, as a parser could selectively
    identify content in different languages.
    >
    But, it seems to me that setting xml:lang for the html tag's *attribute*
    values is unneeded, since they must
    be in English, and they must be attributes set to a language identifier,
    as defined by IETF RFC 4646
    (http://www.ietf.org/rfc/rfc4646.txt).
    >
    So, I think that requisite pretty well establishes the futility
    of setting xml:lang for all the attributes in an html document.
    >
    If anything, it seems that the xml:lang attribute is included in the
    html server tag for compatibility purposes, or perhaps out of ignorance.
    >
    If there's a need to identify that the *contents* of a particular markup
    tag are in a
    specific language, that identification can be included in the tag itself,
    for example :
    >
    <div lang="MX-es" xml:lang="MX-es">
    Algo de contenido en español mejicano.
    </div>
    >
    That makes a lot more sense than setting xml:lang for the attribute values
    in the html tag.
    >
    >
    >
    Juan T. Llibre, asp.net MVP
    asp.net faq : http://asp.net.do/faq/
    foros de asp.net, en español : http://asp.net.do/foros/
    =============== =============== ========
    "Lee C." <no.spam@spamme r.comwrote in message
    news:%23ocUnoI2 IHA.2188@TK2MSF TNGP04.phx.gbl. ..
    >>I found an MSDN document that explains why what I'm trying to do should
    >>work.
    >>
    >ASP.NET Web Server Controls Overview
    >http://msdn.microsoft.com/en-us/library/zsyt68f1.aspx
    >>
    >Note the distinction between HTML Server Controls and Web Server Controls
    >in the document. Also, note the explanation
    >of "pass-through" attributes for HTML Server Controls.
    >>
    >Two quotes that sum it up:
    > 1. Any HTML element on a page can be converted to an HTML server
    >control by adding the attribute runat="server".
    > 2. You can add any attributes you need to an HTML server control and
    >the page framework will render them without
    >any change in functionality.
    >>
    >, Lee
    >>
    >"Lee C." <no.spam@spamme r.comwrote in message
    >news:Oe38JYI2I HA.4772@TK2MSFT NGP03.phx.gbl.. .
    >>Juan,
    >>>
    >>I appreciate your trying to help, but you're wrong, and you are the one
    >>who is confused. :]
    >>>
    >>I am *not* disputing that when inserted programmaticall y, the xml:lang
    >>attribute renders to the browser. I did just
    >>that as a work around (right after I discovered this bug); but, I should
    >>not have to.
    >>>
    >>I am *not* confusing html attributes with runat="server" attributes, as
    >>you call them. Using your logic, none of the
    >>declarative (html) attributes should render to the browser after I add
    >>the runat="server" in ASP.NET; yet all of them
    >>(xmlns, lang, and dir) do--except xml:lang.
    >>>
    >>I started with an html element with 4 attributes (xmlns, lang, xml:lang,
    >>and dir) all set declaratively. With *no*
    >>5th attribute of runat="server", all 4 attributes render. If I add the
    >>5th attribute of runat="server", which does
    >>not and should not render, I no longer get all 4 attributes that should
    >>render (xmlns, lang, xml:lang, and dir), I
    >>only get 3 (xmlns, lang, and dir). My logic says I should get 4, your
    >>says I should get 3? It would be 4 or 0, and
    >>4 is right. Not 0...and not 3.
    >>>
    >>When I add runat="server", it does not magically make the xml:lang
    >>attribute a server-side attribute, while keeping
    >>the other three attributes as "html" attributes. All four are still
    >>"html" attributes--which should render.
    >>>
    >>I think the simplification of my example may be confusing you. It is
    >>odd that, in my example, I set runat="server"
    >>but do not have any server-side attributes. (I have all 4 as literal
    >>strings, for simplicity of an example.) Well,
    >>in my real-world use, I do have server-side attributes, which I want set
    >>declarative ly (no code-beside and no
    >>script). I have:
    >>>
    >><html runat="server" xmlns="http://www.w3.org/1999/xhtml"
    >> xml:lang="<%$ Resources:Globa lLang, ContentAudience Language %>"
    >> lang="<%$ Resources:Globa lLang, ContentAudience Language %>"
    >> dir="ltr">
    >>>
    >>Both of those declarative explicit localization expressions should work
    >>without my having to write any more
    >>"procedural " (code-beside) code or script. It actually does work fine
    >>for the lang attribute--as it should; but not
    >>for the xml:lang attribute--***which is a bug***.
    >>>
    >>, Lee
    >>>
    >>"Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message
    >>news:u0WzB9H2 IHA.4188@TK2MSF TNGP04.phx.gbl. ..
    >>>re:
    >>>!I think you are misunderstandin g, Juan.
    >>>>
    >>>Well, I think you are misunderstandin g *me*.
    >>>>
    >>>re:
    >>>!I had the xml:lang attribute in the html tag (declaratively) , like
    >>>this:
    >>>>...and it renders to the browser, as it should.
    >>>>
    >>>Yes, because it's standard html.
    >>>>
    >>>re:
    >>>!If I simply add runat="server"
    >>>>
    >>>That declares the control to run server side.
    >>>>
    >>>For any attribute to be programmed server-side you need a script,
    >>>just as you need a script to modify any server control's attributes.
    >>>>
    >>>Did you run the sample page I sent ?
    >>>>
    >>>It iterates throught the attributes for the html server control,
    >>>and shows that the xml:lang attribute *is* added programmaticall y.
    >>>>
    >>>re:
    >>>!If I simply add runat="server", leaving in the xml:lang attribute
    >>>that
    >>>!renders without runat="server", all of the (declarative) attributes
    >>>are
    >>>!rendered to the browser--except the xml:lang attribute! That is a
    >>>bug.
    >>>>
    >>>I think you're confusing html attributes with runat="server"
    >>>attributes .
    >>>>
    >>>Html attributes can be inserted in normal html.
    >>>Server-side attributes must be inserted in code.
    >>>>
    >>>Maybe I'm not explaining this as well as I should.
    >>>Try to get someone else's opinion on this matter, if you don't accept
    >>>mine.
    >>>>
    >>>>
    >>>>
    >>>Juan T. Llibre, asp.net MVP
    >>>asp.net faq : http://asp.net.do/faq/
    >>>foros de asp.net, en español : http://asp.net.do/foros/
    >>>============ =============== ===========
    >>>"Lee C." <no.spam@spamme r.comwrote in message
    >>>news:enam1gH 2IHA.4552@TK2MS FTNGP04.phx.gbl ...
    >>>>>I think you are misunderstandin g, Juan. I had the xml:lang attribute
    >>>>>in the html tag (declaratively) , like this:
    >>>>>
    >>>><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"
    >>>>lang="en-US" dir="ltr">
    >>>>>
    >>>>...and it renders to the browser, as it should.
    >>>>>
    >>>>If I simply add runat="server", leaving in the xml:lang attribute that
    >>>>renders without runat="server", all of the
    >>>>(declarativ e) attributes are rendered to the browser--except the
    >>>>xml:lang attribute! That is a bug.
    >>>>>
    >>>><html runat="server" xmlns="http://www.w3.org/1999/xhtml"
    >>>>xml:lang="e n-US" lang="en-US" dir="ltr">
    >>>>>
    >>>>Cordially ,
    >>>>Lee
    >>>>>
    >>>>>
    >>>>"Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message
    >>>>news:eyrwjU H2IHA.3920@TK2M SFTNGP02.phx.gb l...
    >>>>>Here's a full example which shows that the xml:lang attribute is
    >>>>>added programmaticall y :
    >>>>>>
    >>>>>attributes .aspx:
    >>>>>----------------------
    >>>>><%@ Page Language="C#" AutoEventWireup ="True" %>
    >>>>><html xmlns="http://www.w3.org/1999/xhtml" runat="server" id="Myid" >
    >>>>><script language="C#" runat="server">
    >>>>>void Page_Load(Objec t sender, EventArgs e)
    >>>>>{
    >>>>>Myid.Attri butes.Add("xml: lang", "es");
    >>>>>Message.In nerHtml = "<h4>The html control attributes collection
    >>>>>contains :</h4>";
    >>>>>IEnumerato r keys = Myid.Attributes .Keys.GetEnumer ator();
    >>>>>while (keys.MoveNext( ))
    >>>>>{
    >>>>>String key = (String)keys.Cu rrent;
    >>>>>Message.In nerHtml += key + "=" + Myid.Attributes[key] + "<br />";
    >>>>>}
    >>>>>}
    >>>>></script>
    >>>>><head id="Head1" runat="server">
    >>>>><title>T he html control attributes collection</title>
    >>>>></head>
    >>>>><body>
    >>>>><form id="Form1" runat="server">
    >>>>><h3>HtmlCo ntrol Attribute Collection Example</h3>
    >>>>><br />
    >>>>><span id="Message" enableviewstate ="false" runat="server" />
    >>>>></form>
    >>>>></body>
    >>>>></html>
    >>>>>----------------
    >>>>>>
    >>>>>I don't think it's a bug to have to add an attribute
    >>>>>programmat ically,
    >>>>>because the runat="server" tag only *declares* the html control as a
    >>>>>programmab le control.
    >>>>>>
    >>>>>To actually program it, you must use a script.
    >>>>>>
    >>>>>>
    >>>>>>
    >>>>>>
    >>>>>Juan T. Llibre, asp.net MVP
    >>>>>asp.net faq : http://asp.net.do/faq/
    >>>>>foros de asp.net, en español : http://asp.net.do/foros/
    >>>>>========== =============== =============
    >>>>>"Lee C." <no.spam@spamme r.comwrote in message
    >>>>>news:e0rLa PG2IHA.4772@TK2 MSFTNGP03.phx.g bl...
    >>>>>>Thanks, Juan.
    >>>>>>>
    >>>>>>I already added similar code to a page event in my masterpage
    >>>>>>code-beside.
    >>>>>>>
    >>>>>> elHtml.Attribut es.Add("xml:lan g",
    >>>>>>Resources .GlobalLang.Con tentAudienceLan guage)
    >>>>>>>
    >>>>>>To me, that is a temporary workaround. I still want to understand
    >>>>>>whether the "eating" of the attribute I
    >>>>>>originall y
    >>>>>>posted about is a bug, or if this is actually happening for a
    >>>>>>reason.
    >>>>>>>
    >>>>>>Cordially ,
    >>>>>>Lee
    >>>>>>>
    >>>>>>>
    >>>>>>"Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message
    >>>>>>news:%23g BUqSC2IHA.4772@ TK2MSFTNGP03.ph x.gbl...
    >>>>>>>Hi, Lee.
    >>>>>>>>
    >>>>>>>re:
    >>>>>>>!<html runat="server" xmlns="http://www.w3.org/1999/xhtml"
    >>>>>>>xml:lang ="en-US" lang="en-US" dir="ltr">
    >>>>>>>!no xml:lang attribute is rendered to the browser!
    >>>>>>>!Remov e the runat="server", and, voila, the xml:lang attribute is
    >>>>>>>rendered .
    >>>>>>>>
    >>>>>>>Try this :
    >>>>>>>>
    >>>>>>><html xmlns="http://www.w3.org/1999/xhtml" runat="server"
    >>>>>>>id="some ID">
    >>>>>>>>
    >>>>>>><scrip t runat="server">
    >>>>>>>someID.A ttributes("xml: lang") = "en-US"
    >>>>>>></script>
    >>>>>>>>
    >>>>>>>>
    >>>>>>>>
    >>>>>>>Juan T. Llibre, asp.net MVP
    >>>>>>>asp.ne t faq : http://asp.net.do/faq/
    >>>>>>>foros de asp.net, en español : http://asp.net.do/foros/
    >>>>>>>======== =============== ===============
    >>>>>>>>
    >>>>>>>"Lee C." <nomail@spam.co mwrote in message
    >>>>>>>news:O%2 3KsAQA2IHA.4572 @TK2MSFTNGP03.p hx.gbl...
    >>>>>>>>>I think I have discovered a bug in ASP.NET, related to I18N.
    >>>>>>>>>
    >>>>>>>>In ASP.NET 3.5 I have to set runat="server" on the html element to
    >>>>>>>>use explicit expressions. It appears that
    >>>>>>>>ASP.N ET
    >>>>>>>>eats the xml:lang attribute on the html element when it is set to
    >>>>>>>>runat=" server".
    >>>>>>>>>
    >>>>>>>>Of course I want to replace the hardcoded "en-US" values with
    >>>>>>>>(resour ce) explicit expressions; but, for
    >>>>>>>>simplic ity,
    >>>>>>>>try this:
    >>>>>>>>>
    >>>>>>>><html runat="server" xmlns="http://www.w3.org/1999/xhtml"
    >>>>>>>>xml:lan g="en-US" lang="en-US" dir="ltr">
    >>>>>>>>>
    >>>>>>>>...An d you will find that no xml:lang attribute is rendered to the
    >>>>>>>>browser ! Remove the runat="server", and,
    >>>>>>>>voila ,
    >>>>>>>>the
    >>>>>>>>xml:lan g attribute is rendered. :[
    >>>>>>>>>
    >>>>>>>>...An y ideas?
    >>>>>>>>>
    >>>>>>>>Cordial ly,
    >>>>>>>>Lee
    >>>>>>>>>
    >>>>>>>>>
    >>>>>>>>
    >>>>>>>>
    >>>>>>>>
    >>>>>>>
    >>>>>>>
    >>>>>>
    >>>>>>
    >>>>>>
    >>>>>
    >>>>>
    >>>>
    >>>>
    >>>
    >>>
    >>
    >>
    >
    >
    >
    >

    Comment

    • Juan T. Llibre

      #3
      Re: ASP.NET Internationaliz ation bug?

      re:
      !versus the spirit of what we're trying to accomplish: telling user agents who our
      !intended audiences is, by language, as best we can...which is why I'm *also*
      !setting lang in the HTTP headers and in page meta tags

      What ? You don't set a language/culture in web.config, too ?
      There's a use for overkill ! ( only kidding... )

      I don't see too clearly the purpose of declaring a single language for a web page.

      I do see a use for declaring specific language attributes in a *collection* of xml documents,
      so that individual documents can be parsed for a particular language content.

      But, ymmv...

      I'd still be interested in knowing what the reply is to your bug report.
      I bet you'll get back : "That's by design". <g>

      Don't forget to let us all know what happens with that, OK ?
      Thanks for an interesting discussion.




      Juan T. Llibre, asp.net MVP
      asp.net faq : http://asp.net.do/faq/
      foros de asp.net, en español : http://asp.net.do/foros/
      =============== =============== ========
      "Lee C." <nomail@spam.co mwrote in message news:en1PZVT2IH A.524@TK2MSFTNG P05.phx.gbl...
      Juan,
      >
      In theory, I like your idea of investigating "the standard"; but, in practice it has serious problems, as it often
      does. First, you are referring to the XML standard, which is not as appropriate as HTML and XHTML standards. Second,
      none of them are crystal clear on best practices for I18N. There is a lot of *legal* (by the standard) syntax, that
      makes no sense, or makes some sense without being clearly best. The W3C site often states something to the effect of,
      "some are doing this, some are doing that, on your own site, at least do something and only time will tell what is
      best."
      >
      Check out these fine examples, which mirror my syntax, on the W3C site.
      >
      Internationaliz ation Best Practices: Specifying Language in XHTML & HTML Content

      >
      >
      Tutorial: Declaring Language in XHTML and HTML (Draft)

      >
      Juan, you wrote:
      >But, it seems to me that setting xml:lang for the html tag's *attribute* values is unneeded, since they must
      >be in English, and they must be attributes set to a language identifier, as defined by IETF RFC 4646
      >(http://www.ietf.org/rfc/rfc4646.txt).
      >
      You're not setting it for "the tag's *attribute*", you're setting it for the *contents*, all contents, of the element
      (unless overridden by a sub-setting), which makes perfect sense so that I don't have to set it individually on every
      child element--that is the power of a hierarchy! You seem to be focused on the technical, with some misunderstandin g,
      versus the spirit of what we're trying to accomplish: telling user agents who our intended audiences is, by language,
      as best we can...which is why I'm *also* setting lang in the HTTP headers and in page meta tags.
      >
      , Lee
      >
      >
      "Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message news:OYI4upK2IH A.5140@TK2MSFTN GP02.phx.gbl...
      >re:
      >!I found an MSDN document that explains why what I'm trying to do should work
      >>
      >Lee,
      >>
      >From :
      >>
      >http://www.w3.org/TR/REC-xml/
      >>
      >"A special attribute named xml:lang may be inserted in documents to specify the
      >language used in the contents and attribute values of any element in an XML document."
      >>
      >If anything, I can see xml:lang being declared for specific content values, for example :
      >>
      ><p xml:lang="en-GB">What colour is it?</p>
      ><p xml:lang="en-US">What color is it?</p>
      >>
      >Then, an xml parser could identify regional US and British spellings but, given that *all* the attribute values
      >must be in English in an html doc, what would be the purpose of declaring xml:lang for the html markup ?
      >>
      >A similar explanation is given here :
      >http://www.simonstl.com/xmlprim/xmlupdate/atts.html
      >>
      >---000---
      ><SECTION>
      ><DESCRIPTION xml:lang="en">
      >Caesar begins by describing the geography of Gaul.
      ></DESCRIPTION>
      ><QUOTE xml:lang="la">
      >Gallia est omnis divisa in partes tres, quarum unam incolunt Belgae,
      >aliam Aquitani, tertiam qui ipsorum lingua Celtae, nostra Galli appellantur.
      ></QUOTE>
      >---000---
      >>
      >That's perfectly good usage for xml:lang, as a parser could selectively identify content in different languages.
      >>
      >But, it seems to me that setting xml:lang for the html tag's *attribute* values is unneeded, since they must
      >be in English, and they must be attributes set to a language identifier, as defined by IETF RFC 4646
      >(http://www.ietf.org/rfc/rfc4646.txt).
      >>
      >So, I think that requisite pretty well establishes the futility
      >of setting xml:lang for all the attributes in an html document.
      >>
      >If anything, it seems that the xml:lang attribute is included in the
      >html server tag for compatibility purposes, or perhaps out of ignorance.
      >>
      >If there's a need to identify that the *contents* of a particular markup tag are in a
      >specific language, that identification can be included in the tag itself, for example :
      >>
      ><div lang="MX-es" xml:lang="MX-es">
      >Algo de contenido en español mejicano.
      ></div>
      >>
      >That makes a lot more sense than setting xml:lang for the attribute values in the html tag.
      >>
      >>
      >>
      >Juan T. Llibre, asp.net MVP
      >asp.net faq : http://asp.net.do/faq/
      >foros de asp.net, en español : http://asp.net.do/foros/
      >============== =============== =========
      >"Lee C." <no.spam@spamme r.comwrote in message news:%23ocUnoI2 IHA.2188@TK2MSF TNGP04.phx.gbl. ..
      >>>I found an MSDN document that explains why what I'm trying to do should work.
      >>>
      >>ASP.NET Web Server Controls Overview
      >>http://msdn.microsoft.com/en-us/library/zsyt68f1.aspx
      >>>
      >>Note the distinction between HTML Server Controls and Web Server Controls in the document. Also, note the
      >>explanation
      >>of "pass-through" attributes for HTML Server Controls.
      >>>
      >>Two quotes that sum it up:
      >> 1. Any HTML element on a page can be converted to an HTML server control by adding the attribute runat="server".
      >> 2. You can add any attributes you need to an HTML server control and the page framework will render them without
      >>any change in functionality.
      >>>
      >>, Lee
      >>>
      >>"Lee C." <no.spam@spamme r.comwrote in message news:Oe38JYI2IH A.4772@TK2MSFTN GP03.phx.gbl...
      >>>Juan,
      >>>>
      >>>I appreciate your trying to help, but you're wrong, and you are the one who is confused. :]
      >>>>
      >>>I am *not* disputing that when inserted programmaticall y, the xml:lang attribute renders to the browser. I did
      >>>just
      >>>that as a work around (right after I discovered this bug); but, I should not have to.
      >>>>
      >>>I am *not* confusing html attributes with runat="server" attributes, as you call them. Using your logic, none of
      >>>the
      >>>declarativ e (html) attributes should render to the browser after I add the runat="server" in ASP.NET; yet all of
      >>>them
      >>>(xmlns, lang, and dir) do--except xml:lang.
      >>>>
      >>>I started with an html element with 4 attributes (xmlns, lang, xml:lang, and dir) all set declaratively. With *no*
      >>>5th attribute of runat="server", all 4 attributes render. If I add the 5th attribute of runat="server", which does
      >>>not and should not render, I no longer get all 4 attributes that should render (xmlns, lang, xml:lang, and dir), I
      >>>only get 3 (xmlns, lang, and dir). My logic says I should get 4, your says I should get 3? It would be 4 or 0,
      >>>and
      >>>4 is right. Not 0...and not 3.
      >>>>
      >>>When I add runat="server", it does not magically make the xml:lang attribute a server-side attribute, while keeping
      >>>the other three attributes as "html" attributes. All four are still "html" attributes--which should render.
      >>>>
      >>>I think the simplification of my example may be confusing you. It is odd that, in my example, I set runat="server"
      >>>but do not have any server-side attributes. (I have all 4 as literal strings, for simplicity of an example.)
      >>>Well,
      >>>in my real-world use, I do have server-side attributes, which I want set declaratively (no code-beside and no
      >>>script). I have:
      >>>>
      >>><html runat="server" xmlns="http://www.w3.org/1999/xhtml"
      >>> xml:lang="<%$ Resources:Globa lLang, ContentAudience Language %>"
      >>> lang="<%$ Resources:Globa lLang, ContentAudience Language %>"
      >>> dir="ltr">
      >>>>
      >>>Both of those declarative explicit localization expressions should work without my having to write any more
      >>>"procedura l" (code-beside) code or script. It actually does work fine for the lang attribute--as it should; but
      >>>not
      >>>for the xml:lang attribute--***which is a bug***.
      >>>>
      >>>, Lee
      >>>>
      >>>"Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message news:u0WzB9H2IH A.4188@TK2MSFTN GP04.phx.gbl...
      >>>>re:
      >>>>!I think you are misunderstandin g, Juan.
      >>>>>
      >>>>Well, I think you are misunderstandin g *me*.
      >>>>>
      >>>>re:
      >>>>!I had the xml:lang attribute in the html tag (declaratively) , like this:
      >>>>>...and it renders to the browser, as it should.
      >>>>>
      >>>>Yes, because it's standard html.
      >>>>>
      >>>>re:
      >>>>!If I simply add runat="server"
      >>>>>
      >>>>That declares the control to run server side.
      >>>>>
      >>>>For any attribute to be programmed server-side you need a script,
      >>>>just as you need a script to modify any server control's attributes.
      >>>>>
      >>>>Did you run the sample page I sent ?
      >>>>>
      >>>>It iterates throught the attributes for the html server control,
      >>>>and shows that the xml:lang attribute *is* added programmaticall y.
      >>>>>
      >>>>re:
      >>>>!If I simply add runat="server", leaving in the xml:lang attribute that
      >>>>!renders without runat="server", all of the (declarative) attributes are
      >>>>!rendered to the browser--except the xml:lang attribute! That is a bug.
      >>>>>
      >>>>I think you're confusing html attributes with runat="server" attributes.
      >>>>>
      >>>>Html attributes can be inserted in normal html.
      >>>>Server-side attributes must be inserted in code.
      >>>>>
      >>>>Maybe I'm not explaining this as well as I should.
      >>>>Try to get someone else's opinion on this matter, if you don't accept mine.
      >>>>>
      >>>>>
      >>>>>
      >>>>Juan T. Llibre, asp.net MVP
      >>>>asp.net faq : http://asp.net.do/faq/
      >>>>foros de asp.net, en español : http://asp.net.do/foros/
      >>>>=========== =============== ============
      >>>>"Lee C." <no.spam@spamme r.comwrote in message news:enam1gH2IH A.4552@TK2MSFTN GP04.phx.gbl...
      >>>>>>I think you are misunderstandin g, Juan. I had the xml:lang attribute in the html tag (declaratively) , like this:
      >>>>>>
      >>>>><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US" dir="ltr">
      >>>>>>
      >>>>>...and it renders to the browser, as it should.
      >>>>>>
      >>>>>If I simply add runat="server", leaving in the xml:lang attribute that renders without runat="server", all of the
      >>>>>(declarati ve) attributes are rendered to the browser--except the xml:lang attribute! That is a bug.
      >>>>>>
      >>>>><html runat="server" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US" dir="ltr">
      >>>>>>
      >>>>>Cordiall y,
      >>>>>Lee
      >>>>>>
      >>>>>>
      >>>>>"Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message news:eyrwjUH2IH A.3920@TK2MSFTN GP02.phx.gbl...
      >>>>>>Here's a full example which shows that the xml:lang attribute is added programmaticall y :
      >>>>>>>
      >>>>>>attribute s.aspx:
      >>>>>>----------------------
      >>>>>><%@ Page Language="C#" AutoEventWireup ="True" %>
      >>>>>><html xmlns="http://www.w3.org/1999/xhtml" runat="server" id="Myid" >
      >>>>>><script language="C#" runat="server">
      >>>>>>void Page_Load(Objec t sender, EventArgs e)
      >>>>>>{
      >>>>>>Myid.Attr ibutes.Add("xml :lang", "es");
      >>>>>>Message.I nnerHtml = "<h4>The html control attributes collection contains:</h4>";
      >>>>>>IEnumerat or keys = Myid.Attributes .Keys.GetEnumer ator();
      >>>>>>while (keys.MoveNext( ))
      >>>>>>{
      >>>>>>String key = (String)keys.Cu rrent;
      >>>>>>Message.I nnerHtml += key + "=" + Myid.Attributes[key] + "<br />";
      >>>>>>}
      >>>>>>}
      >>>>>></script>
      >>>>>><head id="Head1" runat="server">
      >>>>>><title>Th e html control attributes collection</title>
      >>>>>></head>
      >>>>>><body>
      >>>>>><form id="Form1" runat="server">
      >>>>>><h3>HtmlC ontrol Attribute Collection Example</h3>
      >>>>>><br />
      >>>>>><span id="Message" enableviewstate ="false" runat="server" />
      >>>>>></form>
      >>>>>></body>
      >>>>>></html>
      >>>>>>----------------
      >>>>>>>
      >>>>>>I don't think it's a bug to have to add an attribute programmaticall y,
      >>>>>>because the runat="server" tag only *declares* the html control as a programmable control.
      >>>>>>>
      >>>>>>To actually program it, you must use a script.
      >>>>>>>
      >>>>>>>
      >>>>>>>
      >>>>>>>
      >>>>>>Juan T. Llibre, asp.net MVP
      >>>>>>asp.net faq : http://asp.net.do/faq/
      >>>>>>foros de asp.net, en español : http://asp.net.do/foros/
      >>>>>>========= =============== ==============
      >>>>>>"Lee C." <no.spam@spamme r.comwrote in message news:e0rLaPG2IH A.4772@TK2MSFTN GP03.phx.gbl...
      >>>>>>>Thanks , Juan.
      >>>>>>>>
      >>>>>>>I already added similar code to a page event in my masterpage code-beside.
      >>>>>>>>
      >>>>>>> elHtml.Attribut es.Add("xml:lan g", Resources.Globa lLang.ContentAu dienceLanguage)
      >>>>>>>>
      >>>>>>>To me, that is a temporary workaround. I still want to understand whether the "eating" of the attribute I
      >>>>>>>original ly
      >>>>>>>posted about is a bug, or if this is actually happening for a reason.
      >>>>>>>>
      >>>>>>>Cordiall y,
      >>>>>>>Lee
      >>>>>>>>
      >>>>>>>>
      >>>>>>>"Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message news:%23gBUqSC2 IHA.4772@TK2MSF TNGP03.phx.gbl. ..
      >>>>>>>>Hi, Lee.
      >>>>>>>>>
      >>>>>>>>re:
      >>>>>>>>!<htm l runat="server" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US" dir="ltr">
      >>>>>>>>!no xml:lang attribute is rendered to the browser!
      >>>>>>>>!Remo ve the runat="server", and, voila, the xml:lang attribute is rendered.
      >>>>>>>>>
      >>>>>>>>Try this :
      >>>>>>>>>
      >>>>>>>><html xmlns="http://www.w3.org/1999/xhtml" runat="server" id="someID">
      >>>>>>>>>
      >>>>>>>><scri pt runat="server">
      >>>>>>>>someID. Attributes("xml :lang") = "en-US"
      >>>>>>>></script>
      >>>>>>>>>
      >>>>>>>>>
      >>>>>>>>>
      >>>>>>>>Juan T. Llibre, asp.net MVP
      >>>>>>>>asp.n et faq : http://asp.net.do/faq/
      >>>>>>>>foros de asp.net, en español : http://asp.net.do/foros/
      >>>>>>>>======= =============== =============== =
      >>>>>>>>>
      >>>>>>>>"Lee C." <nomail@spam.co mwrote in message news:O%23KsAQA2 IHA.4572@TK2MSF TNGP03.phx.gbl. ..
      >>>>>>>>>>I think I have discovered a bug in ASP.NET, related to I18N.
      >>>>>>>>>>
      >>>>>>>>>In ASP.NET 3.5 I have to set runat="server" on the html element to use explicit expressions. It appears that
      >>>>>>>>>ASP.NE T
      >>>>>>>>>eats the xml:lang attribute on the html element when it is set to runat="server".
      >>>>>>>>>>
      >>>>>>>>>Of course I want to replace the hardcoded "en-US" values with (resource) explicit expressions; but, for
      >>>>>>>>>simpli city,
      >>>>>>>>>try this:
      >>>>>>>>>>
      >>>>>>>>><htm l runat="server" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US" dir="ltr">
      >>>>>>>>>>
      >>>>>>>>>...A nd you will find that no xml:lang attribute is rendered to the browser! Remove the runat="server", and,
      >>>>>>>>>voil a,
      >>>>>>>>>the
      >>>>>>>>>xml:la ng attribute is rendered. :[
      >>>>>>>>>>
      >>>>>>>>>...A ny ideas?
      >>>>>>>>>>
      >>>>>>>>>Cordia lly,
      >>>>>>>>>Lee
      >>>>>>>>>>
      >>>>>>>>>>
      >>>>>>>>>
      >>>>>>>>>
      >>>>>>>>>
      >>>>>>>>
      >>>>>>>>
      >>>>>>>
      >>>>>>>
      >>>>>>>
      >>>>>>
      >>>>>>
      >>>>>
      >>>>>
      >>>>
      >>>>
      >>>
      >>>
      >>
      >>
      >>
      >>
      >
      >

      Comment

      • Lee C.

        #4
        Re: ASP.NET Internationaliz ation bug?

        Juan,

        My use of language and culture in ASP.Net is a bit different than most. I
        have registered numerous country-code-specific domains (mysite.ca,
        mysite.co.uk, mysite.com.au, etc.), which resolve to a singular "ASP.Net Web
        Site". Nothing new there. However, I'm not doing the ASP.Net usual of
        letting the user agent (HTTP header 'accept-language') determine which
        language visitors get; I have the country-code TLD drive it. Also, it's not
        just the language of my content that varies by cc TLD, it's the content,
        too; but, lang attributes play a critical role in informing user agents
        (including search engine bots) for what "country" my content is aimed.

        I have already found, first-hand, that the better of the major search
        engines use the cc TLD *and* the HTML lang/xml:lang to determine whether a
        domain's documents (mysite.com.au/my-document.aspx) should show up when a
        searcher searches with the 'Only from Australia' checkbox checked on
        Live.com, for example.

        I'm not setting lang attributes for fun; I'm doing it to correct search
        engine results. ASP.NET should make it easy for me--and, it does, but there
        is a bug in the implementation.

        I appreciate your interest and effort to help.

        , Lee


        "Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message
        news:uBUnQxT2IH A.4164@TK2MSFTN GP03.phx.gbl...
        re:
        !versus the spirit of what we're trying to accomplish: telling user
        agents who our
        !intended audiences is, by language, as best we can...which is why I'm
        *also*
        !setting lang in the HTTP headers and in page meta tags
        >
        What ? You don't set a language/culture in web.config, too ?
        There's a use for overkill ! ( only kidding... )
        >
        I don't see too clearly the purpose of declaring a single language for a
        web page.
        >
        I do see a use for declaring specific language attributes in a
        *collection* of xml documents,
        so that individual documents can be parsed for a particular language
        content.
        >
        But, ymmv...
        >
        I'd still be interested in knowing what the reply is to your bug report.
        I bet you'll get back : "That's by design". <g>
        >
        Don't forget to let us all know what happens with that, OK ?
        Thanks for an interesting discussion.
        >
        >
        >
        >
        Juan T. Llibre, asp.net MVP
        asp.net faq : http://asp.net.do/faq/
        foros de asp.net, en español : http://asp.net.do/foros/
        =============== =============== ========
        "Lee C." <nomail@spam.co mwrote in message
        news:en1PZVT2IH A.524@TK2MSFTNG P05.phx.gbl...
        >Juan,
        >>
        >In theory, I like your idea of investigating "the standard"; but, in
        >practice it has serious problems, as it often does. First, you are
        >referring to the XML standard, which is not as appropriate as HTML and
        >XHTML standards. Second, none of them are crystal clear on best
        >practices for I18N. There is a lot of *legal* (by the standard) syntax,
        >that makes no sense, or makes some sense without being clearly best. The
        >W3C site often states something to the effect of, "some are doing this,
        >some are doing that, on your own site, at least do something and only
        >time will tell what is best."
        >>
        >Check out these fine examples, which mirror my syntax, on the W3C site.
        >>
        >Internationali zation Best Practices: Specifying Language in XHTML & HTML
        >Content
        >http://www.w3.org/TR/i18n-html-tech-...0429.092928424
        >>
        >>
        >Tutorial: Declaring Language in XHTML and HTML (Draft)
        >http://www.w3.org/International/tuto...Slide0160.html
        >>
        >Juan, you wrote:
        >>But, it seems to me that setting xml:lang for the html tag's *attribute*
        >>values is unneeded, since they must
        >>be in English, and they must be attributes set to a language identifier,
        >>as defined by IETF RFC 4646
        >>(http://www.ietf.org/rfc/rfc4646.txt).
        >>
        >You're not setting it for "the tag's *attribute*", you're setting it for
        >the *contents*, all contents, of the element (unless overridden by a
        >sub-setting), which makes perfect sense so that I don't have to set it
        >individually on every child element--that is the power of a hierarchy!
        >You seem to be focused on the technical, with some misunderstandin g,
        >versus the spirit of what we're trying to accomplish: telling user agents
        >who our intended audiences is, by language, as best we can...which is why
        >I'm *also* setting lang in the HTTP headers and in page meta tags.
        >>
        >, Lee
        >>
        >>
        >"Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message
        >news:OYI4upK2I HA.5140@TK2MSFT NGP02.phx.gbl.. .
        >>re:
        >>!I found an MSDN document that explains why what I'm trying to do
        >>should work
        >>>
        >>Lee,
        >>>
        >>From :
        >>>
        >>http://www.w3.org/TR/REC-xml/
        >>>
        >>"A special attribute named xml:lang may be inserted in documents to
        >>specify the
        >>language used in the contents and attribute values of any element in an
        >>XML document."
        >>>
        >>If anything, I can see xml:lang being declared for specific content
        >>values, for example :
        >>>
        >><p xml:lang="en-GB">What colour is it?</p>
        >><p xml:lang="en-US">What color is it?</p>
        >>>
        >>Then, an xml parser could identify regional US and British spellings
        >>but, given that *all* the attribute values
        >>must be in English in an html doc, what would be the purpose of
        >>declaring xml:lang for the html markup ?
        >>>
        >>A similar explanation is given here :
        >>http://www.simonstl.com/xmlprim/xmlupdate/atts.html
        >>>
        >>---000---
        >><SECTION>
        >><DESCRIPTIO N xml:lang="en">
        >>Caesar begins by describing the geography of Gaul.
        >></DESCRIPTION>
        >><QUOTE xml:lang="la">
        >>Gallia est omnis divisa in partes tres, quarum unam incolunt Belgae,
        >>aliam Aquitani, tertiam qui ipsorum lingua Celtae, nostra Galli
        >>appellantur .
        >></QUOTE>
        >>---000---
        >>>
        >>That's perfectly good usage for xml:lang, as a parser could selectively
        >>identify content in different languages.
        >>>
        >>But, it seems to me that setting xml:lang for the html tag's *attribute*
        >>values is unneeded, since they must
        >>be in English, and they must be attributes set to a language identifier,
        >>as defined by IETF RFC 4646
        >>(http://www.ietf.org/rfc/rfc4646.txt).
        >>>
        >>So, I think that requisite pretty well establishes the futility
        >>of setting xml:lang for all the attributes in an html document.
        >>>
        >>If anything, it seems that the xml:lang attribute is included in the
        >>html server tag for compatibility purposes, or perhaps out of ignorance.
        >>>
        >>If there's a need to identify that the *contents* of a particular markup
        >>tag are in a
        >>specific language, that identification can be included in the tag
        >>itself, for example :
        >>>
        >><div lang="MX-es" xml:lang="MX-es">
        >>Algo de contenido en español mejicano.
        >></div>
        >>>
        >>That makes a lot more sense than setting xml:lang for the attribute
        >>values in the html tag.
        >>>
        >>>
        >>>
        >>Juan T. Llibre, asp.net MVP
        >>asp.net faq : http://asp.net.do/faq/
        >>foros de asp.net, en español : http://asp.net.do/foros/
        >>============= =============== ==========
        >>"Lee C." <no.spam@spamme r.comwrote in message
        >>news:%23ocUno I2IHA.2188@TK2M SFTNGP04.phx.gb l...
        >>>>I found an MSDN document that explains why what I'm trying to do should
        >>>>work.
        >>>>
        >>>ASP.NET Web Server Controls Overview
        >>>http://msdn.microsoft.com/en-us/library/zsyt68f1.aspx
        >>>>
        >>>Note the distinction between HTML Server Controls and Web Server
        >>>Controls in the document. Also, note the explanation
        >>>of "pass-through" attributes for HTML Server Controls.
        >>>>
        >>>Two quotes that sum it up:
        >>> 1. Any HTML element on a page can be converted to an HTML server
        >>>control by adding the attribute runat="server".
        >>> 2. You can add any attributes you need to an HTML server control and
        >>>the page framework will render them without
        >>>any change in functionality.
        >>>>
        >>>, Lee
        >>>>
        >>>"Lee C." <no.spam@spamme r.comwrote in message
        >>>news:Oe38JYI 2IHA.4772@TK2MS FTNGP03.phx.gbl ...
        >>>>Juan,
        >>>>>
        >>>>I appreciate your trying to help, but you're wrong, and you are the
        >>>>one who is confused. :]
        >>>>>
        >>>>I am *not* disputing that when inserted programmaticall y, the xml:lang
        >>>>attribute renders to the browser. I did just
        >>>>that as a work around (right after I discovered this bug); but, I
        >>>>should not have to.
        >>>>>
        >>>>I am *not* confusing html attributes with runat="server" attributes,
        >>>>as you call them. Using your logic, none of the
        >>>>declarati ve (html) attributes should render to the browser after I add
        >>>>the runat="server" in ASP.NET; yet all of them
        >>>>(xmlns, lang, and dir) do--except xml:lang.
        >>>>>
        >>>>I started with an html element with 4 attributes (xmlns, lang,
        >>>>xml:lang, and dir) all set declaratively. With *no*
        >>>>5th attribute of runat="server", all 4 attributes render. If I add
        >>>>the 5th attribute of runat="server", which does
        >>>>not and should not render, I no longer get all 4 attributes that
        >>>>should render (xmlns, lang, xml:lang, and dir), I
        >>>>only get 3 (xmlns, lang, and dir). My logic says I should get 4, your
        >>>>says I should get 3? It would be 4 or 0, and
        >>>>4 is right. Not 0...and not 3.
        >>>>>
        >>>>When I add runat="server", it does not magically make the xml:lang
        >>>>attribute a server-side attribute, while keeping
        >>>>the other three attributes as "html" attributes. All four are still
        >>>>"html" attributes--which should render.
        >>>>>
        >>>>I think the simplification of my example may be confusing you. It is
        >>>>odd that, in my example, I set runat="server"
        >>>>but do not have any server-side attributes. (I have all 4 as literal
        >>>>strings, for simplicity of an example.) Well,
        >>>>in my real-world use, I do have server-side attributes, which I want
        >>>>set declaratively (no code-beside and no
        >>>>script). I have:
        >>>>>
        >>>><html runat="server" xmlns="http://www.w3.org/1999/xhtml"
        >>>> xml:lang="<%$ Resources:Globa lLang, ContentAudience Language %>"
        >>>> lang="<%$ Resources:Globa lLang, ContentAudience Language %>"
        >>>> dir="ltr">
        >>>>>
        >>>>Both of those declarative explicit localization expressions should
        >>>>work without my having to write any more
        >>>>"procedural " (code-beside) code or script. It actually does work fine
        >>>>for the lang attribute--as it should; but not
        >>>>for the xml:lang attribute--***which is a bug***.
        >>>>>
        >>>>, Lee
        >>>>>
        >>>>"Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message
        >>>>news:u0WzB9 H2IHA.4188@TK2M SFTNGP04.phx.gb l...
        >>>>>re:
        >>>>>!I think you are misunderstandin g, Juan.
        >>>>>>
        >>>>>Well, I think you are misunderstandin g *me*.
        >>>>>>
        >>>>>re:
        >>>>>!I had the xml:lang attribute in the html tag (declaratively) , like
        >>>>>this:
        >>>>>>...and it renders to the browser, as it should.
        >>>>>>
        >>>>>Yes, because it's standard html.
        >>>>>>
        >>>>>re:
        >>>>>!If I simply add runat="server"
        >>>>>>
        >>>>>That declares the control to run server side.
        >>>>>>
        >>>>>For any attribute to be programmed server-side you need a script,
        >>>>>just as you need a script to modify any server control's attributes.
        >>>>>>
        >>>>>Did you run the sample page I sent ?
        >>>>>>
        >>>>>It iterates throught the attributes for the html server control,
        >>>>>and shows that the xml:lang attribute *is* added programmaticall y.
        >>>>>>
        >>>>>re:
        >>>>>!If I simply add runat="server", leaving in the xml:lang attribute
        >>>>>that
        >>>>>!renders without runat="server", all of the (declarative)
        >>>>>attribut es are
        >>>>>!rendere d to the browser--except the xml:lang attribute! That is a
        >>>>>bug.
        >>>>>>
        >>>>>I think you're confusing html attributes with runat="server"
        >>>>>attributes .
        >>>>>>
        >>>>>Html attributes can be inserted in normal html.
        >>>>>Server-side attributes must be inserted in code.
        >>>>>>
        >>>>>Maybe I'm not explaining this as well as I should.
        >>>>>Try to get someone else's opinion on this matter, if you don't accept
        >>>>>mine.
        >>>>>>
        >>>>>>
        >>>>>>
        >>>>>Juan T. Llibre, asp.net MVP
        >>>>>asp.net faq : http://asp.net.do/faq/
        >>>>>foros de asp.net, en español : http://asp.net.do/foros/
        >>>>>========== =============== =============
        >>>>>"Lee C." <no.spam@spamme r.comwrote in message
        >>>>>news:enam1 gH2IHA.4552@TK2 MSFTNGP04.phx.g bl...
        >>>>>>>I think you are misunderstandin g, Juan. I had the xml:lang attribute
        >>>>>>>in the html tag (declaratively) , like this:
        >>>>>>>
        >>>>>><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"
        >>>>>>lang="e n-US" dir="ltr">
        >>>>>>>
        >>>>>>...and it renders to the browser, as it should.
        >>>>>>>
        >>>>>>If I simply add runat="server", leaving in the xml:lang attribute
        >>>>>>that renders without runat="server", all of the
        >>>>>>(declarat ive) attributes are rendered to the browser--except the
        >>>>>>xml:lan g attribute! That is a bug.
        >>>>>>>
        >>>>>><html runat="server" xmlns="http://www.w3.org/1999/xhtml"
        >>>>>>xml:lang= "en-US" lang="en-US" dir="ltr">
        >>>>>>>
        >>>>>>Cordially ,
        >>>>>>Lee
        >>>>>>>
        >>>>>>>
        >>>>>>"Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message
        >>>>>>news:eyrw jUH2IHA.3920@TK 2MSFTNGP02.phx. gbl...
        >>>>>>>Here's a full example which shows that the xml:lang attribute is
        >>>>>>>added programmaticall y :
        >>>>>>>>
        >>>>>>>attribut es.aspx:
        >>>>>>>----------------------
        >>>>>>><%@ Page Language="C#" AutoEventWireup ="True" %>
        >>>>>>><html xmlns="http://www.w3.org/1999/xhtml" runat="server" id="Myid"
        >>>>>>> >
        >>>>>>><scrip t language="C#" runat="server">
        >>>>>>>void Page_Load(Objec t sender, EventArgs e)
        >>>>>>>{
        >>>>>>>Myid.Att ributes.Add("xm l:lang", "es");
        >>>>>>>Message. InnerHtml = "<h4>The html control attributes collection
        >>>>>>>contains :</h4>";
        >>>>>>>IEnumera tor keys = Myid.Attributes .Keys.GetEnumer ator();
        >>>>>>>while (keys.MoveNext( ))
        >>>>>>>{
        >>>>>>>String key = (String)keys.Cu rrent;
        >>>>>>>Message. InnerHtml += key + "=" + Myid.Attributes[key] + "<br />";
        >>>>>>>}
        >>>>>>>}
        >>>>>>></script>
        >>>>>>><head id="Head1" runat="server">
        >>>>>>><title>T he html control attributes collection</title>
        >>>>>>></head>
        >>>>>>><body>
        >>>>>>><form id="Form1" runat="server">
        >>>>>>><h3>Html Control Attribute Collection Example</h3>
        >>>>>>><br />
        >>>>>>><span id="Message" enableviewstate ="false" runat="server" />
        >>>>>>></form>
        >>>>>>></body>
        >>>>>>></html>
        >>>>>>>----------------
        >>>>>>>>
        >>>>>>>I don't think it's a bug to have to add an attribute
        >>>>>>>programm atically,
        >>>>>>>becaus e the runat="server" tag only *declares* the html control as
        >>>>>>>a programmable control.
        >>>>>>>>
        >>>>>>>To actually program it, you must use a script.
        >>>>>>>>
        >>>>>>>>
        >>>>>>>>
        >>>>>>>>
        >>>>>>>Juan T. Llibre, asp.net MVP
        >>>>>>>asp.ne t faq : http://asp.net.do/faq/
        >>>>>>>foros de asp.net, en español : http://asp.net.do/foros/
        >>>>>>>======== =============== ===============
        >>>>>>>"Lee C." <no.spam@spamme r.comwrote in message
        >>>>>>>news:e0r LaPG2IHA.4772@T K2MSFTNGP03.phx .gbl...
        >>>>>>>>Thank s, Juan.
        >>>>>>>>>
        >>>>>>>>I already added similar code to a page event in my masterpage
        >>>>>>>>code-beside.
        >>>>>>>>>
        >>>>>>>> elHtml.Attribut es.Add("xml:lan g",
        >>>>>>>>Resourc es.GlobalLang.C ontentAudienceL anguage)
        >>>>>>>>>
        >>>>>>>>To me, that is a temporary workaround. I still want to understand
        >>>>>>>>wheth er the "eating" of the attribute I
        >>>>>>>>origina lly
        >>>>>>>>poste d about is a bug, or if this is actually happening for a
        >>>>>>>>reaso n.
        >>>>>>>>>
        >>>>>>>>Cordial ly,
        >>>>>>>>Lee
        >>>>>>>>>
        >>>>>>>>>
        >>>>>>>>"Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message
        >>>>>>>>news:%2 3gBUqSC2IHA.477 2@TK2MSFTNGP03. phx.gbl...
        >>>>>>>>>Hi, Lee.
        >>>>>>>>>>
        >>>>>>>>>re:
        >>>>>>>>>!<ht ml runat="server" xmlns="http://www.w3.org/1999/xhtml"
        >>>>>>>>>xml:la ng="en-US" lang="en-US" dir="ltr">
        >>>>>>>>>!no xml:lang attribute is rendered to the browser!
        >>>>>>>>>!Remov e the runat="server", and, voila, the xml:lang attribute
        >>>>>>>>>is rendered.
        >>>>>>>>>>
        >>>>>>>>>Try this :
        >>>>>>>>>>
        >>>>>>>>><htm l xmlns="http://www.w3.org/1999/xhtml" runat="server"
        >>>>>>>>>id="so meID">
        >>>>>>>>>>
        >>>>>>>>><scrip t runat="server">
        >>>>>>>>>someID .Attributes("xm l:lang") = "en-US"
        >>>>>>>>></script>
        >>>>>>>>>>
        >>>>>>>>>>
        >>>>>>>>>>
        >>>>>>>>>Juan T. Llibre, asp.net MVP
        >>>>>>>>>asp.ne t faq : http://asp.net.do/faq/
        >>>>>>>>>foro s de asp.net, en español : http://asp.net.do/foros/
        >>>>>>>>>====== =============== =============== ==
        >>>>>>>>>>
        >>>>>>>>>"Lee C." <nomail@spam.co mwrote in message
        >>>>>>>>>news:O %23KsAQA2IHA.45 72@TK2MSFTNGP03 .phx.gbl...
        >>>>>>>>>>>I think I have discovered a bug in ASP.NET, related to I18N.
        >>>>>>>>>>>
        >>>>>>>>>>In ASP.NET 3.5 I have to set runat="server" on the html element
        >>>>>>>>>>to use explicit expressions. It appears that
        >>>>>>>>>>ASP.N ET
        >>>>>>>>>>eat s the xml:lang attribute on the html element when it is set
        >>>>>>>>>>to runat="server".
        >>>>>>>>>>>
        >>>>>>>>>>Of course I want to replace the hardcoded "en-US" values with
        >>>>>>>>>>(reso urce) explicit expressions; but, for
        >>>>>>>>>>simpl icity,
        >>>>>>>>>>try this:
        >>>>>>>>>>>
        >>>>>>>>>><ht ml runat="server" xmlns="http://www.w3.org/1999/xhtml"
        >>>>>>>>>>xml:l ang="en-US" lang="en-US" dir="ltr">
        >>>>>>>>>>>
        >>>>>>>>>>...An d you will find that no xml:lang attribute is rendered to
        >>>>>>>>>>the browser! Remove the runat="server", and,
        >>>>>>>>>>voila ,
        >>>>>>>>>>the
        >>>>>>>>>>xml:l ang attribute is rendered. :[
        >>>>>>>>>>>
        >>>>>>>>>>...An y ideas?
        >>>>>>>>>>>
        >>>>>>>>>>Cordi ally,
        >>>>>>>>>>Lee
        >>>>>>>>>>>
        >>>>>>>>>>>
        >>>>>>>>>>
        >>>>>>>>>>
        >>>>>>>>>>
        >>>>>>>>>
        >>>>>>>>>
        >>>>>>>>
        >>>>>>>>
        >>>>>>>>
        >>>>>>>
        >>>>>>>
        >>>>>>
        >>>>>>
        >>>>>
        >>>>>
        >>>>
        >>>>
        >>>
        >>>
        >>>
        >>>
        >>
        >>
        >
        >

        Comment

        • Juan T. Llibre

          #5
          Re: ASP.NET Internationaliz ation bug?

          re:
          !ASP.NET should make it easy for me--and, it does,
          !but there is a bug in the implementation.

          The fact that you *can* set xml:lang programmaticall y, and that you *did* set it that way,
          as I did, should tell you that it isn't much of a bug, but a question of using the correct implementation.

          But, again, please let us know what the reply to your bug report is.



          Juan T. Llibre, asp.net MVP
          asp.net faq : http://asp.net.do/faq/
          foros de asp.net, en español : http://asp.net.do/foros/
          =============== =============== ========
          "Lee C." <nomail@spam.co mwrote in message news:%239PIQvU2 IHA.2384@TK2MSF TNGP04.phx.gbl. ..
          Juan,
          >
          My use of language and culture in ASP.Net is a bit different than most. I have registered numerous
          country-code-specific domains (mysite.ca, mysite.co.uk, mysite.com.au, etc.), which resolve to a singular "ASP.Net Web
          Site". Nothing new there. However, I'm not doing the ASP.Net usual of letting the user agent (HTTP header
          'accept-language') determine which language visitors get; I have the country-code TLD drive it. Also, it's not just
          the language of my content that varies by cc TLD, it's the content, too; but, lang attributes play a critical role in
          informing user agents (including search engine bots) for what "country" my content is aimed.
          >
          I have already found, first-hand, that the better of the major search engines use the cc TLD *and* the HTML
          lang/xml:lang to determine whether a domain's documents (mysite.com.au/my-document.aspx) should show up when a
          searcher searches with the 'Only from Australia' checkbox checked on Live.com, for example.
          >
          I'm not setting lang attributes for fun; I'm doing it to correct search engine results. ASP.NET should make it easy
          for me--and, it does, but there is a bug in the implementation.
          >
          I appreciate your interest and effort to help.
          >
          , Lee
          >
          >
          "Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message news:uBUnQxT2IH A.4164@TK2MSFTN GP03.phx.gbl...
          >re:
          >!versus the spirit of what we're trying to accomplish: telling user agents who our
          >!intended audiences is, by language, as best we can...which is why I'm *also*
          >!setting lang in the HTTP headers and in page meta tags
          >>
          >What ? You don't set a language/culture in web.config, too ?
          >There's a use for overkill ! ( only kidding... )
          >>
          >I don't see too clearly the purpose of declaring a single language for a web page.
          >>
          >I do see a use for declaring specific language attributes in a *collection* of xml documents,
          >so that individual documents can be parsed for a particular language content.
          >>
          >But, ymmv...
          >>
          >I'd still be interested in knowing what the reply is to your bug report.
          >I bet you'll get back : "That's by design". <g>
          >>
          >Don't forget to let us all know what happens with that, OK ?
          >Thanks for an interesting discussion.
          >>
          >>
          >>
          >>
          >Juan T. Llibre, asp.net MVP
          >asp.net faq : http://asp.net.do/faq/
          >foros de asp.net, en español : http://asp.net.do/foros/
          >============== =============== =========
          >"Lee C." <nomail@spam.co mwrote in message news:en1PZVT2IH A.524@TK2MSFTNG P05.phx.gbl...
          >>Juan,
          >>>
          >>In theory, I like your idea of investigating "the standard"; but, in practice it has serious problems, as it often
          >>does. First, you are referring to the XML standard, which is not as appropriate as HTML and XHTML standards.
          >>Second, none of them are crystal clear on best practices for I18N. There is a lot of *legal* (by the standard)
          >>syntax, that makes no sense, or makes some sense without being clearly best. The W3C site often states something to
          >>the effect of, "some are doing this, some are doing that, on your own site, at least do something and only time will
          >>tell what is best."
          >>>
          >>Check out these fine examples, which mirror my syntax, on the W3C site.
          >>>
          >>International ization Best Practices: Specifying Language in XHTML & HTML Content
          >>http://www.w3.org/TR/i18n-html-tech-...0429.092928424
          >>>
          >>>
          >>Tutorial: Declaring Language in XHTML and HTML (Draft)
          >>http://www.w3.org/International/tuto...Slide0160.html
          >>>
          >>Juan, you wrote:
          >>>But, it seems to me that setting xml:lang for the html tag's *attribute* values is unneeded, since they must
          >>>be in English, and they must be attributes set to a language identifier, as defined by IETF RFC 4646
          >>>(http://www.ietf.org/rfc/rfc4646.txt).
          >>>
          >>You're not setting it for "the tag's *attribute*", you're setting it for the *contents*, all contents, of the
          >>element (unless overridden by a sub-setting), which makes perfect sense so that I don't have to set it individually
          >>on every child element--that is the power of a hierarchy! You seem to be focused on the technical, with some
          >>misunderstand ing, versus the spirit of what we're trying to accomplish: telling user agents who our intended
          >>audiences is, by language, as best we can...which is why I'm *also* setting lang in the HTTP headers and in page
          >>meta tags.
          >>>
          >>, Lee
          >>>
          >>>
          >>"Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message news:OYI4upK2IH A.5140@TK2MSFTN GP02.phx.gbl...
          >>>re:
          >>>!I found an MSDN document that explains why what I'm trying to do should work
          >>>>
          >>>Lee,
          >>>>
          >>>From :
          >>>>
          >>>http://www.w3.org/TR/REC-xml/
          >>>>
          >>>"A special attribute named xml:lang may be inserted in documents to specify the
          >>>language used in the contents and attribute values of any element in an XML document."
          >>>>
          >>>If anything, I can see xml:lang being declared for specific content values, for example :
          >>>>
          >>><p xml:lang="en-GB">What colour is it?</p>
          >>><p xml:lang="en-US">What color is it?</p>
          >>>>
          >>>Then, an xml parser could identify regional US and British spellings but, given that *all* the attribute values
          >>>must be in English in an html doc, what would be the purpose of declaring xml:lang for the html markup ?
          >>>>
          >>>A similar explanation is given here :
          >>>http://www.simonstl.com/xmlprim/xmlupdate/atts.html
          >>>>
          >>>---000---
          >>><SECTION>
          >>><DESCRIPTI ON xml:lang="en">
          >>>Caesar begins by describing the geography of Gaul.
          >>></DESCRIPTION>
          >>><QUOTE xml:lang="la">
          >>>Gallia est omnis divisa in partes tres, quarum unam incolunt Belgae,
          >>>aliam Aquitani, tertiam qui ipsorum lingua Celtae, nostra Galli appellantur.
          >>></QUOTE>
          >>>---000---
          >>>>
          >>>That's perfectly good usage for xml:lang, as a parser could selectively identify content in different languages.
          >>>>
          >>>But, it seems to me that setting xml:lang for the html tag's *attribute* values is unneeded, since they must
          >>>be in English, and they must be attributes set to a language identifier, as defined by IETF RFC 4646
          >>>(http://www.ietf.org/rfc/rfc4646.txt).
          >>>>
          >>>So, I think that requisite pretty well establishes the futility
          >>>of setting xml:lang for all the attributes in an html document.
          >>>>
          >>>If anything, it seems that the xml:lang attribute is included in the
          >>>html server tag for compatibility purposes, or perhaps out of ignorance.
          >>>>
          >>>If there's a need to identify that the *contents* of a particular markup tag are in a
          >>>specific language, that identification can be included in the tag itself, for example :
          >>>>
          >>><div lang="MX-es" xml:lang="MX-es">
          >>>Algo de contenido en español mejicano.
          >>></div>
          >>>>
          >>>That makes a lot more sense than setting xml:lang for the attribute values in the html tag.
          >>>>
          >>>>
          >>>>
          >>>Juan T. Llibre, asp.net MVP
          >>>asp.net faq : http://asp.net.do/faq/
          >>>foros de asp.net, en español : http://asp.net.do/foros/
          >>>============ =============== ===========
          >>>"Lee C." <no.spam@spamme r.comwrote in message news:%23ocUnoI2 IHA.2188@TK2MSF TNGP04.phx.gbl. ..
          >>>>>I found an MSDN document that explains why what I'm trying to do should work.
          >>>>>
          >>>>ASP.NET Web Server Controls Overview
          >>>>http://msdn.microsoft.com/en-us/library/zsyt68f1.aspx
          >>>>>
          >>>>Note the distinction between HTML Server Controls and Web Server Controls in the document. Also, note the
          >>>>explanati on
          >>>>of "pass-through" attributes for HTML Server Controls.
          >>>>>
          >>>>Two quotes that sum it up:
          >>>> 1. Any HTML element on a page can be converted to an HTML server control by adding the attribute
          >>>>runat="serv er".
          >>>> 2. You can add any attributes you need to an HTML server control and the page framework will render them
          >>>>without
          >>>>any change in functionality.
          >>>>>
          >>>>, Lee
          >>>>>
          >>>>"Lee C." <no.spam@spamme r.comwrote in message news:Oe38JYI2IH A.4772@TK2MSFTN GP03.phx.gbl...
          >>>>>Juan,
          >>>>>>
          >>>>>I appreciate your trying to help, but you're wrong, and you are the one who is confused. :]
          >>>>>>
          >>>>>I am *not* disputing that when inserted programmaticall y, the xml:lang attribute renders to the browser. I did
          >>>>>just
          >>>>>that as a work around (right after I discovered this bug); but, I should not have to.
          >>>>>>
          >>>>>I am *not* confusing html attributes with runat="server" attributes, as you call them. Using your logic, none of
          >>>>>the
          >>>>>declarativ e (html) attributes should render to the browser after I add the runat="server" in ASP.NET; yet all of
          >>>>>them
          >>>>>(xmlns, lang, and dir) do--except xml:lang.
          >>>>>>
          >>>>>I started with an html element with 4 attributes (xmlns, lang, xml:lang, and dir) all set declaratively. With
          >>>>>*no*
          >>>>>5th attribute of runat="server", all 4 attributes render. If I add the 5th attribute of runat="server", which
          >>>>>does
          >>>>>not and should not render, I no longer get all 4 attributes that should render (xmlns, lang, xml:lang, and dir),
          >>>>>I
          >>>>>only get 3 (xmlns, lang, and dir). My logic says I should get 4, your says I should get 3? It would be 4 or 0,
          >>>>>and
          >>>>>4 is right. Not 0...and not 3.
          >>>>>>
          >>>>>When I add runat="server", it does not magically make the xml:lang attribute a server-side attribute, while
          >>>>>keeping
          >>>>>the other three attributes as "html" attributes. All four are still "html" attributes--which should render.
          >>>>>>
          >>>>>I think the simplification of my example may be confusing you. It is odd that, in my example, I set
          >>>>>runat="ser ver"
          >>>>>but do not have any server-side attributes. (I have all 4 as literal strings, for simplicity of an example.)
          >>>>>Well,
          >>>>>in my real-world use, I do have server-side attributes, which I want set declaratively (no code-beside and no
          >>>>>script). I have:
          >>>>>>
          >>>>><html runat="server" xmlns="http://www.w3.org/1999/xhtml"
          >>>>> xml:lang="<%$ Resources:Globa lLang, ContentAudience Language %>"
          >>>>> lang="<%$ Resources:Globa lLang, ContentAudience Language %>"
          >>>>> dir="ltr">
          >>>>>>
          >>>>>Both of those declarative explicit localization expressions should work without my having to write any more
          >>>>>"procedura l" (code-beside) code or script. It actually does work fine for the lang attribute--as it should; but
          >>>>>not
          >>>>>for the xml:lang attribute--***which is a bug***.
          >>>>>>
          >>>>>, Lee
          >>>>>>
          >>>>>"Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message news:u0WzB9H2IH A.4188@TK2MSFTN GP04.phx.gbl...
          >>>>>>re:
          >>>>>>!I think you are misunderstandin g, Juan.
          >>>>>>>
          >>>>>>Well, I think you are misunderstandin g *me*.
          >>>>>>>
          >>>>>>re:
          >>>>>>!I had the xml:lang attribute in the html tag (declaratively) , like this:
          >>>>>>>...and it renders to the browser, as it should.
          >>>>>>>
          >>>>>>Yes, because it's standard html.
          >>>>>>>
          >>>>>>re:
          >>>>>>!If I simply add runat="server"
          >>>>>>>
          >>>>>>That declares the control to run server side.
          >>>>>>>
          >>>>>>For any attribute to be programmed server-side you need a script,
          >>>>>>just as you need a script to modify any server control's attributes.
          >>>>>>>
          >>>>>>Did you run the sample page I sent ?
          >>>>>>>
          >>>>>>It iterates throught the attributes for the html server control,
          >>>>>>and shows that the xml:lang attribute *is* added programmaticall y.
          >>>>>>>
          >>>>>>re:
          >>>>>>!If I simply add runat="server", leaving in the xml:lang attribute that
          >>>>>>!render s without runat="server", all of the (declarative) attributes are
          >>>>>>!render ed to the browser--except the xml:lang attribute! That is a bug.
          >>>>>>>
          >>>>>>I think you're confusing html attributes with runat="server" attributes.
          >>>>>>>
          >>>>>>Html attributes can be inserted in normal html.
          >>>>>>Server-side attributes must be inserted in code.
          >>>>>>>
          >>>>>>Maybe I'm not explaining this as well as I should.
          >>>>>>Try to get someone else's opinion on this matter, if you don't accept mine.
          >>>>>>>
          >>>>>>>
          >>>>>>>
          >>>>>>Juan T. Llibre, asp.net MVP
          >>>>>>asp.net faq : http://asp.net.do/faq/
          >>>>>>foros de asp.net, en español : http://asp.net.do/foros/
          >>>>>>========= =============== ==============
          >>>>>>"Lee C." <no.spam@spamme r.comwrote in message news:enam1gH2IH A.4552@TK2MSFTN GP04.phx.gbl...
          >>>>>>>>I think you are misunderstandin g, Juan. I had the xml:lang attribute in the html tag (declaratively) , like
          >>>>>>>>this:
          >>>>>>>>
          >>>>>>><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US" dir="ltr">
          >>>>>>>>
          >>>>>>>...and it renders to the browser, as it should.
          >>>>>>>>
          >>>>>>>If I simply add runat="server", leaving in the xml:lang attribute that renders without runat="server", all of
          >>>>>>>the
          >>>>>>>(declara tive) attributes are rendered to the browser--except the xml:lang attribute! That is a bug.
          >>>>>>>>
          >>>>>>><html runat="server" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US" dir="ltr">
          >>>>>>>>
          >>>>>>>Cordiall y,
          >>>>>>>Lee
          >>>>>>>>
          >>>>>>>>
          >>>>>>>"Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message news:eyrwjUH2IH A.3920@TK2MSFTN GP02.phx.gbl...
          >>>>>>>>Here' s a full example which shows that the xml:lang attribute is added programmaticall y :
          >>>>>>>>>
          >>>>>>>>attribu tes.aspx:
          >>>>>>>>----------------------
          >>>>>>>><%@ Page Language="C#" AutoEventWireup ="True" %>
          >>>>>>>><html xmlns="http://www.w3.org/1999/xhtml" runat="server" id="Myid" >
          >>>>>>>><scri pt language="C#" runat="server">
          >>>>>>>>void Page_Load(Objec t sender, EventArgs e)
          >>>>>>>>{
          >>>>>>>>Myid.At tributes.Add("x ml:lang", "es");
          >>>>>>>>Message .InnerHtml = "<h4>The html control attributes collection contains:</h4>";
          >>>>>>>>IEnumer ator keys = Myid.Attributes .Keys.GetEnumer ator();
          >>>>>>>>while (keys.MoveNext( ))
          >>>>>>>>{
          >>>>>>>>Strin g key = (String)keys.Cu rrent;
          >>>>>>>>Message .InnerHtml += key + "=" + Myid.Attributes[key] + "<br />";
          >>>>>>>>}
          >>>>>>>>}
          >>>>>>>></script>
          >>>>>>>><head id="Head1" runat="server">
          >>>>>>>><title> The html control attributes collection</title>
          >>>>>>>></head>
          >>>>>>>><body >
          >>>>>>>><form id="Form1" runat="server">
          >>>>>>>><h3>Htm lControl Attribute Collection Example</h3>
          >>>>>>>><br />
          >>>>>>>><span id="Message" enableviewstate ="false" runat="server" />
          >>>>>>>></form>
          >>>>>>>></body>
          >>>>>>>></html>
          >>>>>>>>----------------
          >>>>>>>>>
          >>>>>>>>I don't think it's a bug to have to add an attribute programmaticall y,
          >>>>>>>>becau se the runat="server" tag only *declares* the html control as a programmable control.
          >>>>>>>>>
          >>>>>>>>To actually program it, you must use a script.
          >>>>>>>>>
          >>>>>>>>>
          >>>>>>>>>
          >>>>>>>>>
          >>>>>>>>Juan T. Llibre, asp.net MVP
          >>>>>>>>asp.n et faq : http://asp.net.do/faq/
          >>>>>>>>foros de asp.net, en español : http://asp.net.do/foros/
          >>>>>>>>======= =============== =============== =
          >>>>>>>>"Lee C." <no.spam@spamme r.comwrote in message news:e0rLaPG2IH A.4772@TK2MSFTN GP03.phx.gbl...
          >>>>>>>>>Thanks , Juan.
          >>>>>>>>>>
          >>>>>>>>>I already added similar code to a page event in my masterpage code-beside.
          >>>>>>>>>>
          >>>>>>>>> elHtml.Attribut es.Add("xml:lan g", Resources.Globa lLang.ContentAu dienceLanguage)
          >>>>>>>>>>
          >>>>>>>>>To me, that is a temporary workaround. I still want to understand whether the "eating" of the attribute I
          >>>>>>>>>origin ally
          >>>>>>>>>post ed about is a bug, or if this is actually happening for a reason.
          >>>>>>>>>>
          >>>>>>>>>Cordia lly,
          >>>>>>>>>Lee
          >>>>>>>>>>
          >>>>>>>>>>
          >>>>>>>>>"Jua n T. Llibre" <nomailreplies@ nowhere.comwrot e in message news:%23gBUqSC2 IHA.4772@TK2MSF TNGP03.phx.gbl. ..
          >>>>>>>>>>Hi, Lee.
          >>>>>>>>>>>
          >>>>>>>>>>re:
          >>>>>>>>>>!<htm l runat="server" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US" dir="ltr">
          >>>>>>>>>>!no xml:lang attribute is rendered to the browser!
          >>>>>>>>>>!Remo ve the runat="server", and, voila, the xml:lang attribute is rendered.
          >>>>>>>>>>>
          >>>>>>>>>>Try this :
          >>>>>>>>>>>
          >>>>>>>>>><ht ml xmlns="http://www.w3.org/1999/xhtml" runat="server" id="someID">
          >>>>>>>>>>>
          >>>>>>>>>><scri pt runat="server">
          >>>>>>>>>>someI D.Attributes("x ml:lang") = "en-US"
          >>>>>>>>>></script>
          >>>>>>>>>>>
          >>>>>>>>>>>
          >>>>>>>>>>>
          >>>>>>>>>>Jua n T. Llibre, asp.net MVP
          >>>>>>>>>>asp.n et faq : http://asp.net.do/faq/
          >>>>>>>>>>for os de asp.net, en español : http://asp.net.do/foros/
          >>>>>>>>>>===== =============== =============== ===
          >>>>>>>>>>>
          >>>>>>>>>>"Le e C." <nomail@spam.co mwrote in message news:O%23KsAQA2 IHA.4572@TK2MSF TNGP03.phx.gbl. ..
          >>>>>>>>>>>>I think I have discovered a bug in ASP.NET, related to I18N.
          >>>>>>>>>>>>
          >>>>>>>>>>>In ASP.NET 3.5 I have to set runat="server" on the html element to use explicit expressions. It appears
          >>>>>>>>>>>th at
          >>>>>>>>>>>ASP. NET
          >>>>>>>>>>>ea ts the xml:lang attribute on the html element when it is set to runat="server".
          >>>>>>>>>>>>
          >>>>>>>>>>>Of course I want to replace the hardcoded "en-US" values with (resource) explicit expressions; but, for
          >>>>>>>>>>>simp licity,
          >>>>>>>>>>>tr y this:
          >>>>>>>>>>>>
          >>>>>>>>>>><htm l runat="server" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US" dir="ltr">
          >>>>>>>>>>>>
          >>>>>>>>>>>...A nd you will find that no xml:lang attribute is rendered to the browser! Remove the runat="server", and,
          >>>>>>>>>>>voil a,
          >>>>>>>>>>>th e
          >>>>>>>>>>>xml: lang attribute is rendered. :[
          >>>>>>>>>>>>
          >>>>>>>>>>>...A ny ideas?
          >>>>>>>>>>>>
          >>>>>>>>>>>Cord ially,
          >>>>>>>>>>>Le e
          >>>>>>>>>>>>
          >>>>>>>>>>>>
          >>>>>>>>>>>
          >>>>>>>>>>>
          >>>>>>>>>>>
          >>>>>>>>>>
          >>>>>>>>>>
          >>>>>>>>>
          >>>>>>>>>
          >>>>>>>>>
          >>>>>>>>
          >>>>>>>>
          >>>>>>>
          >>>>>>>
          >>>>>>
          >>>>>>
          >>>>>
          >>>>>
          >>>>
          >>>>
          >>>>
          >>>>
          >>>
          >>>
          >>
          >>
          >
          >

          Comment

          • Lee C.

            #6
            Re: ASP.NET Internationaliz ation bug?

            Correct implementation? What do you mean by that?

            I stated earlier on that I worked around it. It's still a bug. Setting it
            programmaticall y is an incorrect implementation when everything else on my
            page is set declaratively. Microsoft offered declarative (explicit)
            expressions, and I want to use them--anywhere and everywhere I choose in
            accordance with how they are stated to work. When I find one that doesn't
            work, it's a bug; it's not a case of my doing something incorrectly. I love
            Microsoft Visual Studio 2008; but, I won't tolerate bugs, or suck them up
            as, "Oh, I must be doing it wrong since it doesn't work--even though it
            should."

            , Lee

            "Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message
            news:%23xhBpuW2 IHA.2384@TK2MSF TNGP04.phx.gbl. ..
            re:
            !ASP.NET should make it easy for me--and, it does,
            !but there is a bug in the implementation.
            >
            The fact that you *can* set xml:lang programmaticall y, and that you *did*
            set it that way,
            as I did, should tell you that it isn't much of a bug, but a question of
            using the correct implementation.
            >
            But, again, please let us know what the reply to your bug report is.
            >
            >
            >
            Juan T. Llibre, asp.net MVP
            asp.net faq : http://asp.net.do/faq/
            foros de asp.net, en español : http://asp.net.do/foros/
            =============== =============== ========
            "Lee C." <nomail@spam.co mwrote in message
            news:%239PIQvU2 IHA.2384@TK2MSF TNGP04.phx.gbl. ..
            >Juan,
            >>
            >My use of language and culture in ASP.Net is a bit different than most.
            >I have registered numerous country-code-specific domains (mysite.ca,
            >mysite.co.uk , mysite.com.au, etc.), which resolve to a singular "ASP.Net
            >Web Site". Nothing new there. However, I'm not doing the ASP.Net usual
            >of letting the user agent (HTTP header 'accept-language') determine which
            >language visitors get; I have the country-code TLD drive it. Also, it's
            >not just the language of my content that varies by cc TLD, it's the
            >content, too; but, lang attributes play a critical role in informing user
            >agents (including search engine bots) for what "country" my content is
            >aimed.
            >>
            >I have already found, first-hand, that the better of the major search
            >engines use the cc TLD *and* the HTML lang/xml:lang to determine whether
            >a domain's documents (mysite.com.au/my-document.aspx) should show up when
            >a searcher searches with the 'Only from Australia' checkbox checked on
            >Live.com, for example.
            >>
            >I'm not setting lang attributes for fun; I'm doing it to correct search
            >engine results. ASP.NET should make it easy for me--and, it does, but
            >there is a bug in the implementation.
            >>
            >I appreciate your interest and effort to help.
            >>
            >, Lee
            >>
            >>
            >"Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message
            >news:uBUnQxT2I HA.4164@TK2MSFT NGP03.phx.gbl.. .
            >>re:
            >>!versus the spirit of what we're trying to accomplish: telling user
            >>agents who our
            >>!intended audiences is, by language, as best we can...which is why I'm
            >>*also*
            >>!setting lang in the HTTP headers and in page meta tags
            >>>
            >>What ? You don't set a language/culture in web.config, too ?
            >>There's a use for overkill ! ( only kidding... )
            >>>
            >>I don't see too clearly the purpose of declaring a single language for a
            >>web page.
            >>>
            >>I do see a use for declaring specific language attributes in a
            >>*collection * of xml documents,
            >>so that individual documents can be parsed for a particular language
            >>content.
            >>>
            >>But, ymmv...
            >>>
            >>I'd still be interested in knowing what the reply is to your bug report.
            >>I bet you'll get back : "That's by design". <g>
            >>>
            >>Don't forget to let us all know what happens with that, OK ?
            >>Thanks for an interesting discussion.
            >>>
            >>>
            >>>
            >>>
            >>Juan T. Llibre, asp.net MVP
            >>asp.net faq : http://asp.net.do/faq/
            >>foros de asp.net, en español : http://asp.net.do/foros/
            >>============= =============== ==========
            >>"Lee C." <nomail@spam.co mwrote in message
            >>news:en1PZVT2 IHA.524@TK2MSFT NGP05.phx.gbl.. .
            >>>Juan,
            >>>>
            >>>In theory, I like your idea of investigating "the standard"; but, in
            >>>practice it has serious problems, as it often does. First, you are
            >>>referring to the XML standard, which is not as appropriate as HTML and
            >>>XHTML standards. Second, none of them are crystal clear on best
            >>>practices for I18N. There is a lot of *legal* (by the standard)
            >>>syntax, that makes no sense, or makes some sense without being clearly
            >>>best. The W3C site often states something to the effect of, "some are
            >>>doing this, some are doing that, on your own site, at least do
            >>>something and only time will tell what is best."
            >>>>
            >>>Check out these fine examples, which mirror my syntax, on the W3C site.
            >>>>
            >>>Internationa lization Best Practices: Specifying Language in XHTML &
            >>>HTML Content
            >>>http://www.w3.org/TR/i18n-html-tech-...0429.092928424
            >>>>
            >>>>
            >>>Tutorial: Declaring Language in XHTML and HTML (Draft)
            >>>http://www.w3.org/International/tuto...Slide0160.html
            >>>>
            >>>Juan, you wrote:
            >>>>But, it seems to me that setting xml:lang for the html tag's
            >>>>*attribut e* values is unneeded, since they must
            >>>>be in English, and they must be attributes set to a language
            >>>>identifie r, as defined by IETF RFC 4646
            >>>>(http://www.ietf.org/rfc/rfc4646.txt).
            >>>>
            >>>You're not setting it for "the tag's *attribute*", you're setting it
            >>>for the *contents*, all contents, of the element (unless overridden by
            >>>a sub-setting), which makes perfect sense so that I don't have to set
            >>>it individually on every child element--that is the power of a
            >>>hierarchy! You seem to be focused on the technical, with some
            >>>misunderstan ding, versus the spirit of what we're trying to accomplish:
            >>>telling user agents who our intended audiences is, by language, as best
            >>>we can...which is why I'm *also* setting lang in the HTTP headers and
            >>>in page meta tags.
            >>>>
            >>>, Lee
            >>>>
            >>>>
            >>>"Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message
            >>>news:OYI4upK 2IHA.5140@TK2MS FTNGP02.phx.gbl ...
            >>>>re:
            >>>>!I found an MSDN document that explains why what I'm trying to do
            >>>>should work
            >>>>>
            >>>>Lee,
            >>>>>
            >>>>From :
            >>>>>
            >>>>http://www.w3.org/TR/REC-xml/
            >>>>>
            >>>>"A special attribute named xml:lang may be inserted in documents to
            >>>>specify the
            >>>>language used in the contents and attribute values of any element in
            >>>>an XML document."
            >>>>>
            >>>>If anything, I can see xml:lang being declared for specific content
            >>>>values, for example :
            >>>>>
            >>>><p xml:lang="en-GB">What colour is it?</p>
            >>>><p xml:lang="en-US">What color is it?</p>
            >>>>>
            >>>>Then, an xml parser could identify regional US and British spellings
            >>>>but, given that *all* the attribute values
            >>>>must be in English in an html doc, what would be the purpose of
            >>>>declaring xml:lang for the html markup ?
            >>>>>
            >>>>A similar explanation is given here :
            >>>>http://www.simonstl.com/xmlprim/xmlupdate/atts.html
            >>>>>
            >>>>---000---
            >>>><SECTION>
            >>>><DESCRIPTIO N xml:lang="en">
            >>>>Caesar begins by describing the geography of Gaul.
            >>>></DESCRIPTION>
            >>>><QUOTE xml:lang="la">
            >>>>Gallia est omnis divisa in partes tres, quarum unam incolunt Belgae,
            >>>>aliam Aquitani, tertiam qui ipsorum lingua Celtae, nostra Galli
            >>>>appellantur .
            >>>></QUOTE>
            >>>>---000---
            >>>>>
            >>>>That's perfectly good usage for xml:lang, as a parser could
            >>>>selective ly identify content in different languages.
            >>>>>
            >>>>But, it seems to me that setting xml:lang for the html tag's
            >>>>*attribut e* values is unneeded, since they must
            >>>>be in English, and they must be attributes set to a language
            >>>>identifie r, as defined by IETF RFC 4646
            >>>>(http://www.ietf.org/rfc/rfc4646.txt).
            >>>>>
            >>>>So, I think that requisite pretty well establishes the futility
            >>>>of setting xml:lang for all the attributes in an html document.
            >>>>>
            >>>>If anything, it seems that the xml:lang attribute is included in the
            >>>>html server tag for compatibility purposes, or perhaps out of
            >>>>ignorance .
            >>>>>
            >>>>If there's a need to identify that the *contents* of a particular
            >>>>markup tag are in a
            >>>>specific language, that identification can be included in the tag
            >>>>itself, for example :
            >>>>>
            >>>><div lang="MX-es" xml:lang="MX-es">
            >>>>Algo de contenido en español mejicano.
            >>>></div>
            >>>>>
            >>>>That makes a lot more sense than setting xml:lang for the attribute
            >>>>values in the html tag.
            >>>>>
            >>>>>
            >>>>>
            >>>>Juan T. Llibre, asp.net MVP
            >>>>asp.net faq : http://asp.net.do/faq/
            >>>>foros de asp.net, en español : http://asp.net.do/foros/
            >>>>=========== =============== ============
            >>>>"Lee C." <no.spam@spamme r.comwrote in message
            >>>>news:%23ocU noI2IHA.2188@TK 2MSFTNGP04.phx. gbl...
            >>>>>>I found an MSDN document that explains why what I'm trying to do
            >>>>>>should work.
            >>>>>>
            >>>>>ASP.NET Web Server Controls Overview
            >>>>>http://msdn.microsoft.com/en-us/library/zsyt68f1.aspx
            >>>>>>
            >>>>>Note the distinction between HTML Server Controls and Web Server
            >>>>>Controls in the document. Also, note the explanation
            >>>>>of "pass-through" attributes for HTML Server Controls.
            >>>>>>
            >>>>>Two quotes that sum it up:
            >>>>> 1. Any HTML element on a page can be converted to an HTML server
            >>>>>control by adding the attribute runat="server".
            >>>>> 2. You can add any attributes you need to an HTML server control
            >>>>>and the page framework will render them without
            >>>>>any change in functionality.
            >>>>>>
            >>>>>, Lee
            >>>>>>
            >>>>>"Lee C." <no.spam@spamme r.comwrote in message
            >>>>>news:Oe38J YI2IHA.4772@TK2 MSFTNGP03.phx.g bl...
            >>>>>>Juan,
            >>>>>>>
            >>>>>>I appreciate your trying to help, but you're wrong, and you are the
            >>>>>>one who is confused. :]
            >>>>>>>
            >>>>>>I am *not* disputing that when inserted programmaticall y, the
            >>>>>>xml:lan g attribute renders to the browser. I did just
            >>>>>>that as a work around (right after I discovered this bug); but, I
            >>>>>>should not have to.
            >>>>>>>
            >>>>>>I am *not* confusing html attributes with runat="server" attributes,
            >>>>>>as you call them. Using your logic, none of the
            >>>>>>declarati ve (html) attributes should render to the browser after I
            >>>>>>add the runat="server" in ASP.NET; yet all of them
            >>>>>>(xmlns, lang, and dir) do--except xml:lang.
            >>>>>>>
            >>>>>>I started with an html element with 4 attributes (xmlns, lang,
            >>>>>>xml:lan g, and dir) all set declaratively. With *no*
            >>>>>>5th attribute of runat="server", all 4 attributes render. If I add
            >>>>>>the 5th attribute of runat="server", which does
            >>>>>>not and should not render, I no longer get all 4 attributes that
            >>>>>>should render (xmlns, lang, xml:lang, and dir), I
            >>>>>>only get 3 (xmlns, lang, and dir). My logic says I should get 4,
            >>>>>>your says I should get 3? It would be 4 or 0, and
            >>>>>>4 is right. Not 0...and not 3.
            >>>>>>>
            >>>>>>When I add runat="server", it does not magically make the xml:lang
            >>>>>>attribu te a server-side attribute, while keeping
            >>>>>>the other three attributes as "html" attributes. All four are still
            >>>>>>"html" attributes--which should render.
            >>>>>>>
            >>>>>>I think the simplification of my example may be confusing you. It
            >>>>>>is odd that, in my example, I set runat="server"
            >>>>>>but do not have any server-side attributes. (I have all 4 as
            >>>>>>literal strings, for simplicity of an example.) Well,
            >>>>>>in my real-world use, I do have server-side attributes, which I want
            >>>>>>set declaratively (no code-beside and no
            >>>>>>script) . I have:
            >>>>>>>
            >>>>>><html runat="server" xmlns="http://www.w3.org/1999/xhtml"
            >>>>>> xml:lang="<%$ Resources:Globa lLang, ContentAudience Language %>"
            >>>>>> lang="<%$ Resources:Globa lLang, ContentAudience Language %>"
            >>>>>> dir="ltr">
            >>>>>>>
            >>>>>>Both of those declarative explicit localization expressions should
            >>>>>>work without my having to write any more
            >>>>>>"procedur al" (code-beside) code or script. It actually does work
            >>>>>>fine for the lang attribute--as it should; but not
            >>>>>>for the xml:lang attribute--***which is a bug***.
            >>>>>>>
            >>>>>>, Lee
            >>>>>>>
            >>>>>>"Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message
            >>>>>>news:u0Wz B9H2IHA.4188@TK 2MSFTNGP04.phx. gbl...
            >>>>>>>re:
            >>>>>>>!I think you are misunderstandin g, Juan.
            >>>>>>>>
            >>>>>>>Well, I think you are misunderstandin g *me*.
            >>>>>>>>
            >>>>>>>re:
            >>>>>>>!I had the xml:lang attribute in the html tag (declaratively) ,
            >>>>>>>like this:
            >>>>>>>>...an d it renders to the browser, as it should.
            >>>>>>>>
            >>>>>>>Yes, because it's standard html.
            >>>>>>>>
            >>>>>>>re:
            >>>>>>>!If I simply add runat="server"
            >>>>>>>>
            >>>>>>>That declares the control to run server side.
            >>>>>>>>
            >>>>>>>For any attribute to be programmed server-side you need a script,
            >>>>>>>just as you need a script to modify any server control's
            >>>>>>>attribut es.
            >>>>>>>>
            >>>>>>>Did you run the sample page I sent ?
            >>>>>>>>
            >>>>>>>It iterates throught the attributes for the html server control,
            >>>>>>>and shows that the xml:lang attribute *is* added programmaticall y.
            >>>>>>>>
            >>>>>>>re:
            >>>>>>>!If I simply add runat="server", leaving in the xml:lang
            >>>>>>>attribut e that
            >>>>>>>!rende rs without runat="server", all of the (declarative)
            >>>>>>>attribut es are
            >>>>>>>!rendere d to the browser--except the xml:lang attribute! That is
            >>>>>>>a bug.
            >>>>>>>>
            >>>>>>>I think you're confusing html attributes with runat="server"
            >>>>>>>attribut es.
            >>>>>>>>
            >>>>>>>Html attributes can be inserted in normal html.
            >>>>>>>Server-side attributes must be inserted in code.
            >>>>>>>>
            >>>>>>>Maybe I'm not explaining this as well as I should.
            >>>>>>>Try to get someone else's opinion on this matter, if you don't
            >>>>>>>accept mine.
            >>>>>>>>
            >>>>>>>>
            >>>>>>>>
            >>>>>>>Juan T. Llibre, asp.net MVP
            >>>>>>>asp.ne t faq : http://asp.net.do/faq/
            >>>>>>>foros de asp.net, en español : http://asp.net.do/foros/
            >>>>>>>======== =============== ===============
            >>>>>>>"Lee C." <no.spam@spamme r.comwrote in message
            >>>>>>>news:ena m1gH2IHA.4552@T K2MSFTNGP04.phx .gbl...
            >>>>>>>>>I think you are misunderstandin g, Juan. I had the xml:lang
            >>>>>>>>>attrib ute in the html tag (declaratively) , like this:
            >>>>>>>>>
            >>>>>>>><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"
            >>>>>>>>lang="e n-US" dir="ltr">
            >>>>>>>>>
            >>>>>>>>...an d it renders to the browser, as it should.
            >>>>>>>>>
            >>>>>>>>If I simply add runat="server", leaving in the xml:lang attribute
            >>>>>>>>that renders without runat="server", all of the
            >>>>>>>>(declar ative) attributes are rendered to the browser--except the
            >>>>>>>>xml:lan g attribute! That is a bug.
            >>>>>>>>>
            >>>>>>>><html runat="server" xmlns="http://www.w3.org/1999/xhtml"
            >>>>>>>>xml:lan g="en-US" lang="en-US" dir="ltr">
            >>>>>>>>>
            >>>>>>>>Cordial ly,
            >>>>>>>>Lee
            >>>>>>>>>
            >>>>>>>>>
            >>>>>>>>"Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message
            >>>>>>>>news:ey rwjUH2IHA.3920@ TK2MSFTNGP02.ph x.gbl...
            >>>>>>>>>Here 's a full example which shows that the xml:lang attribute is
            >>>>>>>>>adde d programmaticall y :
            >>>>>>>>>>
            >>>>>>>>>attrib utes.aspx:
            >>>>>>>>>----------------------
            >>>>>>>>><%@ Page Language="C#" AutoEventWireup ="True" %>
            >>>>>>>>><htm l xmlns="http://www.w3.org/1999/xhtml" runat="server"
            >>>>>>>>>id="My id" >
            >>>>>>>>><scrip t language="C#" runat="server">
            >>>>>>>>>void Page_Load(Objec t sender, EventArgs e)
            >>>>>>>>>{
            >>>>>>>>>Myid.A ttributes.Add(" xml:lang", "es");
            >>>>>>>>>Messag e.InnerHtml = "<h4>The html control attributes collection
            >>>>>>>>>contai ns:</h4>";
            >>>>>>>>>IEnume rator keys = Myid.Attributes .Keys.GetEnumer ator();
            >>>>>>>>>whil e (keys.MoveNext( ))
            >>>>>>>>>{
            >>>>>>>>>Stri ng key = (String)keys.Cu rrent;
            >>>>>>>>>Messag e.InnerHtml += key + "=" + Myid.Attributes[key] + "<br />";
            >>>>>>>>>}
            >>>>>>>>>}
            >>>>>>>>></script>
            >>>>>>>>><hea d id="Head1" runat="server">
            >>>>>>>>><title >The html control attributes collection</title>
            >>>>>>>>></head>
            >>>>>>>>><bod y>
            >>>>>>>>><for m id="Form1" runat="server">
            >>>>>>>>><h3>Ht mlControl Attribute Collection Example</h3>
            >>>>>>>>><br />
            >>>>>>>>><spa n id="Message" enableviewstate ="false" runat="server" />
            >>>>>>>>></form>
            >>>>>>>>></body>
            >>>>>>>>></html>
            >>>>>>>>>----------------
            >>>>>>>>>>
            >>>>>>>>>I don't think it's a bug to have to add an attribute
            >>>>>>>>>progra mmatically,
            >>>>>>>>>becaus e the runat="server" tag only *declares* the html control
            >>>>>>>>>as a programmable control.
            >>>>>>>>>>
            >>>>>>>>>To actually program it, you must use a script.
            >>>>>>>>>>
            >>>>>>>>>>
            >>>>>>>>>>
            >>>>>>>>>>
            >>>>>>>>>Juan T. Llibre, asp.net MVP
            >>>>>>>>>asp.ne t faq : http://asp.net.do/faq/
            >>>>>>>>>foro s de asp.net, en español : http://asp.net.do/foros/
            >>>>>>>>>====== =============== =============== ==
            >>>>>>>>>"Lee C." <no.spam@spamme r.comwrote in message
            >>>>>>>>>news:e 0rLaPG2IHA.4772 @TK2MSFTNGP03.p hx.gbl...
            >>>>>>>>>>Thank s, Juan.
            >>>>>>>>>>>
            >>>>>>>>>>I already added similar code to a page event in my masterpage
            >>>>>>>>>>cod e-beside.
            >>>>>>>>>>>
            >>>>>>>>>> elHtml.Attribut es.Add("xml:lan g",
            >>>>>>>>>>Resou rces.GlobalLang .ContentAudienc eLanguage)
            >>>>>>>>>>>
            >>>>>>>>>>To me, that is a temporary workaround. I still want to
            >>>>>>>>>>under stand whether the "eating" of the attribute I
            >>>>>>>>>>origi nally
            >>>>>>>>>>poste d about is a bug, or if this is actually happening for a
            >>>>>>>>>>reaso n.
            >>>>>>>>>>>
            >>>>>>>>>>Cordi ally,
            >>>>>>>>>>Lee
            >>>>>>>>>>>
            >>>>>>>>>>>
            >>>>>>>>>>"Ju an T. Llibre" <nomailreplies@ nowhere.comwrot e in message
            >>>>>>>>>>news: %23gBUqSC2IHA.4 772@TK2MSFTNGP0 3.phx.gbl...
            >>>>>>>>>>>Hi , Lee.
            >>>>>>>>>>>>
            >>>>>>>>>>>re :
            >>>>>>>>>>>!<ht ml runat="server" xmlns="http://www.w3.org/1999/xhtml"
            >>>>>>>>>>>xml: lang="en-US" lang="en-US" dir="ltr">
            >>>>>>>>>>>!n o xml:lang attribute is rendered to the browser!
            >>>>>>>>>>>!Rem ove the runat="server", and, voila, the xml:lang
            >>>>>>>>>>>attr ibute is rendered.
            >>>>>>>>>>>>
            >>>>>>>>>>>Tr y this :
            >>>>>>>>>>>>
            >>>>>>>>>>><htm l xmlns="http://www.w3.org/1999/xhtml" runat="server"
            >>>>>>>>>>>id=" someID">
            >>>>>>>>>>>>
            >>>>>>>>>>><scr ipt runat="server">
            >>>>>>>>>>>some ID.Attributes(" xml:lang") = "en-US"
            >>>>>>>>>>></script>
            >>>>>>>>>>>>
            >>>>>>>>>>>>
            >>>>>>>>>>>>
            >>>>>>>>>>>Ju an T. Llibre, asp.net MVP
            >>>>>>>>>>>asp. net faq : http://asp.net.do/faq/
            >>>>>>>>>>>foro s de asp.net, en español : http://asp.net.do/foros/
            >>>>>>>>>>>==== =============== =============== ====
            >>>>>>>>>>>>
            >>>>>>>>>>>"L ee C." <nomail@spam.co mwrote in message
            >>>>>>>>>>>news :O%23KsAQA2IHA. 4572@TK2MSFTNGP 03.phx.gbl...
            >>>>>>>>>>>>> I think I have discovered a bug in ASP.NET, related to I18N.
            >>>>>>>>>>>>>
            >>>>>>>>>>>>I n ASP.NET 3.5 I have to set runat="server" on the html
            >>>>>>>>>>>>ele ment to use explicit expressions. It appears that
            >>>>>>>>>>>>ASP .NET
            >>>>>>>>>>>>eat s the xml:lang attribute on the html element when it is set
            >>>>>>>>>>>>t o runat="server".
            >>>>>>>>>>>>>
            >>>>>>>>>>>>O f course I want to replace the hardcoded "en-US" values with
            >>>>>>>>>>>>(re source) explicit expressions; but, for
            >>>>>>>>>>>>sim plicity,
            >>>>>>>>>>>>t ry this:
            >>>>>>>>>>>>>
            >>>>>>>>>>>><ht ml runat="server" xmlns="http://www.w3.org/1999/xhtml"
            >>>>>>>>>>>>xml :lang="en-US" lang="en-US" dir="ltr">
            >>>>>>>>>>>>>
            >>>>>>>>>>>>... And you will find that no xml:lang attribute is rendered to
            >>>>>>>>>>>>t he browser! Remove the runat="server", and,
            >>>>>>>>>>>>voi la,
            >>>>>>>>>>>>t he
            >>>>>>>>>>>>xml :lang attribute is rendered. :[
            >>>>>>>>>>>>>
            >>>>>>>>>>>>... Any ideas?
            >>>>>>>>>>>>>
            >>>>>>>>>>>>Cor dially,
            >>>>>>>>>>>>L ee
            >>>>>>>>>>>>>
            >>>>>>>>>>>>>
            >>>>>>>>>>>>
            >>>>>>>>>>>>
            >>>>>>>>>>>>
            >>>>>>>>>>>
            >>>>>>>>>>>
            >>>>>>>>>>
            >>>>>>>>>>
            >>>>>>>>>>
            >>>>>>>>>
            >>>>>>>>>
            >>>>>>>>
            >>>>>>>>
            >>>>>>>
            >>>>>>>
            >>>>>>
            >>>>>>
            >>>>>
            >>>>>
            >>>>>
            >>>>>
            >>>>
            >>>>
            >>>
            >>>
            >>
            >>
            >
            >

            Comment

            • Juan T. Llibre

              #7
              Re: ASP.NET Internationaliz ation bug?

              re:
              !Setting it programmaticall y is an incorrect implementation
              !when everything else on my page is set declaratively.

              Is everything else on your pages set declaratively ?
              Think about that for a second.

              Why do we have inline scripts and code-behind, if "everything else is set declaratively" ?

              In any case, we've certainly had enough of the "I think that..." back and forth.

              Let's pause this discussion until the "bug" you reported is explained by the VS Dev team, OK ?
              I, definitely, want to see what their explanation is.





              Juan T. Llibre, asp.net MVP
              asp.net faq : http://asp.net.do/faq/
              foros de asp.net, en español : http://asp.net.do/foros/
              =============== =============== ========
              "Lee C." <nomail@spam.co mwrote in message news:eQlpa4W2IH A.4704@TK2MSFTN GP05.phx.gbl...
              Correct implementation? What do you mean by that?
              >
              I stated earlier on that I worked around it. It's still a bug. Setting it programmaticall y is an incorrect
              implementation when everything else on my page is set declaratively. Microsoft offered declarative (explicit)
              expressions, and I want to use them--anywhere and everywhere I choose in accordance with how they are stated to work.
              When I find one that doesn't work, it's a bug; it's not a case of my doing something incorrectly. I love Microsoft
              Visual Studio 2008; but, I won't tolerate bugs, or suck them up as, "Oh, I must be doing it wrong since it doesn't
              work--even though it should."
              >
              , Lee
              >
              "Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message news:%23xhBpuW2 IHA.2384@TK2MSF TNGP04.phx.gbl. ..
              >re:
              >!ASP.NET should make it easy for me--and, it does,
              >!but there is a bug in the implementation.
              >>
              >The fact that you *can* set xml:lang programmaticall y, and that you *did* set it that way,
              >as I did, should tell you that it isn't much of a bug, but a question of using the correct implementation.
              >>
              >But, again, please let us know what the reply to your bug report is.
              >>
              >>
              >>
              >Juan T. Llibre, asp.net MVP
              >asp.net faq : http://asp.net.do/faq/
              >foros de asp.net, en español : http://asp.net.do/foros/
              >============== =============== =========
              >"Lee C." <nomail@spam.co mwrote in message news:%239PIQvU2 IHA.2384@TK2MSF TNGP04.phx.gbl. ..
              >>Juan,
              >>>
              >>My use of language and culture in ASP.Net is a bit different than most. I have registered numerous
              >>country-code-specific domains (mysite.ca, mysite.co.uk, mysite.com.au, etc.), which resolve to a singular "ASP.Net
              >>Web Site". Nothing new there. However, I'm not doing the ASP.Net usual of letting the user agent (HTTP header
              >>'accept-language') determine which language visitors get; I have the country-code TLD drive it. Also, it's not just
              >>the language of my content that varies by cc TLD, it's the content, too; but, lang attributes play a critical role
              >>in informing user agents (including search engine bots) for what "country" my content is aimed.
              >>>
              >>I have already found, first-hand, that the better of the major search engines use the cc TLD *and* the HTML
              >>lang/xml:lang to determine whether a domain's documents (mysite.com.au/my-document.aspx) should show up when a
              >>searcher searches with the 'Only from Australia' checkbox checked on Live.com, for example.
              >>>
              >>I'm not setting lang attributes for fun; I'm doing it to correct search engine results. ASP.NET should make it easy
              >>for me--and, it does, but there is a bug in the implementation.
              >>>
              >>I appreciate your interest and effort to help.
              >>>
              >>, Lee
              >>>
              >>>
              >>"Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message news:uBUnQxT2IH A.4164@TK2MSFTN GP03.phx.gbl...
              >>>re:
              >>>!versus the spirit of what we're trying to accomplish: telling user agents who our
              >>>!intended audiences is, by language, as best we can...which is why I'm *also*
              >>>!setting lang in the HTTP headers and in page meta tags
              >>>>
              >>>What ? You don't set a language/culture in web.config, too ?
              >>>There's a use for overkill ! ( only kidding... )
              >>>>
              >>>I don't see too clearly the purpose of declaring a single language for a web page.
              >>>>
              >>>I do see a use for declaring specific language attributes in a *collection* of xml documents,
              >>>so that individual documents can be parsed for a particular language content.
              >>>>
              >>>But, ymmv...
              >>>>
              >>>I'd still be interested in knowing what the reply is to your bug report.
              >>>I bet you'll get back : "That's by design". <g>
              >>>>
              >>>Don't forget to let us all know what happens with that, OK ?
              >>>Thanks for an interesting discussion.
              >>>>
              >>>>
              >>>>
              >>>>
              >>>Juan T. Llibre, asp.net MVP
              >>>asp.net faq : http://asp.net.do/faq/
              >>>foros de asp.net, en español : http://asp.net.do/foros/
              >>>============ =============== ===========
              >>>"Lee C." <nomail@spam.co mwrote in message news:en1PZVT2IH A.524@TK2MSFTNG P05.phx.gbl...
              >>>>Juan,
              >>>>>
              >>>>In theory, I like your idea of investigating "the standard"; but, in practice it has serious problems, as it often
              >>>>does. First, you are referring to the XML standard, which is not as appropriate as HTML and XHTML standards.
              >>>>Second, none of them are crystal clear on best practices for I18N. There is a lot of *legal* (by the standard)
              >>>>syntax, that makes no sense, or makes some sense without being clearly best. The W3C site often states something
              >>>>to the effect of, "some are doing this, some are doing that, on your own site, at least do something and only time
              >>>>will tell what is best."
              >>>>>
              >>>>Check out these fine examples, which mirror my syntax, on the W3C site.
              >>>>>
              >>>>Internation alization Best Practices: Specifying Language in XHTML & HTML Content
              >>>>http://www.w3.org/TR/i18n-html-tech-...0429.092928424
              >>>>>
              >>>>>
              >>>>Tutorial: Declaring Language in XHTML and HTML (Draft)
              >>>>http://www.w3.org/International/tuto...Slide0160.html
              >>>>>
              >>>>Juan, you wrote:
              >>>>>But, it seems to me that setting xml:lang for the html tag's *attribute* values is unneeded, since they must
              >>>>>be in English, and they must be attributes set to a language identifier, as defined by IETF RFC 4646
              >>>>>(http://www.ietf.org/rfc/rfc4646.txt).
              >>>>>
              >>>>You're not setting it for "the tag's *attribute*", you're setting it for the *contents*, all contents, of the
              >>>>element (unless overridden by a sub-setting), which makes perfect sense so that I don't have to set it
              >>>>individuall y on every child element--that is the power of a hierarchy! You seem to be focused on the technical,
              >>>>with some misunderstandin g, versus the spirit of what we're trying to accomplish: telling user agents who our
              >>>>intended audiences is, by language, as best we can...which is why I'm *also* setting lang in the HTTP headers and
              >>>>in page meta tags.
              >>>>>
              >>>>, Lee
              >>>>>
              >>>>>
              >>>>"Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message news:OYI4upK2IH A.5140@TK2MSFTN GP02.phx.gbl...
              >>>>>re:
              >>>>>!I found an MSDN document that explains why what I'm trying to do should work
              >>>>>>
              >>>>>Lee,
              >>>>>>
              >>>>>From :
              >>>>>>
              >>>>>http://www.w3.org/TR/REC-xml/
              >>>>>>
              >>>>>"A special attribute named xml:lang may be inserted in documents to specify the
              >>>>>language used in the contents and attribute values of any element in an XML document."
              >>>>>>
              >>>>>If anything, I can see xml:lang being declared for specific content values, for example :
              >>>>>>
              >>>>><p xml:lang="en-GB">What colour is it?</p>
              >>>>><p xml:lang="en-US">What color is it?</p>
              >>>>>>
              >>>>>Then, an xml parser could identify regional US and British spellings but, given that *all* the attribute values
              >>>>>must be in English in an html doc, what would be the purpose of declaring xml:lang for the html markup ?
              >>>>>>
              >>>>>A similar explanation is given here :
              >>>>>http://www.simonstl.com/xmlprim/xmlupdate/atts.html
              >>>>>>
              >>>>>---000---
              >>>>><SECTION >
              >>>>><DESCRIPTI ON xml:lang="en">
              >>>>>Caesar begins by describing the geography of Gaul.
              >>>>></DESCRIPTION>
              >>>>><QUOTE xml:lang="la">
              >>>>>Gallia est omnis divisa in partes tres, quarum unam incolunt Belgae,
              >>>>>aliam Aquitani, tertiam qui ipsorum lingua Celtae, nostra Galli appellantur.
              >>>>></QUOTE>
              >>>>>---000---
              >>>>>>
              >>>>>That's perfectly good usage for xml:lang, as a parser could selectively identify content in different languages.
              >>>>>>
              >>>>>But, it seems to me that setting xml:lang for the html tag's *attribute* values is unneeded, since they must
              >>>>>be in English, and they must be attributes set to a language identifier, as defined by IETF RFC 4646
              >>>>>(http://www.ietf.org/rfc/rfc4646.txt).
              >>>>>>
              >>>>>So, I think that requisite pretty well establishes the futility
              >>>>>of setting xml:lang for all the attributes in an html document.
              >>>>>>
              >>>>>If anything, it seems that the xml:lang attribute is included in the
              >>>>>html server tag for compatibility purposes, or perhaps out of ignorance.
              >>>>>>
              >>>>>If there's a need to identify that the *contents* of a particular markup tag are in a
              >>>>>specific language, that identification can be included in the tag itself, for example :
              >>>>>>
              >>>>><div lang="MX-es" xml:lang="MX-es">
              >>>>>Algo de contenido en español mejicano.
              >>>>></div>
              >>>>>>
              >>>>>That makes a lot more sense than setting xml:lang for the attribute values in the html tag.
              >>>>>>
              >>>>>>
              >>>>>>
              >>>>>Juan T. Llibre, asp.net MVP
              >>>>>asp.net faq : http://asp.net.do/faq/
              >>>>>foros de asp.net, en español : http://asp.net.do/foros/
              >>>>>========== =============== =============
              >>>>>"Lee C." <no.spam@spamme r.comwrote in message news:%23ocUnoI2 IHA.2188@TK2MSF TNGP04.phx.gbl. ..
              >>>>>>>I found an MSDN document that explains why what I'm trying to do should work.
              >>>>>>>
              >>>>>>ASP.NET Web Server Controls Overview
              >>>>>>http://msdn.microsoft.com/en-us/library/zsyt68f1.aspx
              >>>>>>>
              >>>>>>Note the distinction between HTML Server Controls and Web Server Controls in the document. Also, note the
              >>>>>>explanati on
              >>>>>>of "pass-through" attributes for HTML Server Controls.
              >>>>>>>
              >>>>>>Two quotes that sum it up:
              >>>>>> 1. Any HTML element on a page can be converted to an HTML server control by adding the attribute
              >>>>>>runat="se rver".
              >>>>>> 2. You can add any attributes you need to an HTML server control and the page framework will render them
              >>>>>>without
              >>>>>>any change in functionality.
              >>>>>>>
              >>>>>>, Lee
              >>>>>>>
              >>>>>>"Lee C." <no.spam@spamme r.comwrote in message news:Oe38JYI2IH A.4772@TK2MSFTN GP03.phx.gbl...
              >>>>>>>Juan,
              >>>>>>>>
              >>>>>>>I appreciate your trying to help, but you're wrong, and you are the one who is confused. :]
              >>>>>>>>
              >>>>>>>I am *not* disputing that when inserted programmaticall y, the xml:lang attribute renders to the browser. I did
              >>>>>>>just
              >>>>>>>that as a work around (right after I discovered this bug); but, I should not have to.
              >>>>>>>>
              >>>>>>>I am *not* confusing html attributes with runat="server" attributes, as you call them. Using your logic, none
              >>>>>>>of the
              >>>>>>>declarat ive (html) attributes should render to the browser after I add the runat="server" in ASP.NET; yet all
              >>>>>>>of them
              >>>>>>>(xmlns , lang, and dir) do--except xml:lang.
              >>>>>>>>
              >>>>>>>I started with an html element with 4 attributes (xmlns, lang, xml:lang, and dir) all set declaratively. With
              >>>>>>>*no*
              >>>>>>>5th attribute of runat="server", all 4 attributes render. If I add the 5th attribute of runat="server", which
              >>>>>>>does
              >>>>>>>not and should not render, I no longer get all 4 attributes that should render (xmlns, lang, xml:lang, and
              >>>>>>>dir), I
              >>>>>>>only get 3 (xmlns, lang, and dir). My logic says I should get 4, your says I should get 3? It would be 4 or
              >>>>>>>0, and
              >>>>>>>4 is right. Not 0...and not 3.
              >>>>>>>>
              >>>>>>>When I add runat="server", it does not magically make the xml:lang attribute a server-side attribute, while
              >>>>>>>keepin g
              >>>>>>>the other three attributes as "html" attributes. All four are still "html" attributes--which should render.
              >>>>>>>>
              >>>>>>>I think the simplification of my example may be confusing you. It is odd that, in my example, I set
              >>>>>>>runat="s erver"
              >>>>>>>but do not have any server-side attributes. (I have all 4 as literal strings, for simplicity of an example.)
              >>>>>>>Well,
              >>>>>>>in my real-world use, I do have server-side attributes, which I want set declaratively (no code-beside and no
              >>>>>>>script ). I have:
              >>>>>>>>
              >>>>>>><html runat="server" xmlns="http://www.w3.org/1999/xhtml"
              >>>>>>> xml:lang="<%$ Resources:Globa lLang, ContentAudience Language %>"
              >>>>>>> lang="<%$ Resources:Globa lLang, ContentAudience Language %>"
              >>>>>>> dir="ltr">
              >>>>>>>>
              >>>>>>>Both of those declarative explicit localization expressions should work without my having to write any more
              >>>>>>>"procedu ral" (code-beside) code or script. It actually does work fine for the lang attribute--as it should;
              >>>>>>>but not
              >>>>>>>for the xml:lang attribute--***which is a bug***.
              >>>>>>>>
              >>>>>>>, Lee
              >>>>>>>>
              >>>>>>>"Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message news:u0WzB9H2IH A.4188@TK2MSFTN GP04.phx.gbl...
              >>>>>>>>re:
              >>>>>>>>!I think you are misunderstandin g, Juan.
              >>>>>>>>>
              >>>>>>>>Well, I think you are misunderstandin g *me*.
              >>>>>>>>>
              >>>>>>>>re:
              >>>>>>>>!I had the xml:lang attribute in the html tag (declaratively) , like this:
              >>>>>>>>>...a nd it renders to the browser, as it should.
              >>>>>>>>>
              >>>>>>>>Yes, because it's standard html.
              >>>>>>>>>
              >>>>>>>>re:
              >>>>>>>>!If I simply add runat="server"
              >>>>>>>>>
              >>>>>>>>That declares the control to run server side.
              >>>>>>>>>
              >>>>>>>>For any attribute to be programmed server-side you need a script,
              >>>>>>>>just as you need a script to modify any server control's attributes.
              >>>>>>>>>
              >>>>>>>>Did you run the sample page I sent ?
              >>>>>>>>>
              >>>>>>>>It iterates throught the attributes for the html server control,
              >>>>>>>>and shows that the xml:lang attribute *is* added programmaticall y.
              >>>>>>>>>
              >>>>>>>>re:
              >>>>>>>>!If I simply add runat="server", leaving in the xml:lang attribute that
              >>>>>>>>!render s without runat="server", all of the (declarative) attributes are
              >>>>>>>>!render ed to the browser--except the xml:lang attribute! That is a bug.
              >>>>>>>>>
              >>>>>>>>I think you're confusing html attributes with runat="server" attributes.
              >>>>>>>>>
              >>>>>>>>Html attributes can be inserted in normal html.
              >>>>>>>>Serve r-side attributes must be inserted in code.
              >>>>>>>>>
              >>>>>>>>Maybe I'm not explaining this as well as I should.
              >>>>>>>>Try to get someone else's opinion on this matter, if you don't accept mine.
              >>>>>>>>>
              >>>>>>>>>
              >>>>>>>>>
              >>>>>>>>Juan T. Llibre, asp.net MVP
              >>>>>>>>asp.n et faq : http://asp.net.do/faq/
              >>>>>>>>foros de asp.net, en español : http://asp.net.do/foros/
              >>>>>>>>======= =============== =============== =
              >>>>>>>>"Lee C." <no.spam@spamme r.comwrote in message news:enam1gH2IH A.4552@TK2MSFTN GP04.phx.gbl...
              >>>>>>>>>>I think you are misunderstandin g, Juan. I had the xml:lang attribute in the html tag (declaratively) , like
              >>>>>>>>>>thi s:
              >>>>>>>>>>
              >>>>>>>>><htm l xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US" dir="ltr">
              >>>>>>>>>>
              >>>>>>>>>...a nd it renders to the browser, as it should.
              >>>>>>>>>>
              >>>>>>>>>If I simply add runat="server", leaving in the xml:lang attribute that renders without runat="server", all of
              >>>>>>>>>the
              >>>>>>>>>(decla rative) attributes are rendered to the browser--except the xml:lang attribute! That is a bug.
              >>>>>>>>>>
              >>>>>>>>><htm l runat="server" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US" dir="ltr">
              >>>>>>>>>>
              >>>>>>>>>Cordia lly,
              >>>>>>>>>Lee
              >>>>>>>>>>
              >>>>>>>>>>
              >>>>>>>>>"Jua n T. Llibre" <nomailreplies@ nowhere.comwrot e in message news:eyrwjUH2IH A.3920@TK2MSFTN GP02.phx.gbl...
              >>>>>>>>>>Here' s a full example which shows that the xml:lang attribute is added programmaticall y :
              >>>>>>>>>>>
              >>>>>>>>>>attri butes.aspx:
              >>>>>>>>>>----------------------
              >>>>>>>>>><%@ Page Language="C#" AutoEventWireup ="True" %>
              >>>>>>>>>><ht ml xmlns="http://www.w3.org/1999/xhtml" runat="server" id="Myid" >
              >>>>>>>>>><scri pt language="C#" runat="server">
              >>>>>>>>>>voi d Page_Load(Objec t sender, EventArgs e)
              >>>>>>>>>>{
              >>>>>>>>>>Myid. Attributes.Add( "xml:lang", "es");
              >>>>>>>>>>Messa ge.InnerHtml = "<h4>The html control attributes collection contains:</h4>";
              >>>>>>>>>>IEnum erator keys = Myid.Attributes .Keys.GetEnumer ator();
              >>>>>>>>>>whi le (keys.MoveNext( ))
              >>>>>>>>>>{
              >>>>>>>>>>Strin g key = (String)keys.Cu rrent;
              >>>>>>>>>>Messa ge.InnerHtml += key + "=" + Myid.Attributes[key] + "<br />";
              >>>>>>>>>>}
              >>>>>>>>>>}
              >>>>>>>>>></script>
              >>>>>>>>>><he ad id="Head1" runat="server">
              >>>>>>>>>><titl e>The html control attributes collection</title>
              >>>>>>>>>></head>
              >>>>>>>>>><body >
              >>>>>>>>>><fo rm id="Form1" runat="server">
              >>>>>>>>>><h3>H tmlControl Attribute Collection Example</h3>
              >>>>>>>>>><br />
              >>>>>>>>>><sp an id="Message" enableviewstate ="false" runat="server" />
              >>>>>>>>>></form>
              >>>>>>>>>></body>
              >>>>>>>>>></html>
              >>>>>>>>>>----------------
              >>>>>>>>>>>
              >>>>>>>>>>I don't think it's a bug to have to add an attribute programmaticall y,
              >>>>>>>>>>becau se the runat="server" tag only *declares* the html control as a programmable control.
              >>>>>>>>>>>
              >>>>>>>>>>To actually program it, you must use a script.
              >>>>>>>>>>>
              >>>>>>>>>>>
              >>>>>>>>>>>
              >>>>>>>>>>>
              >>>>>>>>>>Jua n T. Llibre, asp.net MVP
              >>>>>>>>>>asp.n et faq : http://asp.net.do/faq/
              >>>>>>>>>>for os de asp.net, en español : http://asp.net.do/foros/
              >>>>>>>>>>===== =============== =============== ===
              >>>>>>>>>>"Le e C." <no.spam@spamme r.comwrote in message news:e0rLaPG2IH A.4772@TK2MSFTN GP03.phx.gbl...
              >>>>>>>>>>>Than ks, Juan.
              >>>>>>>>>>>>
              >>>>>>>>>>>I already added similar code to a page event in my masterpage code-beside.
              >>>>>>>>>>>>
              >>>>>>>>>>> elHtml.Attribut es.Add("xml:lan g", Resources.Globa lLang.ContentAu dienceLanguage)
              >>>>>>>>>>>>
              >>>>>>>>>>>To me, that is a temporary workaround. I still want to understand whether the "eating" of the attribute I
              >>>>>>>>>>>orig inally
              >>>>>>>>>>>post ed about is a bug, or if this is actually happening for a reason.
              >>>>>>>>>>>>
              >>>>>>>>>>>Cord ially,
              >>>>>>>>>>>Le e
              >>>>>>>>>>>>
              >>>>>>>>>>>>
              >>>>>>>>>>>"Jua n T. Llibre" <nomailreplies@ nowhere.comwrot e in message
              >>>>>>>>>>>news :%23gBUqSC2IHA. 4772@TK2MSFTNGP 03.phx.gbl...
              >>>>>>>>>>>>H i, Lee.
              >>>>>>>>>>>>>
              >>>>>>>>>>>>r e:
              >>>>>>>>>>>>!<h tml runat="server" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US" dir="ltr">
              >>>>>>>>>>>>! no xml:lang attribute is rendered to the browser!
              >>>>>>>>>>>>!Re move the runat="server", and, voila, the xml:lang attribute is rendered.
              >>>>>>>>>>>>>
              >>>>>>>>>>>>T ry this :
              >>>>>>>>>>>>>
              >>>>>>>>>>>><ht ml xmlns="http://www.w3.org/1999/xhtml" runat="server" id="someID">
              >>>>>>>>>>>>>
              >>>>>>>>>>>><sc ript runat="server">
              >>>>>>>>>>>>som eID.Attributes( "xml:lang") = "en-US"
              >>>>>>>>>>>></script>
              >>>>>>>>>>>>>
              >>>>>>>>>>>>>
              >>>>>>>>>>>>>
              >>>>>>>>>>>>Jua n T. Llibre, asp.net MVP
              >>>>>>>>>>>>asp .net faq : http://asp.net.do/faq/
              >>>>>>>>>>>>for os de asp.net, en español : http://asp.net.do/foros/
              >>>>>>>>>>>>=== =============== =============== =====
              >>>>>>>>>>>>>
              >>>>>>>>>>>>"Le e C." <nomail@spam.co mwrote in message news:O%23KsAQA2 IHA.4572@TK2MSF TNGP03.phx.gbl. ..
              >>>>>>>>>>>>> >I think I have discovered a bug in ASP.NET, related to I18N.
              >>>>>>>>>>>>> >
              >>>>>>>>>>>>> In ASP.NET 3.5 I have to set runat="server" on the html element to use explicit expressions. It appears
              >>>>>>>>>>>>>th at
              >>>>>>>>>>>>>AS P.NET
              >>>>>>>>>>>>>ea ts the xml:lang attribute on the html element when it is set to runat="server".
              >>>>>>>>>>>>> >
              >>>>>>>>>>>>> Of course I want to replace the hardcoded "en-US" values with (resource) explicit expressions; but, for
              >>>>>>>>>>>>>si mplicity,
              >>>>>>>>>>>>>tr y this:
              >>>>>>>>>>>>> >
              >>>>>>>>>>>>><h tml runat="server" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US" dir="ltr">
              >>>>>>>>>>>>> >
              >>>>>>>>>>>>>.. .And you will find that no xml:lang attribute is rendered to the browser! Remove the runat="server",
              >>>>>>>>>>>>>an d,
              >>>>>>>>>>>>>vo ila,
              >>>>>>>>>>>>>th e
              >>>>>>>>>>>>>xm l:lang attribute is rendered. :[
              >>>>>>>>>>>>> >
              >>>>>>>>>>>>>.. .Any ideas?
              >>>>>>>>>>>>> >
              >>>>>>>>>>>>>Co rdially,
              >>>>>>>>>>>>>Le e
              >>>>>>>>>>>>> >
              >>>>>>>>>>>>> >
              >>>>>>>>>>>>>
              >>>>>>>>>>>>>
              >>>>>>>>>>>>>
              >>>>>>>>>>>>
              >>>>>>>>>>>>
              >>>>>>>>>>>
              >>>>>>>>>>>
              >>>>>>>>>>>
              >>>>>>>>>>
              >>>>>>>>>>
              >>>>>>>>>
              >>>>>>>>>
              >>>>>>>>
              >>>>>>>>
              >>>>>>>
              >>>>>>>
              >>>>>>
              >>>>>>
              >>>>>>
              >>>>>>
              >>>>>
              >>>>>
              >>>>
              >>>>
              >>>
              >>>
              >>
              >>
              >
              >

              Comment

              • Lee C.

                #8
                Re: ASP.NET Internationaliz ation bug?

                Juan,

                You clearly don't understand, or have not thought about *why* the ASP.NET
                team gave us separate places for "design"/content (.aspx files) and
                "procedure"/code (.aspx.vb). The ability to separate the 2 was a huge
                feature for ASP.NET, from classic ASP.

                Even though the particular content affected by the bug I found is not
                *visible* Web browser content, it is content none-the-less. Thus, its
                wiring belongs in the content file (.aspx)--not the code file (.aspx.vb).
                Sure, I could throw in some classic ASP style, and put a script element in
                my .aspx page to keep the wiring in the realm of the designer, but that
                changes nothing, because it's still programming, which should be done by
                programmers in the same place as every other line of programming in my site:
                the .aspx.vb pages. Just as badly, it means I'm achieving my I18N wiring in
                multiple ways, instead of being consistent.

                By everything else, I meant all other I18N resource "wirings". (But, I take
                pride in how "light" my .aspx.vb files are--and how clean my .aspx files
                are, too.) You are obviously fine with having the designer(s) to set up and
                manage *most* of the I18N wirings, *and* having programmers to do some, too,
                (as they should not be doing) since bugs are not bugs for you if there is a
                workaround that violates good design practices and principles. I'm not fine
                with that.

                Are you really an ASP.NET MVP? (Classic ASP, maybe?)

                , Lee


                "Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message
                news:urCttna2IH A.4476@TK2MSFTN GP06.phx.gbl...
                re:
                !Setting it programmaticall y is an incorrect implementation
                !when everything else on my page is set declaratively.
                >
                Is everything else on your pages set declaratively ?
                Think about that for a second.
                >
                Why do we have inline scripts and code-behind, if "everything else is set
                declaratively" ?
                >
                In any case, we've certainly had enough of the "I think that..." back and
                forth.
                >
                Let's pause this discussion until the "bug" you reported is explained by
                the VS Dev team, OK ?
                I, definitely, want to see what their explanation is.
                >

                >
                >
                >
                Juan T. Llibre, asp.net MVP
                asp.net faq : http://asp.net.do/faq/
                foros de asp.net, en español : http://asp.net.do/foros/
                =============== =============== ========
                "Lee C." <nomail@spam.co mwrote in message
                news:eQlpa4W2IH A.4704@TK2MSFTN GP05.phx.gbl...
                >Correct implementation? What do you mean by that?
                >>
                >I stated earlier on that I worked around it. It's still a bug. Setting
                >it programmaticall y is an incorrect implementation when everything else
                >on my page is set declaratively. Microsoft offered declarative
                >(explicit) expressions, and I want to use them--anywhere and everywhere I
                >choose in accordance with how they are stated to work. When I find one
                >that doesn't work, it's a bug; it's not a case of my doing something
                >incorrectly. I love Microsoft Visual Studio 2008; but, I won't tolerate
                >bugs, or suck them up as, "Oh, I must be doing it wrong since it doesn't
                >work--even though it should."
                >>
                >, Lee
                >>
                >"Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message
                >news:%23xhBpuW 2IHA.2384@TK2MS FTNGP04.phx.gbl ...
                >>re:
                >>!ASP.NET should make it easy for me--and, it does,
                >>!but there is a bug in the implementation.
                >>>
                >>The fact that you *can* set xml:lang programmaticall y, and that you
                >>*did* set it that way,
                >>as I did, should tell you that it isn't much of a bug, but a question of
                >>using the correct implementation.
                >>>
                >>But, again, please let us know what the reply to your bug report is.
                >>>
                >>>
                >>>
                >>Juan T. Llibre, asp.net MVP
                >>asp.net faq : http://asp.net.do/faq/
                >>foros de asp.net, en español : http://asp.net.do/foros/
                >>============= =============== ==========
                >>"Lee C." <nomail@spam.co mwrote in message
                >>news:%239PIQv U2IHA.2384@TK2M SFTNGP04.phx.gb l...
                >>>Juan,
                >>>>
                >>>My use of language and culture in ASP.Net is a bit different than most.
                >>>I have registered numerous country-code-specific domains (mysite.ca,
                >>>mysite.co.uk , mysite.com.au, etc.), which resolve to a singular
                >>>"ASP.Net Web Site". Nothing new there. However, I'm not doing the
                >>>ASP.Net usual of letting the user agent (HTTP header 'accept-language')
                >>>determine which language visitors get; I have the country-code TLD
                >>>drive it. Also, it's not just the language of my content that varies
                >>>by cc TLD, it's the content, too; but, lang attributes play a critical
                >>>role in informing user agents (including search engine bots) for what
                >>>"country" my content is aimed.
                >>>>
                >>>I have already found, first-hand, that the better of the major search
                >>>engines use the cc TLD *and* the HTML lang/xml:lang to determine
                >>>whether a domain's documents (mysite.com.au/my-document.aspx) should
                >>>show up when a searcher searches with the 'Only from Australia'
                >>>checkbox checked on Live.com, for example.
                >>>>
                >>>I'm not setting lang attributes for fun; I'm doing it to correct search
                >>>engine results. ASP.NET should make it easy for me--and, it does, but
                >>>there is a bug in the implementation.
                >>>>
                >>>I appreciate your interest and effort to help.
                >>>>
                >>>, Lee
                >>>>
                >>>>
                >>>"Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message
                >>>news:uBUnQxT 2IHA.4164@TK2MS FTNGP03.phx.gbl ...
                >>>>re:
                >>>>!versus the spirit of what we're trying to accomplish: telling user
                >>>>agents who our
                >>>>!intended audiences is, by language, as best we can...which is why
                >>>>I'm *also*
                >>>>!setting lang in the HTTP headers and in page meta tags
                >>>>>
                >>>>What ? You don't set a language/culture in web.config, too ?
                >>>>There's a use for overkill ! ( only kidding... )
                >>>>>
                >>>>I don't see too clearly the purpose of declaring a single language for
                >>>>a web page.
                >>>>>
                >>>>I do see a use for declaring specific language attributes in a
                >>>>*collection * of xml documents,
                >>>>so that individual documents can be parsed for a particular language
                >>>>content.
                >>>>>
                >>>>But, ymmv...
                >>>>>
                >>>>I'd still be interested in knowing what the reply is to your bug
                >>>>report.
                >>>>I bet you'll get back : "That's by design". <g>
                >>>>>
                >>>>Don't forget to let us all know what happens with that, OK ?
                >>>>Thanks for an interesting discussion.
                >>>>>
                >>>>>
                >>>>>
                >>>>>
                >>>>Juan T. Llibre, asp.net MVP
                >>>>asp.net faq : http://asp.net.do/faq/
                >>>>foros de asp.net, en español : http://asp.net.do/foros/
                >>>>=========== =============== ============
                >>>>"Lee C." <nomail@spam.co mwrote in message
                >>>>news:en1PZV T2IHA.524@TK2MS FTNGP05.phx.gbl ...
                >>>>>Juan,
                >>>>>>
                >>>>>In theory, I like your idea of investigating "the standard"; but, in
                >>>>>practice it has serious problems, as it often does. First, you are
                >>>>>referrin g to the XML standard, which is not as appropriate as HTML
                >>>>>and XHTML standards. Second, none of them are crystal clear on best
                >>>>>practice s for I18N. There is a lot of *legal* (by the standard)
                >>>>>syntax, that makes no sense, or makes some sense without being
                >>>>>clearly best. The W3C site often states something to the effect of,
                >>>>>"some are doing this, some are doing that, on your own site, at least
                >>>>>do something and only time will tell what is best."
                >>>>>>
                >>>>>Check out these fine examples, which mirror my syntax, on the W3C
                >>>>>site.
                >>>>>>
                >>>>>Internatio nalization Best Practices: Specifying Language in XHTML &
                >>>>>HTML Content
                >>>>>http://www.w3.org/TR/i18n-html-tech-...0429.092928424
                >>>>>>
                >>>>>>
                >>>>>Tutorial : Declaring Language in XHTML and HTML (Draft)
                >>>>>http://www.w3.org/International/tuto...Slide0160.html
                >>>>>>
                >>>>>Juan, you wrote:
                >>>>>>But, it seems to me that setting xml:lang for the html tag's
                >>>>>>*attribut e* values is unneeded, since they must
                >>>>>>be in English, and they must be attributes set to a language
                >>>>>>identifie r, as defined by IETF RFC 4646
                >>>>>>(http://www.ietf.org/rfc/rfc4646.txt).
                >>>>>>
                >>>>>You're not setting it for "the tag's *attribute*", you're setting it
                >>>>>for the *contents*, all contents, of the element (unless overridden
                >>>>>by a sub-setting), which makes perfect sense so that I don't have to
                >>>>>set it individually on every child element--that is the power of a
                >>>>>hierarch y! You seem to be focused on the technical, with some
                >>>>>misunderst anding, versus the spirit of what we're trying to
                >>>>>accomplish : telling user agents who our intended audiences is, by
                >>>>>language , as best we can...which is why I'm *also* setting lang in
                >>>>>the HTTP headers and in page meta tags.
                >>>>>>
                >>>>>, Lee
                >>>>>>
                >>>>>>
                >>>>>"Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message
                >>>>>news:OYI4u pK2IHA.5140@TK2 MSFTNGP02.phx.g bl...
                >>>>>>re:
                >>>>>>!I found an MSDN document that explains why what I'm trying to do
                >>>>>>should work
                >>>>>>>
                >>>>>>Lee,
                >>>>>>>
                >>>>>>From :
                >>>>>>>
                >>>>>>http://www.w3.org/TR/REC-xml/
                >>>>>>>
                >>>>>>"A special attribute named xml:lang may be inserted in documents to
                >>>>>>specify the
                >>>>>>languag e used in the contents and attribute values of any element in
                >>>>>>an XML document."
                >>>>>>>
                >>>>>>If anything, I can see xml:lang being declared for specific content
                >>>>>>values, for example :
                >>>>>>>
                >>>>>><p xml:lang="en-GB">What colour is it?</p>
                >>>>>><p xml:lang="en-US">What color is it?</p>
                >>>>>>>
                >>>>>>Then, an xml parser could identify regional US and British spellings
                >>>>>>but, given that *all* the attribute values
                >>>>>>must be in English in an html doc, what would be the purpose of
                >>>>>>declari ng xml:lang for the html markup ?
                >>>>>>>
                >>>>>>A similar explanation is given here :
                >>>>>>http://www.simonstl.com/xmlprim/xmlupdate/atts.html
                >>>>>>>
                >>>>>>---000---
                >>>>>><SECTIO N>
                >>>>>><DESCRIPT ION xml:lang="en">
                >>>>>>Caesar begins by describing the geography of Gaul.
                >>>>>></DESCRIPTION>
                >>>>>><QUOTE xml:lang="la">
                >>>>>>Gallia est omnis divisa in partes tres, quarum unam incolunt Belgae,
                >>>>>>aliam Aquitani, tertiam qui ipsorum lingua Celtae, nostra Galli
                >>>>>>appellant ur.
                >>>>>></QUOTE>
                >>>>>>---000---
                >>>>>>>
                >>>>>>That's perfectly good usage for xml:lang, as a parser could
                >>>>>>selective ly identify content in different languages.
                >>>>>>>
                >>>>>>But, it seems to me that setting xml:lang for the html tag's
                >>>>>>*attribut e* values is unneeded, since they must
                >>>>>>be in English, and they must be attributes set to a language
                >>>>>>identifie r, as defined by IETF RFC 4646
                >>>>>>(http://www.ietf.org/rfc/rfc4646.txt).
                >>>>>>>
                >>>>>>So, I think that requisite pretty well establishes the futility
                >>>>>>of setting xml:lang for all the attributes in an html document.
                >>>>>>>
                >>>>>>If anything, it seems that the xml:lang attribute is included in the
                >>>>>>html server tag for compatibility purposes, or perhaps out of
                >>>>>>ignorance .
                >>>>>>>
                >>>>>>If there's a need to identify that the *contents* of a particular
                >>>>>>markup tag are in a
                >>>>>>specifi c language, that identification can be included in the tag
                >>>>>>itself, for example :
                >>>>>>>
                >>>>>><div lang="MX-es" xml:lang="MX-es">
                >>>>>>Algo de contenido en español mejicano.
                >>>>>></div>
                >>>>>>>
                >>>>>>That makes a lot more sense than setting xml:lang for the attribute
                >>>>>>values in the html tag.
                >>>>>>>
                >>>>>>>
                >>>>>>>
                >>>>>>Juan T. Llibre, asp.net MVP
                >>>>>>asp.net faq : http://asp.net.do/faq/
                >>>>>>foros de asp.net, en español : http://asp.net.do/foros/
                >>>>>>========= =============== ==============
                >>>>>>"Lee C." <no.spam@spamme r.comwrote in message
                >>>>>>news:%23o cUnoI2IHA.2188@ TK2MSFTNGP04.ph x.gbl...
                >>>>>>>>I found an MSDN document that explains why what I'm trying to do
                >>>>>>>>shoul d work.
                >>>>>>>>
                >>>>>>>ASP.NE T Web Server Controls Overview
                >>>>>>>http://msdn.microsoft.com/en-us/library/zsyt68f1.aspx
                >>>>>>>>
                >>>>>>>Note the distinction between HTML Server Controls and Web Server
                >>>>>>>Contro ls in the document. Also, note the explanation
                >>>>>>>of "pass-through" attributes for HTML Server Controls.
                >>>>>>>>
                >>>>>>>Two quotes that sum it up:
                >>>>>>> 1. Any HTML element on a page can be converted to an HTML server
                >>>>>>>contro l by adding the attribute runat="server".
                >>>>>>> 2. You can add any attributes you need to an HTML server control
                >>>>>>>and the page framework will render them without
                >>>>>>>any change in functionality.
                >>>>>>>>
                >>>>>>>, Lee
                >>>>>>>>
                >>>>>>>"Lee C." <no.spam@spamme r.comwrote in message
                >>>>>>>news:Oe3 8JYI2IHA.4772@T K2MSFTNGP03.phx .gbl...
                >>>>>>>>Juan,
                >>>>>>>>>
                >>>>>>>>I appreciate your trying to help, but you're wrong, and you are
                >>>>>>>>the one who is confused. :]
                >>>>>>>>>
                >>>>>>>>I am *not* disputing that when inserted programmaticall y, the
                >>>>>>>>xml:lan g attribute renders to the browser. I did just
                >>>>>>>>that as a work around (right after I discovered this bug); but, I
                >>>>>>>>shoul d not have to.
                >>>>>>>>>
                >>>>>>>>I am *not* confusing html attributes with runat="server"
                >>>>>>>>attribu tes, as you call them. Using your logic, none of the
                >>>>>>>>declara tive (html) attributes should render to the browser after I
                >>>>>>>>add the runat="server" in ASP.NET; yet all of them
                >>>>>>>>(xmln s, lang, and dir) do--except xml:lang.
                >>>>>>>>>
                >>>>>>>>I started with an html element with 4 attributes (xmlns, lang,
                >>>>>>>>xml:lan g, and dir) all set declaratively. With *no*
                >>>>>>>>5th attribute of runat="server", all 4 attributes render. If I
                >>>>>>>>add the 5th attribute of runat="server", which does
                >>>>>>>>not and should not render, I no longer get all 4 attributes that
                >>>>>>>>shoul d render (xmlns, lang, xml:lang, and dir), I
                >>>>>>>>only get 3 (xmlns, lang, and dir). My logic says I should get 4,
                >>>>>>>>your says I should get 3? It would be 4 or 0, and
                >>>>>>>>4 is right. Not 0...and not 3.
                >>>>>>>>>
                >>>>>>>>When I add runat="server", it does not magically make the xml:lang
                >>>>>>>>attribu te a server-side attribute, while keeping
                >>>>>>>>the other three attributes as "html" attributes. All four are
                >>>>>>>>still "html" attributes--which should render.
                >>>>>>>>>
                >>>>>>>>I think the simplification of my example may be confusing you. It
                >>>>>>>>is odd that, in my example, I set runat="server"
                >>>>>>>>but do not have any server-side attributes. (I have all 4 as
                >>>>>>>>liter al strings, for simplicity of an example.) Well,
                >>>>>>>>in my real-world use, I do have server-side attributes, which I
                >>>>>>>>want set declaratively (no code-beside and no
                >>>>>>>>script) . I have:
                >>>>>>>>>
                >>>>>>>><html runat="server" xmlns="http://www.w3.org/1999/xhtml"
                >>>>>>>> xml:lang="<%$ Resources:Globa lLang, ContentAudience Language %>"
                >>>>>>>> lang="<%$ Resources:Globa lLang, ContentAudience Language %>"
                >>>>>>>> dir="ltr">
                >>>>>>>>>
                >>>>>>>>Both of those declarative explicit localization expressions should
                >>>>>>>>work without my having to write any more
                >>>>>>>>"proced ural" (code-beside) code or script. It actually does work
                >>>>>>>>fine for the lang attribute--as it should; but not
                >>>>>>>>for the xml:lang attribute--***which is a bug***.
                >>>>>>>>>
                >>>>>>>>, Lee
                >>>>>>>>>
                >>>>>>>>"Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message
                >>>>>>>>news:u0 WzB9H2IHA.4188@ TK2MSFTNGP04.ph x.gbl...
                >>>>>>>>>re:
                >>>>>>>>>!I think you are misunderstandin g, Juan.
                >>>>>>>>>>
                >>>>>>>>>Well , I think you are misunderstandin g *me*.
                >>>>>>>>>>
                >>>>>>>>>re:
                >>>>>>>>>!I had the xml:lang attribute in the html tag (declaratively) ,
                >>>>>>>>>like this:
                >>>>>>>>>>...an d it renders to the browser, as it should.
                >>>>>>>>>>
                >>>>>>>>>Yes, because it's standard html.
                >>>>>>>>>>
                >>>>>>>>>re:
                >>>>>>>>>!If I simply add runat="server"
                >>>>>>>>>>
                >>>>>>>>>That declares the control to run server side.
                >>>>>>>>>>
                >>>>>>>>>For any attribute to be programmed server-side you need a script,
                >>>>>>>>>just as you need a script to modify any server control's
                >>>>>>>>>attrib utes.
                >>>>>>>>>>
                >>>>>>>>>Did you run the sample page I sent ?
                >>>>>>>>>>
                >>>>>>>>>It iterates throught the attributes for the html server control,
                >>>>>>>>>and shows that the xml:lang attribute *is* added
                >>>>>>>>>progra mmatically.
                >>>>>>>>>>
                >>>>>>>>>re:
                >>>>>>>>>!If I simply add runat="server", leaving in the xml:lang
                >>>>>>>>>attrib ute that
                >>>>>>>>>!rende rs without runat="server", all of the (declarative)
                >>>>>>>>>attrib utes are
                >>>>>>>>>!rende red to the browser--except the xml:lang attribute! That
                >>>>>>>>>is a bug.
                >>>>>>>>>>
                >>>>>>>>>I think you're confusing html attributes with runat="server"
                >>>>>>>>>attrib utes.
                >>>>>>>>>>
                >>>>>>>>>Html attributes can be inserted in normal html.
                >>>>>>>>>Serv er-side attributes must be inserted in code.
                >>>>>>>>>>
                >>>>>>>>>Mayb e I'm not explaining this as well as I should.
                >>>>>>>>>Try to get someone else's opinion on this matter, if you don't
                >>>>>>>>>acce pt mine.
                >>>>>>>>>>
                >>>>>>>>>>
                >>>>>>>>>>
                >>>>>>>>>Juan T. Llibre, asp.net MVP
                >>>>>>>>>asp.ne t faq : http://asp.net.do/faq/
                >>>>>>>>>foro s de asp.net, en español : http://asp.net.do/foros/
                >>>>>>>>>====== =============== =============== ==
                >>>>>>>>>"Lee C." <no.spam@spamme r.comwrote in message
                >>>>>>>>>news:e nam1gH2IHA.4552 @TK2MSFTNGP04.p hx.gbl...
                >>>>>>>>>>>I think you are misunderstandin g, Juan. I had the xml:lang
                >>>>>>>>>>>attr ibute in the html tag (declaratively) , like this:
                >>>>>>>>>>>
                >>>>>>>>>><ht ml xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"
                >>>>>>>>>>lang= "en-US" dir="ltr">
                >>>>>>>>>>>
                >>>>>>>>>>...an d it renders to the browser, as it should.
                >>>>>>>>>>>
                >>>>>>>>>>If I simply add runat="server", leaving in the xml:lang
                >>>>>>>>>>attri bute that renders without runat="server", all of the
                >>>>>>>>>>(decl arative) attributes are rendered to the browser--except the
                >>>>>>>>>>xml:l ang attribute! That is a bug.
                >>>>>>>>>>>
                >>>>>>>>>><ht ml runat="server" xmlns="http://www.w3.org/1999/xhtml"
                >>>>>>>>>>xml:l ang="en-US" lang="en-US" dir="ltr">
                >>>>>>>>>>>
                >>>>>>>>>>Cordi ally,
                >>>>>>>>>>Lee
                >>>>>>>>>>>
                >>>>>>>>>>>
                >>>>>>>>>>"Ju an T. Llibre" <nomailreplies@ nowhere.comwrot e in message
                >>>>>>>>>>news: eyrwjUH2IHA.392 0@TK2MSFTNGP02. phx.gbl...
                >>>>>>>>>>>Here 's a full example which shows that the xml:lang attribute
                >>>>>>>>>>>is added programmaticall y :
                >>>>>>>>>>>>
                >>>>>>>>>>>attr ibutes.aspx:
                >>>>>>>>>>>----------------------
                >>>>>>>>>>><% @ Page Language="C#" AutoEventWireup ="True" %>
                >>>>>>>>>>><htm l xmlns="http://www.w3.org/1999/xhtml" runat="server"
                >>>>>>>>>>>id=" Myid" >
                >>>>>>>>>>><scr ipt language="C#" runat="server">
                >>>>>>>>>>>vo id Page_Load(Objec t sender, EventArgs e)
                >>>>>>>>>>>{
                >>>>>>>>>>>Myid .Attributes.Add ("xml:lang", "es");
                >>>>>>>>>>>Mess age.InnerHtml = "<h4>The html control attributes collection
                >>>>>>>>>>>cont ains:</h4>";
                >>>>>>>>>>>IEnu merator keys = Myid.Attributes .Keys.GetEnumer ator();
                >>>>>>>>>>>whil e (keys.MoveNext( ))
                >>>>>>>>>>>{
                >>>>>>>>>>>Stri ng key = (String)keys.Cu rrent;
                >>>>>>>>>>>Mess age.InnerHtml += key + "=" + Myid.Attributes[key] + "<br
                >>>>>>>>>>>/>";
                >>>>>>>>>>>}
                >>>>>>>>>>>}
                >>>>>>>>>>></script>
                >>>>>>>>>>><hea d id="Head1" runat="server">
                >>>>>>>>>>><tit le>The html control attributes collection</title>
                >>>>>>>>>>></head>
                >>>>>>>>>>><bod y>
                >>>>>>>>>>><for m id="Form1" runat="server">
                >>>>>>>>>>><h3> HtmlControl Attribute Collection Example</h3>
                >>>>>>>>>>><b r />
                >>>>>>>>>>><spa n id="Message" enableviewstate ="false" runat="server" />
                >>>>>>>>>>></form>
                >>>>>>>>>>></body>
                >>>>>>>>>>></html>
                >>>>>>>>>>>----------------
                >>>>>>>>>>>>
                >>>>>>>>>>>I don't think it's a bug to have to add an attribute
                >>>>>>>>>>>prog rammatically,
                >>>>>>>>>>>beca use the runat="server" tag only *declares* the html control
                >>>>>>>>>>>as a programmable control.
                >>>>>>>>>>>>
                >>>>>>>>>>>To actually program it, you must use a script.
                >>>>>>>>>>>>
                >>>>>>>>>>>>
                >>>>>>>>>>>>
                >>>>>>>>>>>>
                >>>>>>>>>>>Ju an T. Llibre, asp.net MVP
                >>>>>>>>>>>asp. net faq : http://asp.net.do/faq/
                >>>>>>>>>>>foro s de asp.net, en español : http://asp.net.do/foros/
                >>>>>>>>>>>==== =============== =============== ====
                >>>>>>>>>>>"L ee C." <no.spam@spamme r.comwrote in message
                >>>>>>>>>>>news :e0rLaPG2IHA.47 72@TK2MSFTNGP03 .phx.gbl...
                >>>>>>>>>>>>Tha nks, Juan.
                >>>>>>>>>>>>>
                >>>>>>>>>>>>I already added similar code to a page event in my masterpage
                >>>>>>>>>>>>cod e-beside.
                >>>>>>>>>>>>>
                >>>>>>>>>>>> elHtml.Attribut es.Add("xml:lan g",
                >>>>>>>>>>>>Res ources.GlobalLa ng.ContentAudie nceLanguage)
                >>>>>>>>>>>>>
                >>>>>>>>>>>>T o me, that is a temporary workaround. I still want to
                >>>>>>>>>>>>und erstand whether the "eating" of the attribute I
                >>>>>>>>>>>>ori ginally
                >>>>>>>>>>>>pos ted about is a bug, or if this is actually happening for a
                >>>>>>>>>>>>rea son.
                >>>>>>>>>>>>>
                >>>>>>>>>>>>Cor dially,
                >>>>>>>>>>>>L ee
                >>>>>>>>>>>>>
                >>>>>>>>>>>>>
                >>>>>>>>>>>>"Ju an T. Llibre" <nomailreplies@ nowhere.comwrot e in message
                >>>>>>>>>>>>new s:%23gBUqSC2IHA .4772@TK2MSFTNG P03.phx.gbl...
                >>>>>>>>>>>>>Hi , Lee.
                >>>>>>>>>>>>> >
                >>>>>>>>>>>>>re :
                >>>>>>>>>>>>>!< html runat="server" xmlns="http://www.w3.org/1999/xhtml"
                >>>>>>>>>>>>>xm l:lang="en-US" lang="en-US" dir="ltr">
                >>>>>>>>>>>>>!n o xml:lang attribute is rendered to the browser!
                >>>>>>>>>>>>>!R emove the runat="server", and, voila, the xml:lang
                >>>>>>>>>>>>>at tribute is rendered.
                >>>>>>>>>>>>> >
                >>>>>>>>>>>>>Tr y this :
                >>>>>>>>>>>>> >
                >>>>>>>>>>>>><h tml xmlns="http://www.w3.org/1999/xhtml" runat="server"
                >>>>>>>>>>>>>id ="someID">
                >>>>>>>>>>>>> >
                >>>>>>>>>>>>><s cript runat="server">
                >>>>>>>>>>>>>so meID.Attributes ("xml:lang") = "en-US"
                >>>>>>>>>>>>> </script>
                >>>>>>>>>>>>> >
                >>>>>>>>>>>>> >
                >>>>>>>>>>>>> >
                >>>>>>>>>>>>>Ju an T. Llibre, asp.net MVP
                >>>>>>>>>>>>>as p.net faq : http://asp.net.do/faq/
                >>>>>>>>>>>>>fo ros de asp.net, en español : http://asp.net.do/foros/
                >>>>>>>>>>>>>== =============== =============== ======
                >>>>>>>>>>>>> >
                >>>>>>>>>>>>>"L ee C." <nomail@spam.co mwrote in message
                >>>>>>>>>>>>>ne ws:O%23KsAQA2IH A.4572@TK2MSFTN GP03.phx.gbl...
                >>>>>>>>>>>>>>> I think I have discovered a bug in ASP.NET, related to I18N.
                >>>>>>>>>>>>> >>
                >>>>>>>>>>>>>>I n ASP.NET 3.5 I have to set runat="server" on the html
                >>>>>>>>>>>>>>e lement to use explicit expressions. It appears that
                >>>>>>>>>>>>>>A SP.NET
                >>>>>>>>>>>>>>e ats the xml:lang attribute on the html element when it is
                >>>>>>>>>>>>>>s et to runat="server".
                >>>>>>>>>>>>> >>
                >>>>>>>>>>>>>>O f course I want to replace the hardcoded "en-US" values
                >>>>>>>>>>>>>>w ith (resource) explicit expressions; but, for
                >>>>>>>>>>>>>>s implicity,
                >>>>>>>>>>>>>>t ry this:
                >>>>>>>>>>>>> >>
                >>>>>>>>>>>>>>< html runat="server" xmlns="http://www.w3.org/1999/xhtml"
                >>>>>>>>>>>>>>x ml:lang="en-US" lang="en-US" dir="ltr">
                >>>>>>>>>>>>> >>
                >>>>>>>>>>>>>>. ..And you will find that no xml:lang attribute is rendered
                >>>>>>>>>>>>>>t o the browser! Remove the runat="server", and,
                >>>>>>>>>>>>>>v oila,
                >>>>>>>>>>>>>>t he
                >>>>>>>>>>>>>>x ml:lang attribute is rendered. :[
                >>>>>>>>>>>>> >>
                >>>>>>>>>>>>>>. ..Any ideas?
                >>>>>>>>>>>>> >>
                >>>>>>>>>>>>>>C ordially,
                >>>>>>>>>>>>>>L ee
                >>>>>>>>>>>>> >>
                >>>>>>>>>>>>> >>
                >>>>>>>>>>>>> >
                >>>>>>>>>>>>> >
                >>>>>>>>>>>>> >
                >>>>>>>>>>>>>
                >>>>>>>>>>>>>
                >>>>>>>>>>>>
                >>>>>>>>>>>>
                >>>>>>>>>>>>
                >>>>>>>>>>>
                >>>>>>>>>>>
                >>>>>>>>>>
                >>>>>>>>>>
                >>>>>>>>>
                >>>>>>>>>
                >>>>>>>>
                >>>>>>>>
                >>>>>>>
                >>>>>>>
                >>>>>>>
                >>>>>>>
                >>>>>>
                >>>>>>
                >>>>>
                >>>>>
                >>>>
                >>>>
                >>>
                >>>
                >>
                >>
                >
                >

                Comment

                • Juan T. Llibre

                  #9
                  Re: ASP.NET Internationaliz ation bug?

                  re:
                  !You clearly don't understand

                  That "clearly" is doubted by me.

                  How many times have I told you that I *do* understand what you're saying
                  but that I'd like to see the bug response team's reply to your "bug report" ?

                  How many times will you repeat that I "don't understand", when I do,
                  although I disagree with the premises you're putting forth ?

                  re:
                  !Are you really an ASP.NET MVP? (Classic ASP, maybe?)

                  The answer to that question is in my signature.
                  Maybe you haven't read any of the ASP.NET books I've co-authored ?

                  Good luck with the response to your bug report.
                  Please remember to post the result here.




                  Juan T. Llibre, asp.net MVP
                  asp.net faq : http://asp.net.do/faq/
                  foros de asp.net, en español : http://asp.net.do/foros/
                  =============== =============== ========
                  "Lee C." <nomail@spam.co mwrote in message news:eE3jN2g2IH A.4572@TK2MSFTN GP03.phx.gbl...
                  Juan,
                  >
                  You clearly don't understand, or have not thought about *why* the ASP.NET team gave us separate places for
                  "design"/content (.aspx files) and "procedure"/code (.aspx.vb). The ability to separate the 2 was a huge feature for
                  ASP.NET, from classic ASP.
                  >
                  Even though the particular content affected by the bug I found is not *visible* Web browser content, it is content
                  none-the-less. Thus, its wiring belongs in the content file (.aspx)--not the code file (.aspx.vb). Sure, I could
                  throw in some classic ASP style, and put a script element in my .aspx page to keep the wiring in the realm of the
                  designer, but that changes nothing, because it's still programming, which should be done by programmers in the same
                  place as every other line of programming in my site: the .aspx.vb pages. Just as badly, it means I'm achieving my
                  I18N wiring in multiple ways, instead of being consistent.
                  >
                  By everything else, I meant all other I18N resource "wirings". (But, I take pride in how "light" my .aspx.vb files
                  are--and how clean my .aspx files are, too.) You are obviously fine with having the designer(s) to set up and manage
                  *most* of the I18N wirings, *and* having programmers to do some, too, (as they should not be doing) since bugs are not
                  bugs for you if there is a workaround that violates good design practices and principles. I'm not fine with that.
                  >
                  Are you really an ASP.NET MVP? (Classic ASP, maybe?)
                  >
                  , Lee
                  >
                  >
                  "Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message news:urCttna2IH A.4476@TK2MSFTN GP06.phx.gbl...
                  >re:
                  >!Setting it programmaticall y is an incorrect implementation
                  >!when everything else on my page is set declaratively.
                  >>
                  >Is everything else on your pages set declaratively ?
                  >Think about that for a second.
                  >>
                  >Why do we have inline scripts and code-behind, if "everything else is set declaratively" ?
                  >>
                  >In any case, we've certainly had enough of the "I think that..." back and forth.
                  >>
                  >Let's pause this discussion until the "bug" you reported is explained by the VS Dev team, OK ?
                  >I, definitely, want to see what their explanation is.
                  >>
                  >https://connect.microsoft.com/Visual...dbackID=353879
                  >>
                  >>
                  >>
                  >Juan T. Llibre, asp.net MVP
                  >asp.net faq : http://asp.net.do/faq/
                  >foros de asp.net, en español : http://asp.net.do/foros/
                  >============== =============== =========
                  >"Lee C." <nomail@spam.co mwrote in message news:eQlpa4W2IH A.4704@TK2MSFTN GP05.phx.gbl...
                  >>Correct implementation? What do you mean by that?
                  >>>
                  >>I stated earlier on that I worked around it. It's still a bug. Setting it programmaticall y is an incorrect
                  >>implementatio n when everything else on my page is set declaratively. Microsoft offered declarative (explicit)
                  >>expressions , and I want to use them--anywhere and everywhere I choose in accordance with how they are stated to
                  >>work. When I find one that doesn't work, it's a bug; it's not a case of my doing something incorrectly. I love
                  >>Microsoft Visual Studio 2008; but, I won't tolerate bugs, or suck them up as, "Oh, I must be doing it wrong since it
                  >>doesn't work--even though it should."
                  >>>
                  >>, Lee
                  >>>
                  >>"Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message news:%23xhBpuW2 IHA.2384@TK2MSF TNGP04.phx.gbl. ..
                  >>>re:
                  >>>!ASP.NET should make it easy for me--and, it does,
                  >>>!but there is a bug in the implementation.
                  >>>>
                  >>>The fact that you *can* set xml:lang programmaticall y, and that you *did* set it that way,
                  >>>as I did, should tell you that it isn't much of a bug, but a question of using the correct implementation.
                  >>>>
                  >>>But, again, please let us know what the reply to your bug report is.
                  >>>>
                  >>>>
                  >>>>
                  >>>Juan T. Llibre, asp.net MVP
                  >>>asp.net faq : http://asp.net.do/faq/
                  >>>foros de asp.net, en español : http://asp.net.do/foros/
                  >>>============ =============== ===========
                  >>>"Lee C." <nomail@spam.co mwrote in message news:%239PIQvU2 IHA.2384@TK2MSF TNGP04.phx.gbl. ..
                  >>>>Juan,
                  >>>>>
                  >>>>My use of language and culture in ASP.Net is a bit different than most. I have registered numerous
                  >>>>country-code-specific domains (mysite.ca, mysite.co.uk, mysite.com.au, etc.), which resolve to a singular "ASP.Net
                  >>>>Web Site". Nothing new there. However, I'm not doing the ASP.Net usual of letting the user agent (HTTP header
                  >>>>'accept-language') determine which language visitors get; I have the country-code TLD drive it. Also, it's not
                  >>>>just the language of my content that varies by cc TLD, it's the content, too; but, lang attributes play a critical
                  >>>>role in informing user agents (including search engine bots) for what "country" my content is aimed.
                  >>>>>
                  >>>>I have already found, first-hand, that the better of the major search engines use the cc TLD *and* the HTML
                  >>>>lang/xml:lang to determine whether a domain's documents (mysite.com.au/my-document.aspx) should show up when a
                  >>>>searcher searches with the 'Only from Australia' checkbox checked on Live.com, for example.
                  >>>>>
                  >>>>I'm not setting lang attributes for fun; I'm doing it to correct search engine results. ASP.NET should make it
                  >>>>easy for me--and, it does, but there is a bug in the implementation.
                  >>>>>
                  >>>>I appreciate your interest and effort to help.
                  >>>>>
                  >>>>, Lee
                  >>>>>
                  >>>>>
                  >>>>"Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message news:uBUnQxT2IH A.4164@TK2MSFTN GP03.phx.gbl...
                  >>>>>re:
                  >>>>>!versus the spirit of what we're trying to accomplish: telling user agents who our
                  >>>>>!intende d audiences is, by language, as best we can...which is why I'm *also*
                  >>>>>!setting lang in the HTTP headers and in page meta tags
                  >>>>>>
                  >>>>>What ? You don't set a language/culture in web.config, too ?
                  >>>>>There's a use for overkill ! ( only kidding... )
                  >>>>>>
                  >>>>>I don't see too clearly the purpose of declaring a single language for a web page.
                  >>>>>>
                  >>>>>I do see a use for declaring specific language attributes in a *collection* of xml documents,
                  >>>>>so that individual documents can be parsed for a particular language content.
                  >>>>>>
                  >>>>>But, ymmv...
                  >>>>>>
                  >>>>>I'd still be interested in knowing what the reply is to your bug report.
                  >>>>>I bet you'll get back : "That's by design". <g>
                  >>>>>>
                  >>>>>Don't forget to let us all know what happens with that, OK ?
                  >>>>>Thanks for an interesting discussion.
                  >>>>>>
                  >>>>>>
                  >>>>>>
                  >>>>>>
                  >>>>>Juan T. Llibre, asp.net MVP
                  >>>>>asp.net faq : http://asp.net.do/faq/
                  >>>>>foros de asp.net, en español : http://asp.net.do/foros/
                  >>>>>========== =============== =============
                  >>>>>"Lee C." <nomail@spam.co mwrote in message news:en1PZVT2IH A.524@TK2MSFTNG P05.phx.gbl...
                  >>>>>>Juan,
                  >>>>>>>
                  >>>>>>In theory, I like your idea of investigating "the standard"; but, in practice it has serious problems, as it
                  >>>>>>often does. First, you are referring to the XML standard, which is not as appropriate as HTML and XHTML
                  >>>>>>standards . Second, none of them are crystal clear on best practices for I18N. There is a lot of *legal* (by the
                  >>>>>>standar d) syntax, that makes no sense, or makes some sense without being clearly best. The W3C site often
                  >>>>>>states something to the effect of, "some are doing this, some are doing that, on your own site, at least do
                  >>>>>>somethi ng and only time will tell what is best."
                  >>>>>>>
                  >>>>>>Check out these fine examples, which mirror my syntax, on the W3C site.
                  >>>>>>>
                  >>>>>>Internati onalization Best Practices: Specifying Language in XHTML & HTML Content
                  >>>>>>http://www.w3.org/TR/i18n-html-tech-...0429.092928424
                  >>>>>>>
                  >>>>>>>
                  >>>>>>Tutoria l: Declaring Language in XHTML and HTML (Draft)
                  >>>>>>http://www.w3.org/International/tuto...Slide0160.html
                  >>>>>>>
                  >>>>>>Juan, you wrote:
                  >>>>>>>But, it seems to me that setting xml:lang for the html tag's *attribute* values is unneeded, since they must
                  >>>>>>>be in English, and they must be attributes set to a language identifier, as defined by IETF RFC 4646
                  >>>>>>>(http://www.ietf.org/rfc/rfc4646.txt).
                  >>>>>>>
                  >>>>>>You're not setting it for "the tag's *attribute*", you're setting it for the *contents*, all contents, of the
                  >>>>>>element (unless overridden by a sub-setting), which makes perfect sense so that I don't have to set it
                  >>>>>>individua lly on every child element--that is the power of a hierarchy! You seem to be focused on the technical,
                  >>>>>>with some misunderstandin g, versus the spirit of what we're trying to accomplish: telling user agents who our
                  >>>>>>intende d audiences is, by language, as best we can...which is why I'm *also* setting lang in the HTTP headers
                  >>>>>>and in page meta tags.
                  >>>>>>>
                  >>>>>>, Lee
                  >>>>>>>
                  >>>>>>>
                  >>>>>>"Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message news:OYI4upK2IH A.5140@TK2MSFTN GP02.phx.gbl...
                  >>>>>>>re:
                  >>>>>>>!I found an MSDN document that explains why what I'm trying to do should work
                  >>>>>>>>
                  >>>>>>>Lee,
                  >>>>>>>>
                  >>>>>>>From :
                  >>>>>>>>
                  >>>>>>>http://www.w3.org/TR/REC-xml/
                  >>>>>>>>
                  >>>>>>>"A special attribute named xml:lang may be inserted in documents to specify the
                  >>>>>>>langua ge used in the contents and attribute values of any element in an XML document."
                  >>>>>>>>
                  >>>>>>>If anything, I can see xml:lang being declared for specific content values, for example :
                  >>>>>>>>
                  >>>>>>><p xml:lang="en-GB">What colour is it?</p>
                  >>>>>>><p xml:lang="en-US">What color is it?</p>
                  >>>>>>>>
                  >>>>>>>Then, an xml parser could identify regional US and British spellings but, given that *all* the attribute values
                  >>>>>>>must be in English in an html doc, what would be the purpose of declaring xml:lang for the html markup ?
                  >>>>>>>>
                  >>>>>>>A similar explanation is given here :
                  >>>>>>>http://www.simonstl.com/xmlprim/xmlupdate/atts.html
                  >>>>>>>>
                  >>>>>>>---000---
                  >>>>>>><SECTION >
                  >>>>>>><DESCRIP TION xml:lang="en">
                  >>>>>>>Caesar begins by describing the geography of Gaul.
                  >>>>>>></DESCRIPTION>
                  >>>>>>><QUOTE xml:lang="la">
                  >>>>>>>Gallia est omnis divisa in partes tres, quarum unam incolunt Belgae,
                  >>>>>>>aliam Aquitani, tertiam qui ipsorum lingua Celtae, nostra Galli appellantur.
                  >>>>>>></QUOTE>
                  >>>>>>>---000---
                  >>>>>>>>
                  >>>>>>>That's perfectly good usage for xml:lang, as a parser could selectively identify content in different
                  >>>>>>>language s.
                  >>>>>>>>
                  >>>>>>>But, it seems to me that setting xml:lang for the html tag's *attribute* values is unneeded, since they must
                  >>>>>>>be in English, and they must be attributes set to a language identifier, as defined by IETF RFC 4646
                  >>>>>>>(http://www.ietf.org/rfc/rfc4646.txt).
                  >>>>>>>>
                  >>>>>>>So, I think that requisite pretty well establishes the futility
                  >>>>>>>of setting xml:lang for all the attributes in an html document.
                  >>>>>>>>
                  >>>>>>>If anything, it seems that the xml:lang attribute is included in the
                  >>>>>>>html server tag for compatibility purposes, or perhaps out of ignorance.
                  >>>>>>>>
                  >>>>>>>If there's a need to identify that the *contents* of a particular markup tag are in a
                  >>>>>>>specif ic language, that identification can be included in the tag itself, for example :
                  >>>>>>>>
                  >>>>>>><div lang="MX-es" xml:lang="MX-es">
                  >>>>>>>Algo de contenido en español mejicano.
                  >>>>>>></div>
                  >>>>>>>>
                  >>>>>>>That makes a lot more sense than setting xml:lang for the attribute values in the html tag.
                  >>>>>>>>
                  >>>>>>>>
                  >>>>>>>>
                  >>>>>>>Juan T. Llibre, asp.net MVP
                  >>>>>>>asp.ne t faq : http://asp.net.do/faq/
                  >>>>>>>foros de asp.net, en español : http://asp.net.do/foros/
                  >>>>>>>======== =============== ===============
                  >>>>>>>"Lee C." <no.spam@spamme r.comwrote in message news:%23ocUnoI2 IHA.2188@TK2MSF TNGP04.phx.gbl. ..
                  >>>>>>>>>I found an MSDN document that explains why what I'm trying to do should work.
                  >>>>>>>>>
                  >>>>>>>>ASP.N ET Web Server Controls Overview
                  >>>>>>>>http://msdn.microsoft.com/en-us/library/zsyt68f1.aspx
                  >>>>>>>>>
                  >>>>>>>>Note the distinction between HTML Server Controls and Web Server Controls in the document. Also, note the
                  >>>>>>>>explana tion
                  >>>>>>>>of "pass-through" attributes for HTML Server Controls.
                  >>>>>>>>>
                  >>>>>>>>Two quotes that sum it up:
                  >>>>>>>> 1. Any HTML element on a page can be converted to an HTML server control by adding the attribute
                  >>>>>>>>runat=" server".
                  >>>>>>>> 2. You can add any attributes you need to an HTML server control and the page framework will render them
                  >>>>>>>>witho ut
                  >>>>>>>>any change in functionality.
                  >>>>>>>>>
                  >>>>>>>>, Lee
                  >>>>>>>>>
                  >>>>>>>>"Lee C." <no.spam@spamme r.comwrote in message news:Oe38JYI2IH A.4772@TK2MSFTN GP03.phx.gbl...
                  >>>>>>>>>Juan ,
                  >>>>>>>>>>
                  >>>>>>>>>I appreciate your trying to help, but you're wrong, and you are the one who is confused. :]
                  >>>>>>>>>>
                  >>>>>>>>>I am *not* disputing that when inserted programmaticall y, the xml:lang attribute renders to the browser. I
                  >>>>>>>>>did just
                  >>>>>>>>>that as a work around (right after I discovered this bug); but, I should not have to.
                  >>>>>>>>>>
                  >>>>>>>>>I am *not* confusing html attributes with runat="server" attributes, as you call them. Using your logic,
                  >>>>>>>>>none of the
                  >>>>>>>>>declar ative (html) attributes should render to the browser after I add the runat="server" in ASP.NET; yet all
                  >>>>>>>>>of them
                  >>>>>>>>>(xmlns , lang, and dir) do--except xml:lang.
                  >>>>>>>>>>
                  >>>>>>>>>I started with an html element with 4 attributes (xmlns, lang, xml:lang, and dir) all set declaratively.
                  >>>>>>>>>With *no*
                  >>>>>>>>>5th attribute of runat="server", all 4 attributes render. If I add the 5th attribute of runat="server",
                  >>>>>>>>>whic h does
                  >>>>>>>>>not and should not render, I no longer get all 4 attributes that should render (xmlns, lang, xml:lang, and
                  >>>>>>>>>dir) , I
                  >>>>>>>>>only get 3 (xmlns, lang, and dir). My logic says I should get 4, your says I should get 3? It would be 4 or
                  >>>>>>>>>0, and
                  >>>>>>>>>4 is right. Not 0...and not 3.
                  >>>>>>>>>>
                  >>>>>>>>>When I add runat="server", it does not magically make the xml:lang attribute a server-side attribute, while
                  >>>>>>>>>keepin g
                  >>>>>>>>>the other three attributes as "html" attributes. All four are still "html" attributes--which should render.
                  >>>>>>>>>>
                  >>>>>>>>>I think the simplification of my example may be confusing you. It is odd that, in my example, I set
                  >>>>>>>>>runat= "server"
                  >>>>>>>>>but do not have any server-side attributes. (I have all 4 as literal strings, for simplicity of an example.)
                  >>>>>>>>>Well ,
                  >>>>>>>>>in my real-world use, I do have server-side attributes, which I want set declaratively (no code-beside and no
                  >>>>>>>>>script ). I have:
                  >>>>>>>>>>
                  >>>>>>>>><htm l runat="server" xmlns="http://www.w3.org/1999/xhtml"
                  >>>>>>>>> xml:lang="<%$ Resources:Globa lLang, ContentAudience Language %>"
                  >>>>>>>>> lang="<%$ Resources:Globa lLang, ContentAudience Language %>"
                  >>>>>>>>> dir="ltr">
                  >>>>>>>>>>
                  >>>>>>>>>Both of those declarative explicit localization expressions should work without my having to write any more
                  >>>>>>>>>"proce dural" (code-beside) code or script. It actually does work fine for the lang attribute--as it should;
                  >>>>>>>>>but not
                  >>>>>>>>>for the xml:lang attribute--***which is a bug***.
                  >>>>>>>>>>
                  >>>>>>>>>, Lee
                  >>>>>>>>>>
                  >>>>>>>>>"Jua n T. Llibre" <nomailreplies@ nowhere.comwrot e in message news:u0WzB9H2IH A.4188@TK2MSFTN GP04.phx.gbl...
                  >>>>>>>>>>re:
                  >>>>>>>>>>!I think you are misunderstandin g, Juan.
                  >>>>>>>>>>>
                  >>>>>>>>>>Wel l, I think you are misunderstandin g *me*.
                  >>>>>>>>>>>
                  >>>>>>>>>>re:
                  >>>>>>>>>>!I had the xml:lang attribute in the html tag (declaratively) , like this:
                  >>>>>>>>>>>...a nd it renders to the browser, as it should.
                  >>>>>>>>>>>
                  >>>>>>>>>>Yes , because it's standard html.
                  >>>>>>>>>>>
                  >>>>>>>>>>re:
                  >>>>>>>>>>!If I simply add runat="server"
                  >>>>>>>>>>>
                  >>>>>>>>>>Tha t declares the control to run server side.
                  >>>>>>>>>>>
                  >>>>>>>>>>For any attribute to be programmed server-side you need a script,
                  >>>>>>>>>>jus t as you need a script to modify any server control's attributes.
                  >>>>>>>>>>>
                  >>>>>>>>>>Did you run the sample page I sent ?
                  >>>>>>>>>>>
                  >>>>>>>>>>It iterates throught the attributes for the html server control,
                  >>>>>>>>>>and shows that the xml:lang attribute *is* added programmaticall y.
                  >>>>>>>>>>>
                  >>>>>>>>>>re:
                  >>>>>>>>>>!If I simply add runat="server", leaving in the xml:lang attribute that
                  >>>>>>>>>>!rend ers without runat="server", all of the (declarative) attributes are
                  >>>>>>>>>>!rend ered to the browser--except the xml:lang attribute! That is a bug.
                  >>>>>>>>>>>
                  >>>>>>>>>>I think you're confusing html attributes with runat="server" attributes.
                  >>>>>>>>>>>
                  >>>>>>>>>>Htm l attributes can be inserted in normal html.
                  >>>>>>>>>>Serve r-side attributes must be inserted in code.
                  >>>>>>>>>>>
                  >>>>>>>>>>May be I'm not explaining this as well as I should.
                  >>>>>>>>>>Try to get someone else's opinion on this matter, if you don't accept mine.
                  >>>>>>>>>>>
                  >>>>>>>>>>>
                  >>>>>>>>>>>
                  >>>>>>>>>>Jua n T. Llibre, asp.net MVP
                  >>>>>>>>>>asp.n et faq : http://asp.net.do/faq/
                  >>>>>>>>>>for os de asp.net, en español : http://asp.net.do/foros/
                  >>>>>>>>>>===== =============== =============== ===
                  >>>>>>>>>>"Le e C." <no.spam@spamme r.comwrote in message news:enam1gH2IH A.4552@TK2MSFTN GP04.phx.gbl...
                  >>>>>>>>>>>>I think you are misunderstandin g, Juan. I had the xml:lang attribute in the html tag (declaratively) , like
                  >>>>>>>>>>>>thi s:
                  >>>>>>>>>>>>
                  >>>>>>>>>>><htm l xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US" dir="ltr">
                  >>>>>>>>>>>>
                  >>>>>>>>>>>...a nd it renders to the browser, as it should.
                  >>>>>>>>>>>>
                  >>>>>>>>>>>If I simply add runat="server", leaving in the xml:lang attribute that renders without runat="server", all
                  >>>>>>>>>>>of the
                  >>>>>>>>>>>(dec larative) attributes are rendered to the browser--except the xml:lang attribute! That is a bug.
                  >>>>>>>>>>>>
                  >>>>>>>>>>><htm l runat="server" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US" dir="ltr">
                  >>>>>>>>>>>>
                  >>>>>>>>>>>Cord ially,
                  >>>>>>>>>>>Le e
                  >>>>>>>>>>>>
                  >>>>>>>>>>>>
                  >>>>>>>>>>>"Jua n T. Llibre" <nomailreplies@ nowhere.comwrot e in message news:eyrwjUH2IH A.3920@TK2MSFTN GP02.phx.gbl...
                  >>>>>>>>>>>>Her e's a full example which shows that the xml:lang attribute is added programmaticall y :
                  >>>>>>>>>>>>>
                  >>>>>>>>>>>>att ributes.aspx:
                  >>>>>>>>>>>>----------------------
                  >>>>>>>>>>>>< %@ Page Language="C#" AutoEventWireup ="True" %>
                  >>>>>>>>>>>><ht ml xmlns="http://www.w3.org/1999/xhtml" runat="server" id="Myid" >
                  >>>>>>>>>>>><sc ript language="C#" runat="server">
                  >>>>>>>>>>>>voi d Page_Load(Objec t sender, EventArgs e)
                  >>>>>>>>>>>>{
                  >>>>>>>>>>>>Myi d.Attributes.Ad d("xml:lang", "es");
                  >>>>>>>>>>>>Mes sage.InnerHtml = "<h4>The html control attributes collection contains:</h4>";
                  >>>>>>>>>>>>IEn umerator keys = Myid.Attributes .Keys.GetEnumer ator();
                  >>>>>>>>>>>>whi le (keys.MoveNext( ))
                  >>>>>>>>>>>>{
                  >>>>>>>>>>>>Str ing key = (String)keys.Cu rrent;
                  >>>>>>>>>>>>Mes sage.InnerHtml += key + "=" + Myid.Attributes[key] + "<br />";
                  >>>>>>>>>>>>}
                  >>>>>>>>>>>>}
                  >>>>>>>>>>>></script>
                  >>>>>>>>>>>><he ad id="Head1" runat="server">
                  >>>>>>>>>>>><ti tle>The html control attributes collection</title>
                  >>>>>>>>>>>></head>
                  >>>>>>>>>>>><bo dy>
                  >>>>>>>>>>>><fo rm id="Form1" runat="server">
                  >>>>>>>>>>>><h3 >HtmlControl Attribute Collection Example</h3>
                  >>>>>>>>>>>>< br />
                  >>>>>>>>>>>><sp an id="Message" enableviewstate ="false" runat="server" />
                  >>>>>>>>>>>></form>
                  >>>>>>>>>>>></body>
                  >>>>>>>>>>>></html>
                  >>>>>>>>>>>>----------------
                  >>>>>>>>>>>>>
                  >>>>>>>>>>>>I don't think it's a bug to have to add an attribute programmaticall y,
                  >>>>>>>>>>>>bec ause the runat="server" tag only *declares* the html control as a programmable control.
                  >>>>>>>>>>>>>
                  >>>>>>>>>>>>T o actually program it, you must use a script.
                  >>>>>>>>>>>>>
                  >>>>>>>>>>>>>
                  >>>>>>>>>>>>>
                  >>>>>>>>>>>>>
                  >>>>>>>>>>>>Jua n T. Llibre, asp.net MVP
                  >>>>>>>>>>>>asp .net faq : http://asp.net.do/faq/
                  >>>>>>>>>>>>for os de asp.net, en español : http://asp.net.do/foros/
                  >>>>>>>>>>>>=== =============== =============== =====
                  >>>>>>>>>>>>"Le e C." <no.spam@spamme r.comwrote in message news:e0rLaPG2IH A.4772@TK2MSFTN GP03.phx.gbl...
                  >>>>>>>>>>>>>Th anks, Juan.
                  >>>>>>>>>>>>> >
                  >>>>>>>>>>>>> I already added similar code to a page event in my masterpage code-beside.
                  >>>>>>>>>>>>> >
                  >>>>>>>>>>>>> elHtml.Attribut es.Add("xml:lan g", Resources.Globa lLang.ContentAu dienceLanguage)
                  >>>>>>>>>>>>> >
                  >>>>>>>>>>>>> To me, that is a temporary workaround. I still want to understand whether the "eating" of the attribute
                  >>>>>>>>>>>>> I
                  >>>>>>>>>>>>>or iginally
                  >>>>>>>>>>>>>po sted about is a bug, or if this is actually happening for a reason.
                  >>>>>>>>>>>>> >
                  >>>>>>>>>>>>>Co rdially,
                  >>>>>>>>>>>>>Le e
                  >>>>>>>>>>>>> >
                  >>>>>>>>>>>>> >
                  >>>>>>>>>>>>>"J uan T. Llibre" <nomailreplies@ nowhere.comwrot e in message
                  >>>>>>>>>>>>>ne ws:%23gBUqSC2IH A.4772@TK2MSFTN GP03.phx.gbl...
                  >>>>>>>>>>>>>>H i, Lee.
                  >>>>>>>>>>>>> >>
                  >>>>>>>>>>>>>>r e:
                  >>>>>>>>>>>>>>! <html runat="server" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US" dir="ltr">
                  >>>>>>>>>>>>>>! no xml:lang attribute is rendered to the browser!
                  >>>>>>>>>>>>>>! Remove the runat="server", and, voila, the xml:lang attribute is rendered.
                  >>>>>>>>>>>>> >>
                  >>>>>>>>>>>>>>T ry this :
                  >>>>>>>>>>>>> >>
                  >>>>>>>>>>>>>>< html xmlns="http://www.w3.org/1999/xhtml" runat="server" id="someID">
                  >>>>>>>>>>>>> >>
                  >>>>>>>>>>>>>>< script runat="server">
                  >>>>>>>>>>>>>>s omeID.Attribute s("xml:lang") = "en-US"
                  >>>>>>>>>>>>> ></script>
                  >>>>>>>>>>>>> >>
                  >>>>>>>>>>>>> >>
                  >>>>>>>>>>>>> >>
                  >>>>>>>>>>>>>>J uan T. Llibre, asp.net MVP
                  >>>>>>>>>>>>>>a sp.net faq : http://asp.net.do/faq/
                  >>>>>>>>>>>>>>f oros de asp.net, en español : http://asp.net.do/foros/
                  >>>>>>>>>>>>>>= =============== =============== =======
                  >>>>>>>>>>>>> >>
                  >>>>>>>>>>>>>>" Lee C." <nomail@spam.co mwrote in message news:O%23KsAQA2 IHA.4572@TK2MSF TNGP03.phx.gbl. ..
                  >>>>>>>>>>>>>>> >I think I have discovered a bug in ASP.NET, related to I18N.
                  >>>>>>>>>>>>>>> >
                  >>>>>>>>>>>>>>> In ASP.NET 3.5 I have to set runat="server" on the html element to use explicit expressions. It
                  >>>>>>>>>>>>>>> appears that
                  >>>>>>>>>>>>>>> ASP.NET
                  >>>>>>>>>>>>>>> eats the xml:lang attribute on the html element when it is set to runat="server".
                  >>>>>>>>>>>>>>> >
                  >>>>>>>>>>>>>>> Of course I want to replace the hardcoded "en-US" values with (resource) explicit expressions; but, for
                  >>>>>>>>>>>>>>> simplicity, try this:
                  >>>>>>>>>>>>>>> >
                  >>>>>>>>>>>>>>> <html runat="server" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US" dir="ltr">
                  >>>>>>>>>>>>>>> >
                  >>>>>>>>>>>>>>> ...And you will find that no xml:lang attribute is rendered to the browser! Remove the runat="server",
                  >>>>>>>>>>>>>>> and,
                  >>>>>>>>>>>>>>> voila, the xml:lang attribute is rendered. :[
                  >>>>>>>>>>>>>>> >
                  >>>>>>>>>>>>>>> ...Any ideas?
                  >>>>>>>>>>>>>>> >
                  >>>>>>>>>>>>>>> Cordially,
                  >>>>>>>>>>>>>>> Lee

                  Comment

                  • Lee C.

                    #10
                    Re: ASP.NET Internationaliz ation bug?

                    You say you understand, but you make statements that demonstrate otherwise.
                    You've been arguing against my "what" and "why" all along; yet, I'm the one
                    following modern best-practices (separating content from code)--which are
                    required for my scenario. If someone chooses to mix them, that's their
                    choice; but, it does not change the bug into a feature--regardless of your
                    position that it does.

                    At this point, I have no interest in your ASP.NET co-authoring.

                    Cordially,
                    Lee

                    "Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message
                    news:uJAnnYi2IH A.3600@TK2MSFTN GP04.phx.gbl...
                    re:
                    !You clearly don't understand
                    >
                    That "clearly" is doubted by me.
                    >
                    How many times have I told you that I *do* understand what you're saying
                    but that I'd like to see the bug response team's reply to your "bug
                    report" ?
                    >
                    How many times will you repeat that I "don't understand", when I do,
                    although I disagree with the premises you're putting forth ?
                    >
                    re:
                    !Are you really an ASP.NET MVP? (Classic ASP, maybe?)
                    >
                    The answer to that question is in my signature.
                    Maybe you haven't read any of the ASP.NET books I've co-authored ?
                    >
                    Good luck with the response to your bug report.
                    Please remember to post the result here.
                    >
                    >
                    >
                    >
                    Juan T. Llibre, asp.net MVP
                    asp.net faq : http://asp.net.do/faq/
                    foros de asp.net, en español : http://asp.net.do/foros/
                    =============== =============== ========
                    "Lee C." <nomail@spam.co mwrote in message
                    news:eE3jN2g2IH A.4572@TK2MSFTN GP03.phx.gbl...
                    >Juan,
                    >>
                    >You clearly don't understand, or have not thought about *why* the ASP.NET
                    >team gave us separate places for "design"/content (.aspx files) and
                    >"procedure"/code (.aspx.vb). The ability to separate the 2 was a huge
                    >feature for ASP.NET, from classic ASP.
                    >>
                    >Even though the particular content affected by the bug I found is not
                    >*visible* Web browser content, it is content none-the-less. Thus, its
                    >wiring belongs in the content file (.aspx)--not the code file (.aspx.vb).
                    >Sure, I could throw in some classic ASP style, and put a script element
                    >in my .aspx page to keep the wiring in the realm of the designer, but
                    >that changes nothing, because it's still programming, which should be
                    >done by programmers in the same place as every other line of programming
                    >in my site: the .aspx.vb pages. Just as badly, it means I'm achieving my
                    >I18N wiring in multiple ways, instead of being consistent.
                    >>
                    >By everything else, I meant all other I18N resource "wirings". (But, I
                    >take pride in how "light" my .aspx.vb files are--and how clean my .aspx
                    >files are, too.) You are obviously fine with having the designer(s) to
                    >set up and manage *most* of the I18N wirings, *and* having programmers to
                    >do some, too, (as they should not be doing) since bugs are not bugs for
                    >you if there is a workaround that violates good design practices and
                    >principles. I'm not fine with that.
                    >>
                    >Are you really an ASP.NET MVP? (Classic ASP, maybe?)
                    >>
                    >, Lee
                    >>
                    >>
                    >"Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message
                    >news:urCttna2I HA.4476@TK2MSFT NGP06.phx.gbl.. .
                    >>re:
                    >>!Setting it programmaticall y is an incorrect implementation
                    >>!when everything else on my page is set declaratively.
                    >>>
                    >>Is everything else on your pages set declaratively ?
                    >>Think about that for a second.
                    >>>
                    >>Why do we have inline scripts and code-behind, if "everything else is
                    >>set declaratively" ?
                    >>>
                    >>In any case, we've certainly had enough of the "I think that..." back
                    >>and forth.
                    >>>
                    >>Let's pause this discussion until the "bug" you reported is explained by
                    >>the VS Dev team, OK ?
                    >>I, definitely, want to see what their explanation is.
                    >>>
                    >>https://connect.microsoft.com/Visual...dbackID=353879
                    >>>
                    >>>
                    >>>
                    >>Juan T. Llibre, asp.net MVP
                    >>asp.net faq : http://asp.net.do/faq/
                    >>foros de asp.net, en español : http://asp.net.do/foros/
                    >>============= =============== ==========
                    >>"Lee C." <nomail@spam.co mwrote in message
                    >>news:eQlpa4W2 IHA.4704@TK2MSF TNGP05.phx.gbl. ..
                    >>>Correct implementation? What do you mean by that?
                    >>>>
                    >>>I stated earlier on that I worked around it. It's still a bug.
                    >>>Setting it programmaticall y is an incorrect implementation when
                    >>>everything else on my page is set declaratively. Microsoft offered
                    >>>declarativ e (explicit) expressions, and I want to use them--anywhere
                    >>>and everywhere I choose in accordance with how they are stated to work.
                    >>>When I find one that doesn't work, it's a bug; it's not a case of my
                    >>>doing something incorrectly. I love Microsoft Visual Studio 2008; but,
                    >>>I won't tolerate bugs, or suck them up as, "Oh, I must be doing it
                    >>>wrong since it doesn't work--even though it should."
                    >>>>
                    >>>, Lee
                    >>>>
                    >>>"Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message
                    >>>news:%23xhBp uW2IHA.2384@TK2 MSFTNGP04.phx.g bl...
                    >>>>re:
                    >>>>!ASP.NET should make it easy for me--and, it does,
                    >>>>!but there is a bug in the implementation.
                    >>>>>
                    >>>>The fact that you *can* set xml:lang programmaticall y, and that you
                    >>>>*did* set it that way,
                    >>>>as I did, should tell you that it isn't much of a bug, but a question
                    >>>>of using the correct implementation.
                    >>>>>
                    >>>>But, again, please let us know what the reply to your bug report is.
                    >>>>>
                    >>>>>
                    >>>>>
                    >>>>Juan T. Llibre, asp.net MVP
                    >>>>asp.net faq : http://asp.net.do/faq/
                    >>>>foros de asp.net, en español : http://asp.net.do/foros/
                    >>>>=========== =============== ============
                    >>>>"Lee C." <nomail@spam.co mwrote in message
                    >>>>news:%239PI QvU2IHA.2384@TK 2MSFTNGP04.phx. gbl...
                    >>>>>Juan,
                    >>>>>>
                    >>>>>My use of language and culture in ASP.Net is a bit different than
                    >>>>>most. I have registered numerous country-code-specific domains
                    >>>>>(mysite.ca , mysite.co.uk, mysite.com.au, etc.), which resolve to a
                    >>>>>singular "ASP.Net Web Site". Nothing new there. However, I'm not
                    >>>>>doing the ASP.Net usual of letting the user agent (HTTP header
                    >>>>>'accept-language') determine which language visitors get; I have the
                    >>>>>country-code TLD drive it. Also, it's not just the language of my
                    >>>>>content that varies by cc TLD, it's the content, too; but, lang
                    >>>>>attribut es play a critical role in informing user agents (including
                    >>>>>search engine bots) for what "country" my content is aimed.
                    >>>>>>
                    >>>>>I have already found, first-hand, that the better of the major search
                    >>>>>engines use the cc TLD *and* the HTML lang/xml:lang to determine
                    >>>>>whether a domain's documents (mysite.com.au/my-document.aspx) should
                    >>>>>show up when a searcher searches with the 'Only from Australia'
                    >>>>>checkbox checked on Live.com, for example.
                    >>>>>>
                    >>>>>I'm not setting lang attributes for fun; I'm doing it to correct
                    >>>>>search engine results. ASP.NET should make it easy for me--and, it
                    >>>>>does, but there is a bug in the implementation.
                    >>>>>>
                    >>>>>I appreciate your interest and effort to help.
                    >>>>>>
                    >>>>>, Lee
                    >>>>>>
                    >>>>>>
                    >>>>>"Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message
                    >>>>>news:uBUnQ xT2IHA.4164@TK2 MSFTNGP03.phx.g bl...
                    >>>>>>re:
                    >>>>>>!versus the spirit of what we're trying to accomplish: telling
                    >>>>>>user agents who our
                    >>>>>>!intend ed audiences is, by language, as best we can...which is why
                    >>>>>>I'm *also*
                    >>>>>>!settin g lang in the HTTP headers and in page meta tags
                    >>>>>>>
                    >>>>>>What ? You don't set a language/culture in web.config, too ?
                    >>>>>>There's a use for overkill ! ( only kidding... )
                    >>>>>>>
                    >>>>>>I don't see too clearly the purpose of declaring a single language
                    >>>>>>for a web page.
                    >>>>>>>
                    >>>>>>I do see a use for declaring specific language attributes in a
                    >>>>>>*collecti on* of xml documents,
                    >>>>>>so that individual documents can be parsed for a particular language
                    >>>>>>content .
                    >>>>>>>
                    >>>>>>But, ymmv...
                    >>>>>>>
                    >>>>>>I'd still be interested in knowing what the reply is to your bug
                    >>>>>>report.
                    >>>>>>I bet you'll get back : "That's by design". <g>
                    >>>>>>>
                    >>>>>>Don't forget to let us all know what happens with that, OK ?
                    >>>>>>Thanks for an interesting discussion.
                    >>>>>>>
                    >>>>>>>
                    >>>>>>>
                    >>>>>>>
                    >>>>>>Juan T. Llibre, asp.net MVP
                    >>>>>>asp.net faq : http://asp.net.do/faq/
                    >>>>>>foros de asp.net, en español : http://asp.net.do/foros/
                    >>>>>>========= =============== ==============
                    >>>>>>"Lee C." <nomail@spam.co mwrote in message
                    >>>>>>news:en1P ZVT2IHA.524@TK2 MSFTNGP05.phx.g bl...
                    >>>>>>>Juan,
                    >>>>>>>>
                    >>>>>>>In theory, I like your idea of investigating "the standard"; but,
                    >>>>>>>in practice it has serious problems, as it often does. First, you
                    >>>>>>>are referring to the XML standard, which is not as appropriate as
                    >>>>>>>HTML and XHTML standards. Second, none of them are crystal clear on
                    >>>>>>>best practices for I18N. There is a lot of *legal* (by the
                    >>>>>>>standard ) syntax, that makes no sense, or makes some sense without
                    >>>>>>>being clearly best. The W3C site often states something to the
                    >>>>>>>effect of, "some are doing this, some are doing that, on your own
                    >>>>>>>site, at least do something and only time will tell what is best."
                    >>>>>>>>
                    >>>>>>>Check out these fine examples, which mirror my syntax, on the W3C
                    >>>>>>>site.
                    >>>>>>>>
                    >>>>>>>Internat ionalization Best Practices: Specifying Language in XHTML &
                    >>>>>>>HTML Content
                    >>>>>>>http://www.w3.org/TR/i18n-html-tech-...0429.092928424
                    >>>>>>>>
                    >>>>>>>>
                    >>>>>>>Tutorial : Declaring Language in XHTML and HTML (Draft)
                    >>>>>>>http://www.w3.org/International/tuto...Slide0160.html
                    >>>>>>>>
                    >>>>>>>Juan, you wrote:
                    >>>>>>>>But, it seems to me that setting xml:lang for the html tag's
                    >>>>>>>>*attrib ute* values is unneeded, since they must
                    >>>>>>>>be in English, and they must be attributes set to a language
                    >>>>>>>>identif ier, as defined by IETF RFC 4646
                    >>>>>>>>(http://www.ietf.org/rfc/rfc4646.txt).
                    >>>>>>>>
                    >>>>>>>You're not setting it for "the tag's *attribute*", you're setting
                    >>>>>>>it for the *contents*, all contents, of the element (unless
                    >>>>>>>overridd en by a sub-setting), which makes perfect sense so that I
                    >>>>>>>don't have to set it individually on every child element--that is
                    >>>>>>>the power of a hierarchy! You seem to be focused on the technical,
                    >>>>>>>with some misunderstandin g, versus the spirit of what we're trying
                    >>>>>>>to accomplish: telling user agents who our intended audiences is,
                    >>>>>>>by language, as best we can...which is why I'm *also* setting lang
                    >>>>>>>in the HTTP headers and in page meta tags.
                    >>>>>>>>
                    >>>>>>>, Lee
                    >>>>>>>>
                    >>>>>>>>
                    >>>>>>>"Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message
                    >>>>>>>news:OYI 4upK2IHA.5140@T K2MSFTNGP02.phx .gbl...
                    >>>>>>>>re:
                    >>>>>>>>!I found an MSDN document that explains why what I'm trying to
                    >>>>>>>>do should work
                    >>>>>>>>>
                    >>>>>>>>Lee,
                    >>>>>>>>>
                    >>>>>>>>From :
                    >>>>>>>>>
                    >>>>>>>>http://www.w3.org/TR/REC-xml/
                    >>>>>>>>>
                    >>>>>>>>"A special attribute named xml:lang may be inserted in documents
                    >>>>>>>>to specify the
                    >>>>>>>>languag e used in the contents and attribute values of any element
                    >>>>>>>>in an XML document."
                    >>>>>>>>>
                    >>>>>>>>If anything, I can see xml:lang being declared for specific
                    >>>>>>>>conte nt values, for example :
                    >>>>>>>>>
                    >>>>>>>><p xml:lang="en-GB">What colour is it?</p>
                    >>>>>>>><p xml:lang="en-US">What color is it?</p>
                    >>>>>>>>>
                    >>>>>>>>Then, an xml parser could identify regional US and British
                    >>>>>>>>spellin gs but, given that *all* the attribute values
                    >>>>>>>>must be in English in an html doc, what would be the purpose of
                    >>>>>>>>declari ng xml:lang for the html markup ?
                    >>>>>>>>>
                    >>>>>>>>A similar explanation is given here :
                    >>>>>>>>http://www.simonstl.com/xmlprim/xmlupdate/atts.html
                    >>>>>>>>>
                    >>>>>>>>---000---
                    >>>>>>>><SECTIO N>
                    >>>>>>>><DESCRI PTION xml:lang="en">
                    >>>>>>>>Caesa r begins by describing the geography of Gaul.
                    >>>>>>>></DESCRIPTION>
                    >>>>>>>><QUOT E xml:lang="la">
                    >>>>>>>>Galli a est omnis divisa in partes tres, quarum unam incolunt
                    >>>>>>>>Belga e,
                    >>>>>>>>aliam Aquitani, tertiam qui ipsorum lingua Celtae, nostra Galli
                    >>>>>>>>appella ntur.
                    >>>>>>>></QUOTE>
                    >>>>>>>>---000---
                    >>>>>>>>>
                    >>>>>>>>That' s perfectly good usage for xml:lang, as a parser could
                    >>>>>>>>selecti vely identify content in different languages.
                    >>>>>>>>>
                    >>>>>>>>But, it seems to me that setting xml:lang for the html tag's
                    >>>>>>>>*attrib ute* values is unneeded, since they must
                    >>>>>>>>be in English, and they must be attributes set to a language
                    >>>>>>>>identif ier, as defined by IETF RFC 4646
                    >>>>>>>>(http://www.ietf.org/rfc/rfc4646.txt).
                    >>>>>>>>>
                    >>>>>>>>So, I think that requisite pretty well establishes the futility
                    >>>>>>>>of setting xml:lang for all the attributes in an html document.
                    >>>>>>>>>
                    >>>>>>>>If anything, it seems that the xml:lang attribute is included in
                    >>>>>>>>the
                    >>>>>>>>html server tag for compatibility purposes, or perhaps out of
                    >>>>>>>>ignoran ce.
                    >>>>>>>>>
                    >>>>>>>>If there's a need to identify that the *contents* of a particular
                    >>>>>>>>marku p tag are in a
                    >>>>>>>>specifi c language, that identification can be included in the tag
                    >>>>>>>>itsel f, for example :
                    >>>>>>>>>
                    >>>>>>>><div lang="MX-es" xml:lang="MX-es">
                    >>>>>>>>Algo de contenido en español mejicano.
                    >>>>>>>></div>
                    >>>>>>>>>
                    >>>>>>>>That makes a lot more sense than setting xml:lang for the
                    >>>>>>>>attribu te values in the html tag.
                    >>>>>>>>>
                    >>>>>>>>>
                    >>>>>>>>>
                    >>>>>>>>Juan T. Llibre, asp.net MVP
                    >>>>>>>>asp.n et faq : http://asp.net.do/faq/
                    >>>>>>>>foros de asp.net, en español : http://asp.net.do/foros/
                    >>>>>>>>======= =============== =============== =
                    >>>>>>>>"Lee C." <no.spam@spamme r.comwrote in message
                    >>>>>>>>news:%2 3ocUnoI2IHA.218 8@TK2MSFTNGP04. phx.gbl...
                    >>>>>>>>>>I found an MSDN document that explains why what I'm trying to do
                    >>>>>>>>>>shoul d work.
                    >>>>>>>>>>
                    >>>>>>>>>ASP.NE T Web Server Controls Overview
                    >>>>>>>>>http://msdn.microsoft.com/en-us/library/zsyt68f1.aspx
                    >>>>>>>>>>
                    >>>>>>>>>Note the distinction between HTML Server Controls and Web Server
                    >>>>>>>>>Contro ls in the document. Also, note the explanation
                    >>>>>>>>>of "pass-through" attributes for HTML Server Controls.
                    >>>>>>>>>>
                    >>>>>>>>>Two quotes that sum it up:
                    >>>>>>>>> 1. Any HTML element on a page can be converted to an HTML
                    >>>>>>>>>serv er control by adding the attribute runat="server".
                    >>>>>>>>> 2. You can add any attributes you need to an HTML server
                    >>>>>>>>>contro l and the page framework will render them without
                    >>>>>>>>>any change in functionality.
                    >>>>>>>>>>
                    >>>>>>>>>, Lee
                    >>>>>>>>>>
                    >>>>>>>>>"Lee C." <no.spam@spamme r.comwrote in message
                    >>>>>>>>>news:O e38JYI2IHA.4772 @TK2MSFTNGP03.p hx.gbl...
                    >>>>>>>>>>Jua n,
                    >>>>>>>>>>>
                    >>>>>>>>>>I appreciate your trying to help, but you're wrong, and you are
                    >>>>>>>>>>the one who is confused. :]
                    >>>>>>>>>>>
                    >>>>>>>>>>I am *not* disputing that when inserted programmaticall y, the
                    >>>>>>>>>>xml:l ang attribute renders to the browser. I did just
                    >>>>>>>>>>tha t as a work around (right after I discovered this bug); but,
                    >>>>>>>>>>I should not have to.
                    >>>>>>>>>>>
                    >>>>>>>>>>I am *not* confusing html attributes with runat="server"
                    >>>>>>>>>>attri butes, as you call them. Using your logic, none of the
                    >>>>>>>>>>decla rative (html) attributes should render to the browser after
                    >>>>>>>>>>I add the runat="server" in ASP.NET; yet all of them
                    >>>>>>>>>>(xmln s, lang, and dir) do--except xml:lang.
                    >>>>>>>>>>>
                    >>>>>>>>>>I started with an html element with 4 attributes (xmlns, lang,
                    >>>>>>>>>>xml:l ang, and dir) all set declaratively. With *no*
                    >>>>>>>>>>5th attribute of runat="server", all 4 attributes render. If I
                    >>>>>>>>>>add the 5th attribute of runat="server", which does
                    >>>>>>>>>>not and should not render, I no longer get all 4 attributes that
                    >>>>>>>>>>shoul d render (xmlns, lang, xml:lang, and dir), I
                    >>>>>>>>>>onl y get 3 (xmlns, lang, and dir). My logic says I should get
                    >>>>>>>>>>4, your says I should get 3? It would be 4 or 0, and
                    >>>>>>>>>>4 is right. Not 0...and not 3.
                    >>>>>>>>>>>
                    >>>>>>>>>>Whe n I add runat="server", it does not magically make the
                    >>>>>>>>>>xml:l ang attribute a server-side attribute, while keeping
                    >>>>>>>>>>the other three attributes as "html" attributes. All four are
                    >>>>>>>>>>sti ll "html" attributes--which should render.
                    >>>>>>>>>>>
                    >>>>>>>>>>I think the simplification of my example may be confusing you.
                    >>>>>>>>>>It is odd that, in my example, I set runat="server"
                    >>>>>>>>>>but do not have any server-side attributes. (I have all 4 as
                    >>>>>>>>>>liter al strings, for simplicity of an example.) Well,
                    >>>>>>>>>>in my real-world use, I do have server-side attributes, which I
                    >>>>>>>>>>wan t set declaratively (no code-beside and no
                    >>>>>>>>>>scrip t). I have:
                    >>>>>>>>>>>
                    >>>>>>>>>><ht ml runat="server" xmlns="http://www.w3.org/1999/xhtml"
                    >>>>>>>>>> xml:lang="<%$ Resources:Globa lLang, ContentAudience Language
                    >>>>>>>>>>%>"
                    >>>>>>>>>> lang="<%$ Resources:Globa lLang, ContentAudience Language %>"
                    >>>>>>>>>> dir="ltr">
                    >>>>>>>>>>>
                    >>>>>>>>>>Bot h of those declarative explicit localization expressions
                    >>>>>>>>>>shoul d work without my having to write any more
                    >>>>>>>>>>"proc edural" (code-beside) code or script. It actually does
                    >>>>>>>>>>wor k fine for the lang attribute--as it should; but not
                    >>>>>>>>>>for the xml:lang attribute--***which is a bug***.
                    >>>>>>>>>>>
                    >>>>>>>>>>, Lee
                    >>>>>>>>>>>
                    >>>>>>>>>>"Ju an T. Llibre" <nomailreplies@ nowhere.comwrot e in message
                    >>>>>>>>>>news: u0WzB9H2IHA.418 8@TK2MSFTNGP04. phx.gbl...
                    >>>>>>>>>>>re :
                    >>>>>>>>>>>!I think you are misunderstandin g, Juan.
                    >>>>>>>>>>>>
                    >>>>>>>>>>>Well , I think you are misunderstandin g *me*.
                    >>>>>>>>>>>>
                    >>>>>>>>>>>re :
                    >>>>>>>>>>>!I had the xml:lang attribute in the html tag
                    >>>>>>>>>>>(dec laratively), like this:
                    >>>>>>>>>>>>... and it renders to the browser, as it should.
                    >>>>>>>>>>>>
                    >>>>>>>>>>>Ye s, because it's standard html.
                    >>>>>>>>>>>>
                    >>>>>>>>>>>re :
                    >>>>>>>>>>>!I f I simply add runat="server"
                    >>>>>>>>>>>>
                    >>>>>>>>>>>Th at declares the control to run server side.
                    >>>>>>>>>>>>
                    >>>>>>>>>>>Fo r any attribute to be programmed server-side you need a
                    >>>>>>>>>>>scri pt,
                    >>>>>>>>>>>ju st as you need a script to modify any server control's
                    >>>>>>>>>>>attr ibutes.
                    >>>>>>>>>>>>
                    >>>>>>>>>>>Di d you run the sample page I sent ?
                    >>>>>>>>>>>>
                    >>>>>>>>>>>It iterates throught the attributes for the html server
                    >>>>>>>>>>>cont rol,
                    >>>>>>>>>>>an d shows that the xml:lang attribute *is* added
                    >>>>>>>>>>>prog rammatically.
                    >>>>>>>>>>>>
                    >>>>>>>>>>>re :
                    >>>>>>>>>>>!I f I simply add runat="server", leaving in the xml:lang
                    >>>>>>>>>>>attr ibute that
                    >>>>>>>>>>>!ren ders without runat="server", all of the (declarative)
                    >>>>>>>>>>>attr ibutes are
                    >>>>>>>>>>>!ren dered to the browser--except the xml:lang attribute!
                    >>>>>>>>>>>Th at is a bug.
                    >>>>>>>>>>>>
                    >>>>>>>>>>>I think you're confusing html attributes with runat="server"
                    >>>>>>>>>>>attr ibutes.
                    >>>>>>>>>>>>
                    >>>>>>>>>>>Ht ml attributes can be inserted in normal html.
                    >>>>>>>>>>>Serv er-side attributes must be inserted in code.
                    >>>>>>>>>>>>
                    >>>>>>>>>>>Mayb e I'm not explaining this as well as I should.
                    >>>>>>>>>>>Tr y to get someone else's opinion on this matter, if you don't
                    >>>>>>>>>>>acce pt mine.
                    >>>>>>>>>>>>
                    >>>>>>>>>>>>
                    >>>>>>>>>>>>
                    >>>>>>>>>>>Ju an T. Llibre, asp.net MVP
                    >>>>>>>>>>>asp. net faq : http://asp.net.do/faq/
                    >>>>>>>>>>>foro s de asp.net, en español : http://asp.net.do/foros/
                    >>>>>>>>>>>==== =============== =============== ====
                    >>>>>>>>>>>"L ee C." <no.spam@spamme r.comwrote in message
                    >>>>>>>>>>>news :enam1gH2IHA.45 52@TK2MSFTNGP04 .phx.gbl...
                    >>>>>>>>>>>>> I think you are misunderstandin g, Juan. I had the xml:lang
                    >>>>>>>>>>>>>at tribute in the html tag (declaratively) , like this:
                    >>>>>>>>>>>>>
                    >>>>>>>>>>>><ht ml xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"
                    >>>>>>>>>>>>lan g="en-US" dir="ltr">
                    >>>>>>>>>>>>>
                    >>>>>>>>>>>>... and it renders to the browser, as it should.
                    >>>>>>>>>>>>>
                    >>>>>>>>>>>>I f I simply add runat="server", leaving in the xml:lang
                    >>>>>>>>>>>>att ribute that renders without runat="server", all of the
                    >>>>>>>>>>>>(de clarative) attributes are rendered to the browser--except
                    >>>>>>>>>>>>t he xml:lang attribute! That is a bug.
                    >>>>>>>>>>>>>
                    >>>>>>>>>>>><ht ml runat="server" xmlns="http://www.w3.org/1999/xhtml"
                    >>>>>>>>>>>>xml :lang="en-US" lang="en-US" dir="ltr">
                    >>>>>>>>>>>>>
                    >>>>>>>>>>>>Cor dially,
                    >>>>>>>>>>>>L ee
                    >>>>>>>>>>>>>
                    >>>>>>>>>>>>>
                    >>>>>>>>>>>>"Ju an T. Llibre" <nomailreplies@ nowhere.comwrot e in message
                    >>>>>>>>>>>>new s:eyrwjUH2IHA.3 920@TK2MSFTNGP0 2.phx.gbl...
                    >>>>>>>>>>>>>He re's a full example which shows that the xml:lang attribute
                    >>>>>>>>>>>>> is added programmaticall y :
                    >>>>>>>>>>>>> >
                    >>>>>>>>>>>>>at tributes.aspx:
                    >>>>>>>>>>>>>----------------------
                    >>>>>>>>>>>>><% @ Page Language="C#" AutoEventWireup ="True" %>
                    >>>>>>>>>>>>><h tml xmlns="http://www.w3.org/1999/xhtml" runat="server"
                    >>>>>>>>>>>>>id ="Myid" >
                    >>>>>>>>>>>>><s cript language="C#" runat="server">
                    >>>>>>>>>>>>>vo id Page_Load(Objec t sender, EventArgs e)
                    >>>>>>>>>>>>> {
                    >>>>>>>>>>>>>My id.Attributes.A dd("xml:lang", "es");
                    >>>>>>>>>>>>>Me ssage.InnerHtml = "<h4>The html control attributes
                    >>>>>>>>>>>>>co llection contains:</h4>";
                    >>>>>>>>>>>>>IE numerator keys = Myid.Attributes .Keys.GetEnumer ator();
                    >>>>>>>>>>>>>wh ile (keys.MoveNext( ))
                    >>>>>>>>>>>>> {
                    >>>>>>>>>>>>>St ring key = (String)keys.Cu rrent;
                    >>>>>>>>>>>>>Me ssage.InnerHtml += key + "=" + Myid.Attributes[key] + "<br
                    >>>>>>>>>>>>>/>";
                    >>>>>>>>>>>>> }
                    >>>>>>>>>>>>> }
                    >>>>>>>>>>>>> </script>
                    >>>>>>>>>>>>><h ead id="Head1" runat="server">
                    >>>>>>>>>>>>><t itle>The html control attributes collection</title>
                    >>>>>>>>>>>>> </head>
                    >>>>>>>>>>>>><b ody>
                    >>>>>>>>>>>>><f orm id="Form1" runat="server">
                    >>>>>>>>>>>>><h 3>HtmlControl Attribute Collection Example</h3>
                    >>>>>>>>>>>>><b r />
                    >>>>>>>>>>>>><s pan id="Message" enableviewstate ="false" runat="server" />
                    >>>>>>>>>>>>> </form>
                    >>>>>>>>>>>>> </body>
                    >>>>>>>>>>>>> </html>
                    >>>>>>>>>>>>>----------------
                    >>>>>>>>>>>>> >
                    >>>>>>>>>>>>> I don't think it's a bug to have to add an attribute
                    >>>>>>>>>>>>>pr ogrammatically,
                    >>>>>>>>>>>>>be cause the runat="server" tag only *declares* the html
                    >>>>>>>>>>>>>co ntrol as a programmable control.
                    >>>>>>>>>>>>> >
                    >>>>>>>>>>>>> To actually program it, you must use a script.
                    >>>>>>>>>>>>> >
                    >>>>>>>>>>>>> >
                    >>>>>>>>>>>>> >
                    >>>>>>>>>>>>> >
                    >>>>>>>>>>>>>Ju an T. Llibre, asp.net MVP
                    >>>>>>>>>>>>>as p.net faq : http://asp.net.do/faq/
                    >>>>>>>>>>>>>fo ros de asp.net, en español : http://asp.net.do/foros/
                    >>>>>>>>>>>>>== =============== =============== ======
                    >>>>>>>>>>>>>"L ee C." <no.spam@spamme r.comwrote in message
                    >>>>>>>>>>>>>ne ws:e0rLaPG2IHA. 4772@TK2MSFTNGP 03.phx.gbl...
                    >>>>>>>>>>>>>>T hanks, Juan.
                    >>>>>>>>>>>>> >>
                    >>>>>>>>>>>>> >I already added similar code to a page event in my
                    >>>>>>>>>>>>>>m asterpage code-beside.
                    >>>>>>>>>>>>> >>
                    >>>>>>>>>>>>> > elHtml.Attribut es.Add("xml:lan g",
                    >>>>>>>>>>>>>>R esources.Global Lang.ContentAud ienceLanguage)
                    >>>>>>>>>>>>> >>
                    >>>>>>>>>>>>>>T o me, that is a temporary workaround. I still want to
                    >>>>>>>>>>>>>>u nderstand whether the "eating" of the attribute I
                    >>>>>>>>>>>>>>o riginally
                    >>>>>>>>>>>>>>p osted about is a bug, or if this is actually happening for
                    >>>>>>>>>>>>> >a reason.
                    >>>>>>>>>>>>> >>
                    >>>>>>>>>>>>>>C ordially,
                    >>>>>>>>>>>>>>L ee
                    >>>>>>>>>>>>> >>
                    >>>>>>>>>>>>> >>
                    >>>>>>>>>>>>>>" Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in
                    >>>>>>>>>>>>>>m essage news:%23gBUqSC2 IHA.4772@TK2MSF TNGP03.phx.gbl. ..
                    >>>>>>>>>>>>>>> Hi, Lee.
                    >>>>>>>>>>>>>>> >
                    >>>>>>>>>>>>>>> re:
                    >>>>>>>>>>>>>>> !<html runat="server"
                    >>>>>>>>>>>>>>> xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"
                    >>>>>>>>>>>>>>> lang="en-US" dir="ltr">
                    >>>>>>>>>>>>>>> !no xml:lang attribute is rendered to the browser!
                    >>>>>>>>>>>>>>> !Remove the runat="server", and, voila, the xml:lang
                    >>>>>>>>>>>>>>> attribute is rendered.
                    >>>>>>>>>>>>>>> >
                    >>>>>>>>>>>>>>> Try this :
                    >>>>>>>>>>>>>>> >
                    >>>>>>>>>>>>>>> <html xmlns="http://www.w3.org/1999/xhtml" runat="server"
                    >>>>>>>>>>>>>>> id="someID">
                    >>>>>>>>>>>>>>> >
                    >>>>>>>>>>>>>>> <script runat="server">
                    >>>>>>>>>>>>>>> someID.Attribut es("xml:lang") = "en-US"
                    >>>>>>>>>>>>>>> </script>
                    >>>>>>>>>>>>>>> >
                    >>>>>>>>>>>>>>> >
                    >>>>>>>>>>>>>>> >
                    >>>>>>>>>>>>>>> Juan T. Llibre, asp.net MVP
                    >>>>>>>>>>>>>>> asp.net faq : http://asp.net.do/faq/
                    >>>>>>>>>>>>>>> foros de asp.net, en español : http://asp.net.do/foros/
                    >>>>>>>>>>>>>>> =============== =============== ========
                    >>>>>>>>>>>>>>> >
                    >>>>>>>>>>>>>>> "Lee C." <nomail@spam.co mwrote in message
                    >>>>>>>>>>>>>>> news:O%23KsAQA2 IHA.4572@TK2MSF TNGP03.phx.gbl. ..
                    >>>>>>>>>>>>>>> >>I think I have discovered a bug in ASP.NET, related to
                    >>>>>>>>>>>>>>> >>I18N.
                    >>>>>>>>>>>>>>> >>
                    >>>>>>>>>>>>>>> >In ASP.NET 3.5 I have to set runat="server" on the html
                    >>>>>>>>>>>>>>> >element to use explicit expressions. It appears that
                    >>>>>>>>>>>>>>> >ASP.NET
                    >>>>>>>>>>>>>>> >eats the xml:lang attribute on the html element when it is
                    >>>>>>>>>>>>>>> >set to runat="server".
                    >>>>>>>>>>>>>>> >>
                    >>>>>>>>>>>>>>> >Of course I want to replace the hardcoded "en-US" values
                    >>>>>>>>>>>>>>> >with (resource) explicit expressions; but, for simplicity,
                    >>>>>>>>>>>>>>> >try this:
                    >>>>>>>>>>>>>>> >>
                    >>>>>>>>>>>>>>> ><html runat="server" xmlns="http://www.w3.org/1999/xhtml"
                    >>>>>>>>>>>>>>> >xml:lang="en-US" lang="en-US" dir="ltr">
                    >>>>>>>>>>>>>>> >>
                    >>>>>>>>>>>>>>> >...And you will find that no xml:lang attribute is
                    >>>>>>>>>>>>>>> >rendered to the browser! Remove the runat="server", and,
                    >>>>>>>>>>>>>>> >voila, the xml:lang attribute is rendered. :[
                    >>>>>>>>>>>>>>> >>
                    >>>>>>>>>>>>>>> >...Any ideas?
                    >>>>>>>>>>>>>>> >>
                    >>>>>>>>>>>>>>> >Cordially,
                    >>>>>>>>>>>>>>> >Lee
                    >
                    >

                    Comment

                    • Juan T. Llibre

                      #11
                      Re: ASP.NET Internationaliz ation bug?

                      re:
                      !I'm the one following modern best-practices (separating content from code)

                      Sorry. Inline code is just as good a best-practice as code-behind.

                      re:
                      !At this point, I have no interest in your ASP.NET co-authoring.

                      Ooh, nasty. I hope you feel better now that you got that zinger off.
                      Let's see what Microsoft's VS bug team says about the bug you filed, OK ?




                      Juan T. Llibre, asp.net MVP
                      asp.net faq : http://asp.net.do/faq/
                      foros de asp.net, en español : http://asp.net.do/foros/
                      =============== =============== ========
                      "Lee C." <nomail@spam.co mwrote in message news:%23A3ULgk2 IHA.4852@TK2MSF TNGP05.phx.gbl. ..
                      You say you understand, but you make statements that demonstrate otherwise. You've been arguing against my "what" and
                      "why" all along; yet, I'm the one following modern best-practices (separating content from code)--which are required
                      for my scenario. If someone chooses to mix them, that's their choice; but, it does not change the bug into a
                      feature--regardless of your position that it does.
                      >
                      At this point, I have no interest in your ASP.NET co-authoring.
                      >
                      Cordially,
                      Lee
                      >
                      "Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message news:uJAnnYi2IH A.3600@TK2MSFTN GP04.phx.gbl...
                      >re:
                      >!You clearly don't understand
                      >>
                      >That "clearly" is doubted by me.
                      >>
                      >How many times have I told you that I *do* understand what you're saying
                      >but that I'd like to see the bug response team's reply to your "bug report" ?
                      >>
                      >How many times will you repeat that I "don't understand", when I do,
                      >although I disagree with the premises you're putting forth ?
                      >>
                      >re:
                      >!Are you really an ASP.NET MVP? (Classic ASP, maybe?)
                      >>
                      >The answer to that question is in my signature.
                      >Maybe you haven't read any of the ASP.NET books I've co-authored ?
                      >>
                      >Good luck with the response to your bug report.
                      >Please remember to post the result here.
                      >>
                      >>
                      >>
                      >>
                      >Juan T. Llibre, asp.net MVP
                      >asp.net faq : http://asp.net.do/faq/
                      >foros de asp.net, en español : http://asp.net.do/foros/
                      >============== =============== =========
                      >"Lee C." <nomail@spam.co mwrote in message news:eE3jN2g2IH A.4572@TK2MSFTN GP03.phx.gbl...
                      >>Juan,
                      >>>
                      >>You clearly don't understand, or have not thought about *why* the ASP.NET team gave us separate places for
                      >>"design"/content (.aspx files) and "procedure"/code (.aspx.vb). The ability to separate the 2 was a huge feature
                      >>for ASP.NET, from classic ASP.
                      >>>
                      >>Even though the particular content affected by the bug I found is not *visible* Web browser content, it is content
                      >>none-the-less. Thus, its wiring belongs in the content file (.aspx)--not the code file (.aspx.vb). Sure, I could
                      >>throw in some classic ASP style, and put a script element in my .aspx page to keep the wiring in the realm of the
                      >>designer, but that changes nothing, because it's still programming, which should be done by programmers in the same
                      >>place as every other line of programming in my site: the .aspx.vb pages. Just as badly, it means I'm achieving my
                      >>I18N wiring in multiple ways, instead of being consistent.
                      >>>
                      >>By everything else, I meant all other I18N resource "wirings". (But, I take pride in how "light" my .aspx.vb files
                      >>are--and how clean my .aspx files are, too.) You are obviously fine with having the designer(s) to set up and
                      >>manage *most* of the I18N wirings, *and* having programmers to do some, too, (as they should not be doing) since
                      >>bugs are not bugs for you if there is a workaround that violates good design practices and principles. I'm not fine
                      >>with that.
                      >>>
                      >>Are you really an ASP.NET MVP? (Classic ASP, maybe?)
                      >>>
                      >>, Lee
                      >>>
                      >>>
                      >>"Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message news:urCttna2IH A.4476@TK2MSFTN GP06.phx.gbl...
                      >>>re:
                      >>>!Setting it programmaticall y is an incorrect implementation
                      >>>!when everything else on my page is set declaratively.
                      >>>>
                      >>>Is everything else on your pages set declaratively ?
                      >>>Think about that for a second.
                      >>>>
                      >>>Why do we have inline scripts and code-behind, if "everything else is set declaratively" ?
                      >>>>
                      >>>In any case, we've certainly had enough of the "I think that..." back and forth.
                      >>>>
                      >>>Let's pause this discussion until the "bug" you reported is explained by the VS Dev team, OK ?
                      >>>I, definitely, want to see what their explanation is.
                      >>>>
                      >>>https://connect.microsoft.com/Visual...dbackID=353879
                      >>>>
                      >>>>
                      >>>>
                      >>>Juan T. Llibre, asp.net MVP
                      >>>asp.net faq : http://asp.net.do/faq/
                      >>>foros de asp.net, en español : http://asp.net.do/foros/
                      >>>============ =============== ===========
                      >>>"Lee C." <nomail@spam.co mwrote in message news:eQlpa4W2IH A.4704@TK2MSFTN GP05.phx.gbl...
                      >>>>Correct implementation? What do you mean by that?
                      >>>>>
                      >>>>I stated earlier on that I worked around it. It's still a bug. Setting it programmaticall y is an incorrect
                      >>>>implementat ion when everything else on my page is set declaratively. Microsoft offered declarative (explicit)
                      >>>>expressions , and I want to use them--anywhere and everywhere I choose in accordance with how they are stated to
                      >>>>work. When I find one that doesn't work, it's a bug; it's not a case of my doing something incorrectly. I love
                      >>>>Microsoft Visual Studio 2008; but, I won't tolerate bugs, or suck them up as, "Oh, I must be doing it wrong since
                      >>>>it doesn't work--even though it should."
                      >>>>>
                      >>>>, Lee
                      >>>>>
                      >>>>"Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message news:%23xhBpuW2 IHA.2384@TK2MSF TNGP04.phx.gbl. ..
                      >>>>>re:
                      >>>>>!ASP.NET should make it easy for me--and, it does,
                      >>>>>!but there is a bug in the implementation.
                      >>>>>>
                      >>>>>The fact that you *can* set xml:lang programmaticall y, and that you *did* set it that way,
                      >>>>>as I did, should tell you that it isn't much of a bug, but a question of using the correct implementation.
                      >>>>>>
                      >>>>>But, again, please let us know what the reply to your bug report is.
                      >>>>>>
                      >>>>>>
                      >>>>>>
                      >>>>>Juan T. Llibre, asp.net MVP
                      >>>>>asp.net faq : http://asp.net.do/faq/
                      >>>>>foros de asp.net, en español : http://asp.net.do/foros/
                      >>>>>========== =============== =============
                      >>>>>"Lee C." <nomail@spam.co mwrote in message news:%239PIQvU2 IHA.2384@TK2MSF TNGP04.phx.gbl. ..
                      >>>>>>Juan,
                      >>>>>>>
                      >>>>>>My use of language and culture in ASP.Net is a bit different than most. I have registered numerous
                      >>>>>>country-code-specific domains (mysite.ca, mysite.co.uk, mysite.com.au, etc.), which resolve to a singular
                      >>>>>>"ASP.Ne t Web Site". Nothing new there. However, I'm not doing the ASP.Net usual of letting the user agent
                      >>>>>>(HTTP header 'accept-language') determine which language visitors get; I have the country-code TLD drive it.
                      >>>>>>Also, it's not just the language of my content that varies by cc TLD, it's the content, too; but, lang
                      >>>>>>attribute s play a critical role in informing user agents (including search engine bots) for what "country" my
                      >>>>>>content is aimed.
                      >>>>>>>
                      >>>>>>I have already found, first-hand, that the better of the major search engines use the cc TLD *and* the HTML
                      >>>>>>lang/xml:lang to determine whether a domain's documents (mysite.com.au/my-document.aspx) should show up when a
                      >>>>>>searche r searches with the 'Only from Australia' checkbox checked on Live.com, for example.
                      >>>>>>>
                      >>>>>>I'm not setting lang attributes for fun; I'm doing it to correct search engine results. ASP.NET should make it
                      >>>>>>easy for me--and, it does, but there is a bug in the implementation.
                      >>>>>>>
                      >>>>>>I appreciate your interest and effort to help.
                      >>>>>>>
                      >>>>>>, Lee
                      >>>>>>>
                      >>>>>>>
                      >>>>>>"Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message news:uBUnQxT2IH A.4164@TK2MSFTN GP03.phx.gbl...
                      >>>>>>>re:
                      >>>>>>>!versu s the spirit of what we're trying to accomplish: telling user agents who our
                      >>>>>>>!intende d audiences is, by language, as best we can...which is why I'm *also*
                      >>>>>>>!setti ng lang in the HTTP headers and in page meta tags
                      >>>>>>>>
                      >>>>>>>What ? You don't set a language/culture in web.config, too ?
                      >>>>>>>There' s a use for overkill ! ( only kidding... )
                      >>>>>>>>
                      >>>>>>>I don't see too clearly the purpose of declaring a single language for a web page.
                      >>>>>>>>
                      >>>>>>>I do see a use for declaring specific language attributes in a *collection* of xml documents,
                      >>>>>>>so that individual documents can be parsed for a particular language content.
                      >>>>>>>>
                      >>>>>>>But, ymmv...
                      >>>>>>>>
                      >>>>>>>I'd still be interested in knowing what the reply is to your bug report.
                      >>>>>>>I bet you'll get back : "That's by design". <g>
                      >>>>>>>>
                      >>>>>>>Don't forget to let us all know what happens with that, OK ?
                      >>>>>>>Thanks for an interesting discussion.
                      >>>>>>>>
                      >>>>>>>>
                      >>>>>>>>
                      >>>>>>>>
                      >>>>>>>Juan T. Llibre, asp.net MVP
                      >>>>>>>asp.ne t faq : http://asp.net.do/faq/
                      >>>>>>>foros de asp.net, en español : http://asp.net.do/foros/
                      >>>>>>>======== =============== ===============
                      >>>>>>>"Lee C." <nomail@spam.co mwrote in message news:en1PZVT2IH A.524@TK2MSFTNG P05.phx.gbl...
                      >>>>>>>>Juan,
                      >>>>>>>>>
                      >>>>>>>>In theory, I like your idea of investigating "the standard"; but, in practice it has serious problems, as it
                      >>>>>>>>often does. First, you are referring to the XML standard, which is not as appropriate as HTML and XHTML
                      >>>>>>>>standar ds. Second, none of them are crystal clear on best practices for I18N. There is a lot of *legal* (by
                      >>>>>>>>the standard) syntax, that makes no sense, or makes some sense without being clearly best. The W3C site often
                      >>>>>>>>state s something to the effect of, "some are doing this, some are doing that, on your own site, at least do
                      >>>>>>>>somethi ng and only time will tell what is best."
                      >>>>>>>>>
                      >>>>>>>>Check out these fine examples, which mirror my syntax, on the W3C site.
                      >>>>>>>>>
                      >>>>>>>>Interna tionalization Best Practices: Specifying Language in XHTML & HTML Content
                      >>>>>>>>http://www.w3.org/TR/i18n-html-tech-...0429.092928424
                      >>>>>>>>>
                      >>>>>>>>>
                      >>>>>>>>Tutoria l: Declaring Language in XHTML and HTML (Draft)
                      >>>>>>>>http://www.w3.org/International/tuto...Slide0160.html
                      >>>>>>>>>
                      >>>>>>>>Juan, you wrote:
                      >>>>>>>>>But, it seems to me that setting xml:lang for the html tag's *attribute* values is unneeded, since they must
                      >>>>>>>>>be in English, and they must be attributes set to a language identifier, as defined by IETF RFC 4646
                      >>>>>>>>>(http://www.ietf.org/rfc/rfc4646.txt).
                      >>>>>>>>>
                      >>>>>>>>You'r e not setting it for "the tag's *attribute*", you're setting it for the *contents*, all contents, of the
                      >>>>>>>>eleme nt (unless overridden by a sub-setting), which makes perfect sense so that I don't have to set it
                      >>>>>>>>individ ually on every child element--that is the power of a hierarchy! You seem to be focused on the
                      >>>>>>>>technic al, with some misunderstandin g, versus the spirit of what we're trying to accomplish: telling user
                      >>>>>>>>agent s who our intended audiences is, by language, as best we can...which is why I'm *also* setting lang in
                      >>>>>>>>the HTTP headers and in page meta tags.
                      >>>>>>>>>
                      >>>>>>>>, Lee
                      >>>>>>>>>
                      >>>>>>>>>
                      >>>>>>>>"Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message news:OYI4upK2IH A.5140@TK2MSFTN GP02.phx.gbl...
                      >>>>>>>>>re:
                      >>>>>>>>>!I found an MSDN document that explains why what I'm trying to do should work
                      >>>>>>>>>>
                      >>>>>>>>>Lee,
                      >>>>>>>>>>
                      >>>>>>>>>From :
                      >>>>>>>>>>
                      >>>>>>>>>http://www.w3.org/TR/REC-xml/
                      >>>>>>>>>>
                      >>>>>>>>>"A special attribute named xml:lang may be inserted in documents to specify the
                      >>>>>>>>>langua ge used in the contents and attribute values of any element in an XML document."
                      >>>>>>>>>>
                      >>>>>>>>>If anything, I can see xml:lang being declared for specific content values, for example :
                      >>>>>>>>>>
                      >>>>>>>>><p xml:lang="en-GB">What colour is it?</p>
                      >>>>>>>>><p xml:lang="en-US">What color is it?</p>
                      >>>>>>>>>>
                      >>>>>>>>>Then , an xml parser could identify regional US and British spellings but, given that *all* the attribute
                      >>>>>>>>>valu es
                      >>>>>>>>>must be in English in an html doc, what would be the purpose of declaring xml:lang for the html markup ?
                      >>>>>>>>>>
                      >>>>>>>>>A similar explanation is given here :
                      >>>>>>>>>http://www.simonstl.com/xmlprim/xmlupdate/atts.html
                      >>>>>>>>>>
                      >>>>>>>>>---000---
                      >>>>>>>>><SECTI ON>
                      >>>>>>>>><DESCR IPTION xml:lang="en">
                      >>>>>>>>>Caes ar begins by describing the geography of Gaul.
                      >>>>>>>>></DESCRIPTION>
                      >>>>>>>>><QUO TE xml:lang="la">
                      >>>>>>>>>Gall ia est omnis divisa in partes tres, quarum unam incolunt Belgae,
                      >>>>>>>>>alia m Aquitani, tertiam qui ipsorum lingua Celtae, nostra Galli appellantur.
                      >>>>>>>>></QUOTE>
                      >>>>>>>>>---000---
                      >>>>>>>>>>
                      >>>>>>>>>That 's perfectly good usage for xml:lang, as a parser could selectively identify content in different
                      >>>>>>>>>langua ges.
                      >>>>>>>>>>
                      >>>>>>>>>But, it seems to me that setting xml:lang for the html tag's *attribute* values is unneeded, since they must
                      >>>>>>>>>be in English, and they must be attributes set to a language identifier, as defined by IETF RFC 4646
                      >>>>>>>>>(http://www.ietf.org/rfc/rfc4646.txt).
                      >>>>>>>>>>
                      >>>>>>>>>So, I think that requisite pretty well establishes the futility
                      >>>>>>>>>of setting xml:lang for all the attributes in an html document.
                      >>>>>>>>>>
                      >>>>>>>>>If anything, it seems that the xml:lang attribute is included in the
                      >>>>>>>>>html server tag for compatibility purposes, or perhaps out of ignorance.
                      >>>>>>>>>>
                      >>>>>>>>>If there's a need to identify that the *contents* of a particular markup tag are in a
                      >>>>>>>>>specif ic language, that identification can be included in the tag itself, for example :
                      >>>>>>>>>>
                      >>>>>>>>><div lang="MX-es" xml:lang="MX-es">
                      >>>>>>>>>Algo de contenido en español mejicano.
                      >>>>>>>>></div>
                      >>>>>>>>>>
                      >>>>>>>>>That makes a lot more sense than setting xml:lang for the attribute values in the html tag.
                      >>>>>>>>>>
                      >>>>>>>>>>
                      >>>>>>>>>>
                      >>>>>>>>>Juan T. Llibre, asp.net MVP
                      >>>>>>>>>asp.ne t faq : http://asp.net.do/faq/
                      >>>>>>>>>foro s de asp.net, en español : http://asp.net.do/foros/
                      >>>>>>>>>====== =============== =============== ==
                      >>>>>>>>>"Lee C." <no.spam@spamme r.comwrote in message news:%23ocUnoI2 IHA.2188@TK2MSF TNGP04.phx.gbl. ..
                      >>>>>>>>>>>I found an MSDN document that explains why what I'm trying to do should work.
                      >>>>>>>>>>>
                      >>>>>>>>>>ASP.N ET Web Server Controls Overview
                      >>>>>>>>>>http://msdn.microsoft.com/en-us/library/zsyt68f1.aspx
                      >>>>>>>>>>>
                      >>>>>>>>>>Not e the distinction between HTML Server Controls and Web Server Controls in the document. Also, note the
                      >>>>>>>>>>expla nation
                      >>>>>>>>>>of "pass-through" attributes for HTML Server Controls.
                      >>>>>>>>>>>
                      >>>>>>>>>>Two quotes that sum it up:
                      >>>>>>>>>> 1. Any HTML element on a page can be converted to an HTML server control by adding the attribute
                      >>>>>>>>>>runat ="server".
                      >>>>>>>>>> 2. You can add any attributes you need to an HTML server control and the page framework will render them
                      >>>>>>>>>>witho ut
                      >>>>>>>>>>any change in functionality.
                      >>>>>>>>>>>
                      >>>>>>>>>>, Lee
                      >>>>>>>>>>>
                      >>>>>>>>>>"Le e C." <no.spam@spamme r.comwrote in message news:Oe38JYI2IH A.4772@TK2MSFTN GP03.phx.gbl...
                      >>>>>>>>>>>Juan ,
                      >>>>>>>>>>>>
                      >>>>>>>>>>>I appreciate your trying to help, but you're wrong, and you are the one who is confused. :]
                      >>>>>>>>>>>>
                      >>>>>>>>>>>I am *not* disputing that when inserted programmaticall y, the xml:lang attribute renders to the browser. I
                      >>>>>>>>>>>di d just
                      >>>>>>>>>>>th at as a work around (right after I discovered this bug); but, I should not have to.
                      >>>>>>>>>>>>
                      >>>>>>>>>>>I am *not* confusing html attributes with runat="server" attributes, as you call them. Using your logic,
                      >>>>>>>>>>>no ne of the
                      >>>>>>>>>>>decl arative (html) attributes should render to the browser after I add the runat="server" in ASP.NET; yet
                      >>>>>>>>>>>al l of them
                      >>>>>>>>>>>(xml ns, lang, and dir) do--except xml:lang.
                      >>>>>>>>>>>>
                      >>>>>>>>>>>I started with an html element with 4 attributes (xmlns, lang, xml:lang, and dir) all set declaratively.
                      >>>>>>>>>>>Wi th *no*
                      >>>>>>>>>>>5t h attribute of runat="server", all 4 attributes render. If I add the 5th attribute of runat="server",
                      >>>>>>>>>>>whic h does
                      >>>>>>>>>>>no t and should not render, I no longer get all 4 attributes that should render (xmlns, lang, xml:lang, and
                      >>>>>>>>>>>dir) , I
                      >>>>>>>>>>>on ly get 3 (xmlns, lang, and dir). My logic says I should get 4, your says I should get 3? It would be 4
                      >>>>>>>>>>>or 0, and
                      >>>>>>>>>>>4 is right. Not 0...and not 3.
                      >>>>>>>>>>>>
                      >>>>>>>>>>>Wh en I add runat="server", it does not magically make the xml:lang attribute a server-side attribute, while
                      >>>>>>>>>>>keep ing
                      >>>>>>>>>>>th e other three attributes as "html" attributes. All four are still "html" attributes--which should
                      >>>>>>>>>>>rend er.
                      >>>>>>>>>>>>
                      >>>>>>>>>>>I think the simplification of my example may be confusing you. It is odd that, in my example, I set
                      >>>>>>>>>>>runa t="server"
                      >>>>>>>>>>>bu t do not have any server-side attributes. (I have all 4 as literal strings, for simplicity of an
                      >>>>>>>>>>>exam ple.) Well,
                      >>>>>>>>>>>in my real-world use, I do have server-side attributes, which I want set declaratively (no code-beside and
                      >>>>>>>>>>>no
                      >>>>>>>>>>>scri pt). I have:
                      >>>>>>>>>>>>
                      >>>>>>>>>>><htm l runat="server" xmlns="http://www.w3.org/1999/xhtml"
                      >>>>>>>>>>> xml:lang="<%$ Resources:Globa lLang, ContentAudience Language %>"
                      >>>>>>>>>>> lang="<%$ Resources:Globa lLang, ContentAudience Language %>"
                      >>>>>>>>>>> dir="ltr">
                      >>>>>>>>>>>>
                      >>>>>>>>>>>Bo th of those declarative explicit localization expressions should work without my having to write any more
                      >>>>>>>>>>>"pro cedural" (code-beside) code or script. It actually does work fine for the lang attribute--as it
                      >>>>>>>>>>>shou ld; but not
                      >>>>>>>>>>>fo r the xml:lang attribute--***which is a bug***.
                      >>>>>>>>>>>>
                      >>>>>>>>>>>, Lee
                      >>>>>>>>>>>>
                      >>>>>>>>>>>"Jua n T. Llibre" <nomailreplies@ nowhere.comwrot e in message news:u0WzB9H2IH A.4188@TK2MSFTN GP04.phx.gbl...
                      >>>>>>>>>>>>r e:
                      >>>>>>>>>>>>! I think you are misunderstandin g, Juan.
                      >>>>>>>>>>>>>
                      >>>>>>>>>>>>Wel l, I think you are misunderstandin g *me*.
                      >>>>>>>>>>>>>
                      >>>>>>>>>>>>r e:
                      >>>>>>>>>>>>! I had the xml:lang attribute in the html tag (declaratively) , like this:
                      >>>>>>>>>>>>>.. .and it renders to the browser, as it should.
                      >>>>>>>>>>>>>
                      >>>>>>>>>>>>Yes , because it's standard html.
                      >>>>>>>>>>>>>
                      >>>>>>>>>>>>r e:
                      >>>>>>>>>>>>! If I simply add runat="server"
                      >>>>>>>>>>>>>
                      >>>>>>>>>>>>Tha t declares the control to run server side.
                      >>>>>>>>>>>>>
                      >>>>>>>>>>>>F or any attribute to be programmed server-side you need a script,
                      >>>>>>>>>>>>jus t as you need a script to modify any server control's attributes.
                      >>>>>>>>>>>>>
                      >>>>>>>>>>>>D id you run the sample page I sent ?
                      >>>>>>>>>>>>>
                      >>>>>>>>>>>>I t iterates throught the attributes for the html server control,
                      >>>>>>>>>>>>a nd shows that the xml:lang attribute *is* added programmaticall y.
                      >>>>>>>>>>>>>
                      >>>>>>>>>>>>r e:
                      >>>>>>>>>>>>! If I simply add runat="server", leaving in the xml:lang attribute that
                      >>>>>>>>>>>>!re nders without runat="server", all of the (declarative) attributes are
                      >>>>>>>>>>>>!re ndered to the browser--except the xml:lang attribute! That is a bug.
                      >>>>>>>>>>>>>
                      >>>>>>>>>>>>I think you're confusing html attributes with runat="server" attributes.
                      >>>>>>>>>>>>>
                      >>>>>>>>>>>>Htm l attributes can be inserted in normal html.
                      >>>>>>>>>>>>Ser ver-side attributes must be inserted in code.
                      >>>>>>>>>>>>>
                      >>>>>>>>>>>>May be I'm not explaining this as well as I should.
                      >>>>>>>>>>>>T ry to get someone else's opinion on this matter, if you don't accept mine.
                      >>>>>>>>>>>>>
                      >>>>>>>>>>>>>
                      >>>>>>>>>>>>>
                      >>>>>>>>>>>>Jua n T. Llibre, asp.net MVP
                      >>>>>>>>>>>>asp .net faq : http://asp.net.do/faq/
                      >>>>>>>>>>>>for os de asp.net, en español : http://asp.net.do/foros/
                      >>>>>>>>>>>>=== =============== =============== =====
                      >>>>>>>>>>>>"Le e C." <no.spam@spamme r.comwrote in message news:enam1gH2IH A.4552@TK2MSFTN GP04.phx.gbl...
                      >>>>>>>>>>>>> >I think you are misunderstandin g, Juan. I had the xml:lang attribute in the html tag (declaratively) ,
                      >>>>>>>>>>>>>>l ike this:
                      >>>>>>>>>>>>> >
                      >>>>>>>>>>>>><h tml xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US" dir="ltr">
                      >>>>>>>>>>>>> >
                      >>>>>>>>>>>>>.. .and it renders to the browser, as it should.
                      >>>>>>>>>>>>> >
                      >>>>>>>>>>>>> If I simply add runat="server", leaving in the xml:lang attribute that renders without runat="server",
                      >>>>>>>>>>>>>al l of the
                      >>>>>>>>>>>>>(d eclarative) attributes are rendered to the browser--except the xml:lang attribute! That is a bug.
                      >>>>>>>>>>>>> >
                      >>>>>>>>>>>>><h tml runat="server" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US" dir="ltr">
                      >>>>>>>>>>>>> >
                      >>>>>>>>>>>>>Co rdially,
                      >>>>>>>>>>>>>Le e
                      >>>>>>>>>>>>> >
                      >>>>>>>>>>>>> >
                      >>>>>>>>>>>>>"J uan T. Llibre" <nomailreplies@ nowhere.comwrot e in message
                      >>>>>>>>>>>>>ne ws:eyrwjUH2IHA. 3920@TK2MSFTNGP 02.phx.gbl...
                      >>>>>>>>>>>>>>H ere's a full example which shows that the xml:lang attribute is added programmaticall y :
                      >>>>>>>>>>>>> >>
                      >>>>>>>>>>>>>>a ttributes.aspx:
                      >>>>>>>>>>>>> >----------------------
                      >>>>>>>>>>>>>>< %@ Page Language="C#" AutoEventWireup ="True" %>
                      >>>>>>>>>>>>>>< html xmlns="http://www.w3.org/1999/xhtml" runat="server" id="Myid" >
                      >>>>>>>>>>>>>>< script language="C#" runat="server">
                      >>>>>>>>>>>>>>v oid Page_Load(Objec t sender, EventArgs e)
                      >>>>>>>>>>>>> >{
                      >>>>>>>>>>>>>>M yid.Attributes. Add("xml:lang", "es");
                      >>>>>>>>>>>>>>M essage.InnerHtm l = "<h4>The html control attributes collection contains:</h4>";
                      >>>>>>>>>>>>>>I Enumerator keys = Myid.Attributes .Keys.GetEnumer ator();
                      >>>>>>>>>>>>>>w hile (keys.MoveNext( ))
                      >>>>>>>>>>>>> >{
                      >>>>>>>>>>>>>>S tring key = (String)keys.Cu rrent;
                      >>>>>>>>>>>>>>M essage.InnerHtm l += key + "=" + Myid.Attributes[key] + "<br />";
                      >>>>>>>>>>>>> >}
                      >>>>>>>>>>>>> >}
                      >>>>>>>>>>>>> ></script>
                      >>>>>>>>>>>>>>< head id="Head1" runat="server">
                      >>>>>>>>>>>>>>< title>The html control attributes collection</title>
                      >>>>>>>>>>>>> ></head>
                      >>>>>>>>>>>>>>< body>
                      >>>>>>>>>>>>>>< form id="Form1" runat="server">
                      >>>>>>>>>>>>>>< h3>HtmlControl Attribute Collection Example</h3>
                      >>>>>>>>>>>>>>< br />
                      >>>>>>>>>>>>>>< span id="Message" enableviewstate ="false" runat="server" />
                      >>>>>>>>>>>>> ></form>
                      >>>>>>>>>>>>> ></body>
                      >>>>>>>>>>>>> ></html>
                      >>>>>>>>>>>>> >----------------
                      >>>>>>>>>>>>> >>
                      >>>>>>>>>>>>> >I don't think it's a bug to have to add an attribute programmaticall y,
                      >>>>>>>>>>>>>>b ecause the runat="server" tag only *declares* the html control as a programmable control.
                      >>>>>>>>>>>>> >>
                      >>>>>>>>>>>>>>T o actually program it, you must use a script.
                      >>>>>>>>>>>>> >>
                      >>>>>>>>>>>>> >>
                      >>>>>>>>>>>>> >>
                      >>>>>>>>>>>>> >>
                      >>>>>>>>>>>>>>J uan T. Llibre, asp.net MVP
                      >>>>>>>>>>>>>>a sp.net faq : http://asp.net.do/faq/
                      >>>>>>>>>>>>>>f oros de asp.net, en español : http://asp.net.do/foros/
                      >>>>>>>>>>>>>>= =============== =============== =======
                      >>>>>>>>>>>>>>" Lee C." <no.spam@spamme r.comwrote in message news:e0rLaPG2IH A.4772@TK2MSFTN GP03.phx.gbl...
                      >>>>>>>>>>>>>>> Thanks, Juan.
                      >>>>>>>>>>>>>>> >
                      >>>>>>>>>>>>>>> I already added similar code to a page event in my masterpage code-beside.
                      >>>>>>>>>>>>>>> >
                      >>>>>>>>>>>>> >> elHtml.Attribut es.Add("xml:lan g", Resources.Globa lLang.ContentAu dienceLanguage)
                      >>>>>>>>>>>>>>> >
                      >>>>>>>>>>>>>>> To me, that is a temporary workaround. I still want to understand whether the "eating" of the
                      >>>>>>>>>>>>>>> attribute I
                      >>>>>>>>>>>>>>> originally
                      >>>>>>>>>>>>>>> posted about is a bug, or if this is actually happening for a reason.
                      >>>>>>>>>>>>>>> >
                      >>>>>>>>>>>>>>> Cordially,
                      >>>>>>>>>>>>>>> Lee
                      >>>>>>>>>>>>>>> >
                      >>>>>>>>>>>>>>> >
                      >>>>>>>>>>>>>>> "Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message
                      >>>>>>>>>>>>>>> news:%23gBUqSC2 IHA.4772@TK2MSF TNGP03.phx.gbl. ..
                      >>>>>>>>>>>>>>> >Hi, Lee.
                      >>>>>>>>>>>>>>> >>
                      >>>>>>>>>>>>>>> >re:
                      >>>>>>>>>>>>>>> >!<html runat="server" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US" dir="ltr">
                      >>>>>>>>>>>>>>> >!no xml:lang attribute is rendered to the browser!
                      >>>>>>>>>>>>>>> >!Remove the runat="server", and, voila, the xml:lang attribute is rendered.
                      >>>>>>>>>>>>>>> >>
                      >>>>>>>>>>>>>>> >Try this :
                      >>>>>>>>>>>>>>> >>
                      >>>>>>>>>>>>>>> ><html xmlns="http://www.w3.org/1999/xhtml" runat="server" id="someID">
                      >>>>>>>>>>>>>>> >>
                      >>>>>>>>>>>>>>> ><script runat="server">
                      >>>>>>>>>>>>>>> >someID.Attribu tes("xml:lang") = "en-US"
                      >>>>>>>>>>>>>>> ></script>
                      >>>>>>>>>>>>>>> >>
                      >>>>>>>>>>>>>>> >>
                      >>>>>>>>>>>>>>> >>
                      >>>>>>>>>>>>>>> >Juan T. Llibre, asp.net MVP
                      >>>>>>>>>>>>>>> >asp.net faq : http://asp.net.do/faq/
                      >>>>>>>>>>>>>>> >foros de asp.net, en español : http://asp.net.do/foros/
                      >>>>>>>>>>>>>>> >============== =============== =========
                      >>>>>>>>>>>>>>> >>
                      >>>>>>>>>>>>>>> >"Lee C." <nomail@spam.co mwrote in message news:O%23KsAQA2 IHA.4572@TK2MSF TNGP03.phx.gbl. ..
                      >>>>>>>>>>>>>>> >>>I think I have discovered a bug in ASP.NET, related to I18N.
                      >>>>>>>>>>>>>>> >>>
                      >>>>>>>>>>>>>>> >>In ASP.NET 3.5 I have to set runat="server" on the html element to use explicit expressions. It
                      >>>>>>>>>>>>>>> >>appears that
                      >>>>>>>>>>>>>>> >>ASP.NET
                      >>>>>>>>>>>>>>> >>eats the xml:lang attribute on the html element when it is set to runat="server".
                      >>>>>>>>>>>>>>> >>>
                      >>>>>>>>>>>>>>> >>Of course I want to replace the hardcoded "en-US" values with (resource) explicit expressions; but,
                      >>>>>>>>>>>>>>> >>for simplicity, try this:
                      >>>>>>>>>>>>>>> >>>
                      >>>>>>>>>>>>>>> >><html runat="server" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US" dir="ltr">
                      >>>>>>>>>>>>>>> >>>
                      >>>>>>>>>>>>>>> >>...And you will find that no xml:lang attribute is rendered to the browser! Remove the
                      >>>>>>>>>>>>>>> >>runat="server ", and,
                      >>>>>>>>>>>>>>> >>voila, the xml:lang attribute is rendered. :[
                      >>>>>>>>>>>>>>> >>>
                      >>>>>>>>>>>>>>> >>...Any ideas?
                      >>>>>>>>>>>>>>> >>>
                      >>>>>>>>>>>>>>> >>Cordially,
                      >>>>>>>>>>>>>>> >>Lee
                      >>
                      >>
                      >
                      >

                      Comment

                      • Lee C.

                        #12
                        Re: ASP.NET Internationaliz ation bug?

                        Okay, I've seen enough. You just do *not* get it. I won't waste another
                        keystroke.

                        "Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message
                        news:O2zcFlk2IH A.3884@TK2MSFTN GP05.phx.gbl...
                        re:
                        !I'm the one following modern best-practices (separating content from
                        code)
                        >
                        Sorry. Inline code is just as good a best-practice as code-behind.
                        >
                        re:
                        !At this point, I have no interest in your ASP.NET co-authoring.
                        >
                        Ooh, nasty. I hope you feel better now that you got that zinger off.
                        Let's see what Microsoft's VS bug team says about the bug you filed, OK ?
                        >
                        >
                        >
                        >
                        Juan T. Llibre, asp.net MVP
                        asp.net faq : http://asp.net.do/faq/
                        foros de asp.net, en español : http://asp.net.do/foros/
                        =============== =============== ========
                        "Lee C." <nomail@spam.co mwrote in message
                        news:%23A3ULgk2 IHA.4852@TK2MSF TNGP05.phx.gbl. ..
                        >You say you understand, but you make statements that demonstrate
                        >otherwise. You've been arguing against my "what" and "why" all along;
                        >yet, I'm the one following modern best-practices (separating content from
                        >code)--which are required for my scenario. If someone chooses to mix
                        >them, that's their choice; but, it does not change the bug into a
                        >feature--regardless of your position that it does.
                        >>
                        >At this point, I have no interest in your ASP.NET co-authoring.
                        >>
                        >Cordially,
                        >Lee
                        >>
                        >"Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message
                        >news:uJAnnYi2I HA.3600@TK2MSFT NGP04.phx.gbl.. .
                        >>re:
                        >>!You clearly don't understand
                        >>>
                        >>That "clearly" is doubted by me.
                        >>>
                        >>How many times have I told you that I *do* understand what you're saying
                        >>but that I'd like to see the bug response team's reply to your "bug
                        >>report" ?
                        >>>
                        >>How many times will you repeat that I "don't understand", when I do,
                        >>although I disagree with the premises you're putting forth ?
                        >>>
                        >>re:
                        >>!Are you really an ASP.NET MVP? (Classic ASP, maybe?)
                        >>>
                        >>The answer to that question is in my signature.
                        >>Maybe you haven't read any of the ASP.NET books I've co-authored ?
                        >>>
                        >>Good luck with the response to your bug report.
                        >>Please remember to post the result here.
                        >>>
                        >>>
                        >>>
                        >>>
                        >>Juan T. Llibre, asp.net MVP
                        >>asp.net faq : http://asp.net.do/faq/
                        >>foros de asp.net, en español : http://asp.net.do/foros/
                        >>============= =============== ==========
                        >>"Lee C." <nomail@spam.co mwrote in message
                        >>news:eE3jN2g2 IHA.4572@TK2MSF TNGP03.phx.gbl. ..
                        >>>Juan,
                        >>>>
                        >>>You clearly don't understand, or have not thought about *why* the
                        >>>ASP.NET team gave us separate places for "design"/content (.aspx files)
                        >>>and "procedure"/code (.aspx.vb). The ability to separate the 2 was a
                        >>>huge feature for ASP.NET, from classic ASP.
                        >>>>
                        >>>Even though the particular content affected by the bug I found is not
                        >>>*visible* Web browser content, it is content none-the-less. Thus, its
                        >>>wiring belongs in the content file (.aspx)--not the code file
                        >>>(.aspx.vb) . Sure, I could throw in some classic ASP style, and put a
                        >>>script element in my .aspx page to keep the wiring in the realm of the
                        >>>designer, but that changes nothing, because it's still programming,
                        >>>which should be done by programmers in the same place as every other
                        >>>line of programming in my site: the .aspx.vb pages. Just as badly, it
                        >>>means I'm achieving my I18N wiring in multiple ways, instead of being
                        >>>consistent .
                        >>>>
                        >>>By everything else, I meant all other I18N resource "wirings". (But, I
                        >>>take pride in how "light" my .aspx.vb files are--and how clean my .aspx
                        >>>files are, too.) You are obviously fine with having the designer(s) to
                        >>>set up and manage *most* of the I18N wirings, *and* having programmers
                        >>>to do some, too, (as they should not be doing) since bugs are not bugs
                        >>>for you if there is a workaround that violates good design practices
                        >>>and principles. I'm not fine with that.
                        >>>>
                        >>>Are you really an ASP.NET MVP? (Classic ASP, maybe?)
                        >>>>
                        >>>, Lee
                        >>>>
                        >>>>
                        >>>"Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message
                        >>>news:urCttna 2IHA.4476@TK2MS FTNGP06.phx.gbl ...
                        >>>>re:
                        >>>>!Setting it programmaticall y is an incorrect implementation
                        >>>>!when everything else on my page is set declaratively.
                        >>>>>
                        >>>>Is everything else on your pages set declaratively ?
                        >>>>Think about that for a second.
                        >>>>>
                        >>>>Why do we have inline scripts and code-behind, if "everything else is
                        >>>>set declaratively" ?
                        >>>>>
                        >>>>In any case, we've certainly had enough of the "I think that..." back
                        >>>>and forth.
                        >>>>>
                        >>>>Let's pause this discussion until the "bug" you reported is explained
                        >>>>by the VS Dev team, OK ?
                        >>>>I, definitely, want to see what their explanation is.
                        >>>>>
                        >>>>https://connect.microsoft.com/Visual...dbackID=353879
                        >>>>>
                        >>>>>
                        >>>>>
                        >>>>Juan T. Llibre, asp.net MVP
                        >>>>asp.net faq : http://asp.net.do/faq/
                        >>>>foros de asp.net, en español : http://asp.net.do/foros/
                        >>>>=========== =============== ============
                        >>>>"Lee C." <nomail@spam.co mwrote in message
                        >>>>news:eQlpa4 W2IHA.4704@TK2M SFTNGP05.phx.gb l...
                        >>>>>Correct implementation? What do you mean by that?
                        >>>>>>
                        >>>>>I stated earlier on that I worked around it. It's still a bug.
                        >>>>>Setting it programmaticall y is an incorrect implementation when
                        >>>>>everythi ng else on my page is set declaratively. Microsoft offered
                        >>>>>declarativ e (explicit) expressions, and I want to use them--anywhere
                        >>>>>and everywhere I choose in accordance with how they are stated to
                        >>>>>work. When I find one that doesn't work, it's a bug; it's not a case
                        >>>>>of my doing something incorrectly. I love Microsoft Visual Studio
                        >>>>>2008; but, I won't tolerate bugs, or suck them up as, "Oh, I must be
                        >>>>>doing it wrong since it doesn't work--even though it should."
                        >>>>>>
                        >>>>>, Lee
                        >>>>>>
                        >>>>>"Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message
                        >>>>>news:%23xh BpuW2IHA.2384@T K2MSFTNGP04.phx .gbl...
                        >>>>>>re:
                        >>>>>>!ASP.NE T should make it easy for me--and, it does,
                        >>>>>>!but there is a bug in the implementation.
                        >>>>>>>
                        >>>>>>The fact that you *can* set xml:lang programmaticall y, and that you
                        >>>>>>*did* set it that way,
                        >>>>>>as I did, should tell you that it isn't much of a bug, but a
                        >>>>>>questio n of using the correct implementation.
                        >>>>>>>
                        >>>>>>But, again, please let us know what the reply to your bug report is.
                        >>>>>>>
                        >>>>>>>
                        >>>>>>>
                        >>>>>>Juan T. Llibre, asp.net MVP
                        >>>>>>asp.net faq : http://asp.net.do/faq/
                        >>>>>>foros de asp.net, en español : http://asp.net.do/foros/
                        >>>>>>========= =============== ==============
                        >>>>>>"Lee C." <nomail@spam.co mwrote in message
                        >>>>>>news:%239 PIQvU2IHA.2384@ TK2MSFTNGP04.ph x.gbl...
                        >>>>>>>Juan,
                        >>>>>>>>
                        >>>>>>>My use of language and culture in ASP.Net is a bit different than
                        >>>>>>>most. I have registered numerous country-code-specific domains
                        >>>>>>>(mysite. ca, mysite.co.uk, mysite.com.au, etc.), which resolve to a
                        >>>>>>>singul ar "ASP.Net Web Site". Nothing new there. However, I'm not
                        >>>>>>>doing the ASP.Net usual of letting the user agent (HTTP header
                        >>>>>>>'accep t-language') determine which language visitors get; I have
                        >>>>>>>the country-code TLD drive it. Also, it's not just the language of
                        >>>>>>>my content that varies by cc TLD, it's the content, too; but, lang
                        >>>>>>>attribut es play a critical role in informing user agents (including
                        >>>>>>>search engine bots) for what "country" my content is aimed.
                        >>>>>>>>
                        >>>>>>>I have already found, first-hand, that the better of the major
                        >>>>>>>search engines use the cc TLD *and* the HTML lang/xml:lang to
                        >>>>>>>determin e whether a domain's documents
                        >>>>>>>(mysite. com.au/my-document.aspx) should show up when a searcher
                        >>>>>>>search es with the 'Only from Australia' checkbox checked on
                        >>>>>>>Live.com , for example.
                        >>>>>>>>
                        >>>>>>>I'm not setting lang attributes for fun; I'm doing it to correct
                        >>>>>>>search engine results. ASP.NET should make it easy for me--and, it
                        >>>>>>>does, but there is a bug in the implementation.
                        >>>>>>>>
                        >>>>>>>I appreciate your interest and effort to help.
                        >>>>>>>>
                        >>>>>>>, Lee
                        >>>>>>>>
                        >>>>>>>>
                        >>>>>>>"Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message
                        >>>>>>>news:uBU nQxT2IHA.4164@T K2MSFTNGP03.phx .gbl...
                        >>>>>>>>re:
                        >>>>>>>>!vers us the spirit of what we're trying to accomplish: telling
                        >>>>>>>>user agents who our
                        >>>>>>>>!intend ed audiences is, by language, as best we can...which is
                        >>>>>>>>why I'm *also*
                        >>>>>>>>!settin g lang in the HTTP headers and in page meta tags
                        >>>>>>>>>
                        >>>>>>>>What ? You don't set a language/culture in web.config, too ?
                        >>>>>>>>There 's a use for overkill ! ( only kidding... )
                        >>>>>>>>>
                        >>>>>>>>I don't see too clearly the purpose of declaring a single language
                        >>>>>>>>for a web page.
                        >>>>>>>>>
                        >>>>>>>>I do see a use for declaring specific language attributes in a
                        >>>>>>>>*collec tion* of xml documents,
                        >>>>>>>>so that individual documents can be parsed for a particular
                        >>>>>>>>languag e content.
                        >>>>>>>>>
                        >>>>>>>>But, ymmv...
                        >>>>>>>>>
                        >>>>>>>>I'd still be interested in knowing what the reply is to your bug
                        >>>>>>>>repor t.
                        >>>>>>>>I bet you'll get back : "That's by design". <g>
                        >>>>>>>>>
                        >>>>>>>>Don't forget to let us all know what happens with that, OK ?
                        >>>>>>>>Thank s for an interesting discussion.
                        >>>>>>>>>
                        >>>>>>>>>
                        >>>>>>>>>
                        >>>>>>>>>
                        >>>>>>>>Juan T. Llibre, asp.net MVP
                        >>>>>>>>asp.n et faq : http://asp.net.do/faq/
                        >>>>>>>>foros de asp.net, en español : http://asp.net.do/foros/
                        >>>>>>>>======= =============== =============== =
                        >>>>>>>>"Lee C." <nomail@spam.co mwrote in message
                        >>>>>>>>news:en 1PZVT2IHA.524@T K2MSFTNGP05.phx .gbl...
                        >>>>>>>>>Juan ,
                        >>>>>>>>>>
                        >>>>>>>>>In theory, I like your idea of investigating "the standard"; but,
                        >>>>>>>>>in practice it has serious problems, as it often does. First,
                        >>>>>>>>>you are referring to the XML standard, which is not as
                        >>>>>>>>>approp riate as HTML and XHTML standards. Second, none of them are
                        >>>>>>>>>crysta l clear on best practices for I18N. There is a lot of
                        >>>>>>>>>*legal * (by the standard) syntax, that makes no sense, or makes
                        >>>>>>>>>some sense without being clearly best. The W3C site often states
                        >>>>>>>>>someth ing to the effect of, "some are doing this, some are doing
                        >>>>>>>>>that , on your own site, at least do something and only time will
                        >>>>>>>>>tell what is best."
                        >>>>>>>>>>
                        >>>>>>>>>Chec k out these fine examples, which mirror my syntax, on the W3C
                        >>>>>>>>>site .
                        >>>>>>>>>>
                        >>>>>>>>>Intern ationalization Best Practices: Specifying Language in XHTML
                        >>>>>>>>>& HTML Content
                        >>>>>>>>>http://www.w3.org/TR/i18n-html-tech-...0429.092928424
                        >>>>>>>>>>
                        >>>>>>>>>>
                        >>>>>>>>>Tutori al: Declaring Language in XHTML and HTML (Draft)
                        >>>>>>>>>http://www.w3.org/International/tuto...Slide0160.html
                        >>>>>>>>>>
                        >>>>>>>>>Juan , you wrote:
                        >>>>>>>>>>But , it seems to me that setting xml:lang for the html tag's
                        >>>>>>>>>>*attr ibute* values is unneeded, since they must
                        >>>>>>>>>>be in English, and they must be attributes set to a language
                        >>>>>>>>>>ident ifier, as defined by IETF RFC 4646
                        >>>>>>>>>>(http://www.ietf.org/rfc/rfc4646.txt).
                        >>>>>>>>>>
                        >>>>>>>>>You' re not setting it for "the tag's *attribute*", you're setting
                        >>>>>>>>>it for the *contents*, all contents, of the element (unless
                        >>>>>>>>>overri dden by a sub-setting), which makes perfect sense so that I
                        >>>>>>>>>don' t have to set it individually on every child element--that is
                        >>>>>>>>>the power of a hierarchy! You seem to be focused on the
                        >>>>>>>>>techni cal, with some misunderstandin g, versus the spirit of what
                        >>>>>>>>>we'r e trying to accomplish: telling user agents who our intended
                        >>>>>>>>>audien ces is, by language, as best we can...which is why I'm
                        >>>>>>>>>*als o* setting lang in the HTTP headers and in page meta tags.
                        >>>>>>>>>>
                        >>>>>>>>>, Lee
                        >>>>>>>>>>
                        >>>>>>>>>>
                        >>>>>>>>>"Jua n T. Llibre" <nomailreplies@ nowhere.comwrot e in message
                        >>>>>>>>>news:O YI4upK2IHA.5140 @TK2MSFTNGP02.p hx.gbl...
                        >>>>>>>>>>re:
                        >>>>>>>>>>!I found an MSDN document that explains why what I'm trying to
                        >>>>>>>>>>do should work
                        >>>>>>>>>>>
                        >>>>>>>>>>Lee ,
                        >>>>>>>>>>>
                        >>>>>>>>>>Fro m :
                        >>>>>>>>>>>
                        >>>>>>>>>>http://www.w3.org/TR/REC-xml/
                        >>>>>>>>>>>
                        >>>>>>>>>>"A special attribute named xml:lang may be inserted in documents
                        >>>>>>>>>>to specify the
                        >>>>>>>>>>langu age used in the contents and attribute values of any
                        >>>>>>>>>>eleme nt in an XML document."
                        >>>>>>>>>>>
                        >>>>>>>>>>If anything, I can see xml:lang being declared for specific
                        >>>>>>>>>>conte nt values, for example :
                        >>>>>>>>>>>
                        >>>>>>>>>><p xml:lang="en-GB">What colour is it?</p>
                        >>>>>>>>>><p xml:lang="en-US">What color is it?</p>
                        >>>>>>>>>>>
                        >>>>>>>>>>The n, an xml parser could identify regional US and British
                        >>>>>>>>>>spell ings but, given that *all* the attribute values
                        >>>>>>>>>>mus t be in English in an html doc, what would be the purpose of
                        >>>>>>>>>>decla ring xml:lang for the html markup ?
                        >>>>>>>>>>>
                        >>>>>>>>>>A similar explanation is given here :
                        >>>>>>>>>>http://www.simonstl.com/xmlprim/xmlupdate/atts.html
                        >>>>>>>>>>>
                        >>>>>>>>>>---000---
                        >>>>>>>>>><SECT ION>
                        >>>>>>>>>><DESC RIPTION xml:lang="en">
                        >>>>>>>>>>Caesa r begins by describing the geography of Gaul.
                        >>>>>>>>>></DESCRIPTION>
                        >>>>>>>>>><QUOT E xml:lang="la">
                        >>>>>>>>>>Galli a est omnis divisa in partes tres, quarum unam incolunt
                        >>>>>>>>>>Belga e,
                        >>>>>>>>>>ali am Aquitani, tertiam qui ipsorum lingua Celtae, nostra Galli
                        >>>>>>>>>>appel lantur.
                        >>>>>>>>>></QUOTE>
                        >>>>>>>>>>---000---
                        >>>>>>>>>>>
                        >>>>>>>>>>That' s perfectly good usage for xml:lang, as a parser could
                        >>>>>>>>>>selec tively identify content in different languages.
                        >>>>>>>>>>>
                        >>>>>>>>>>But , it seems to me that setting xml:lang for the html tag's
                        >>>>>>>>>>*attr ibute* values is unneeded, since they must
                        >>>>>>>>>>be in English, and they must be attributes set to a language
                        >>>>>>>>>>ident ifier, as defined by IETF RFC 4646
                        >>>>>>>>>>(http://www.ietf.org/rfc/rfc4646.txt).
                        >>>>>>>>>>>
                        >>>>>>>>>>So, I think that requisite pretty well establishes the futility
                        >>>>>>>>>>of setting xml:lang for all the attributes in an html document.
                        >>>>>>>>>>>
                        >>>>>>>>>>If anything, it seems that the xml:lang attribute is included in
                        >>>>>>>>>>the
                        >>>>>>>>>>htm l server tag for compatibility purposes, or perhaps out of
                        >>>>>>>>>>ignor ance.
                        >>>>>>>>>>>
                        >>>>>>>>>>If there's a need to identify that the *contents* of a
                        >>>>>>>>>>parti cular markup tag are in a
                        >>>>>>>>>>speci fic language, that identification can be included in the
                        >>>>>>>>>>tag itself, for example :
                        >>>>>>>>>>>
                        >>>>>>>>>><di v lang="MX-es" xml:lang="MX-es">
                        >>>>>>>>>>Alg o de contenido en español mejicano.
                        >>>>>>>>>></div>
                        >>>>>>>>>>>
                        >>>>>>>>>>Tha t makes a lot more sense than setting xml:lang for the
                        >>>>>>>>>>attri bute values in the html tag.
                        >>>>>>>>>>>
                        >>>>>>>>>>>
                        >>>>>>>>>>>
                        >>>>>>>>>>Jua n T. Llibre, asp.net MVP
                        >>>>>>>>>>asp.n et faq : http://asp.net.do/faq/
                        >>>>>>>>>>for os de asp.net, en español : http://asp.net.do/foros/
                        >>>>>>>>>>===== =============== =============== ===
                        >>>>>>>>>>"Le e C." <no.spam@spamme r.comwrote in message
                        >>>>>>>>>>news: %23ocUnoI2IHA.2 188@TK2MSFTNGP0 4.phx.gbl...
                        >>>>>>>>>>>>I found an MSDN document that explains why what I'm trying to do
                        >>>>>>>>>>>>sho uld work.
                        >>>>>>>>>>>>
                        >>>>>>>>>>>ASP. NET Web Server Controls Overview
                        >>>>>>>>>>>http://msdn.microsoft.com/en-us/library/zsyt68f1.aspx
                        >>>>>>>>>>>>
                        >>>>>>>>>>>No te the distinction between HTML Server Controls and Web
                        >>>>>>>>>>>Serv er Controls in the document. Also, note the explanation
                        >>>>>>>>>>>of "pass-through" attributes for HTML Server Controls.
                        >>>>>>>>>>>>
                        >>>>>>>>>>>Tw o quotes that sum it up:
                        >>>>>>>>>>> 1. Any HTML element on a page can be converted to an HTML
                        >>>>>>>>>>>serv er control by adding the attribute runat="server".
                        >>>>>>>>>>> 2. You can add any attributes you need to an HTML server
                        >>>>>>>>>>>cont rol and the page framework will render them without
                        >>>>>>>>>>>an y change in functionality.
                        >>>>>>>>>>>>
                        >>>>>>>>>>>, Lee
                        >>>>>>>>>>>>
                        >>>>>>>>>>>"L ee C." <no.spam@spamme r.comwrote in message
                        >>>>>>>>>>>news :Oe38JYI2IHA.47 72@TK2MSFTNGP03 .phx.gbl...
                        >>>>>>>>>>>>Jua n,
                        >>>>>>>>>>>>>
                        >>>>>>>>>>>>I appreciate your trying to help, but you're wrong, and you
                        >>>>>>>>>>>>a re the one who is confused. :]
                        >>>>>>>>>>>>>
                        >>>>>>>>>>>>I am *not* disputing that when inserted programmaticall y, the
                        >>>>>>>>>>>>xml :lang attribute renders to the browser. I did just
                        >>>>>>>>>>>>tha t as a work around (right after I discovered this bug);
                        >>>>>>>>>>>>but , I should not have to.
                        >>>>>>>>>>>>>
                        >>>>>>>>>>>>I am *not* confusing html attributes with runat="server"
                        >>>>>>>>>>>>att ributes, as you call them. Using your logic, none of the
                        >>>>>>>>>>>>dec larative (html) attributes should render to the browser
                        >>>>>>>>>>>>aft er I add the runat="server" in ASP.NET; yet all of them
                        >>>>>>>>>>>>(xm lns, lang, and dir) do--except xml:lang.
                        >>>>>>>>>>>>>
                        >>>>>>>>>>>>I started with an html element with 4 attributes (xmlns, lang,
                        >>>>>>>>>>>>xml :lang, and dir) all set declaratively. With *no*
                        >>>>>>>>>>>>5 th attribute of runat="server", all 4 attributes render. If
                        >>>>>>>>>>>>I add the 5th attribute of runat="server", which does
                        >>>>>>>>>>>>n ot and should not render, I no longer get all 4 attributes
                        >>>>>>>>>>>>tha t should render (xmlns, lang, xml:lang, and dir), I
                        >>>>>>>>>>>>onl y get 3 (xmlns, lang, and dir). My logic says I should get
                        >>>>>>>>>>>>4 , your says I should get 3? It would be 4 or 0, and
                        >>>>>>>>>>>>4 is right. Not 0...and not 3.
                        >>>>>>>>>>>>>
                        >>>>>>>>>>>>Whe n I add runat="server", it does not magically make the
                        >>>>>>>>>>>>xml :lang attribute a server-side attribute, while keeping
                        >>>>>>>>>>>>t he other three attributes as "html" attributes. All four are
                        >>>>>>>>>>>>sti ll "html" attributes--which should render.
                        >>>>>>>>>>>>>
                        >>>>>>>>>>>>I think the simplification of my example may be confusing you.
                        >>>>>>>>>>>>I t is odd that, in my example, I set runat="server"
                        >>>>>>>>>>>>b ut do not have any server-side attributes. (I have all 4 as
                        >>>>>>>>>>>>lit eral strings, for simplicity of an example.) Well,
                        >>>>>>>>>>>>i n my real-world use, I do have server-side attributes, which
                        >>>>>>>>>>>>I want set declaratively (no code-beside and no
                        >>>>>>>>>>>>scr ipt). I have:
                        >>>>>>>>>>>>>
                        >>>>>>>>>>>><ht ml runat="server" xmlns="http://www.w3.org/1999/xhtml"
                        >>>>>>>>>>>> xml:lang="<%$ Resources:Globa lLang, ContentAudience Language
                        >>>>>>>>>>>>% >"
                        >>>>>>>>>>>> lang="<%$ Resources:Globa lLang, ContentAudience Language %>"
                        >>>>>>>>>>>> dir="ltr">
                        >>>>>>>>>>>>>
                        >>>>>>>>>>>>Bot h of those declarative explicit localization expressions
                        >>>>>>>>>>>>sho uld work without my having to write any more
                        >>>>>>>>>>>>"pr ocedural" (code-beside) code or script. It actually does
                        >>>>>>>>>>>>wor k fine for the lang attribute--as it should; but not
                        >>>>>>>>>>>>f or the xml:lang attribute--***which is a bug***.
                        >>>>>>>>>>>>>
                        >>>>>>>>>>>>, Lee
                        >>>>>>>>>>>>>
                        >>>>>>>>>>>>"Ju an T. Llibre" <nomailreplies@ nowhere.comwrot e in message
                        >>>>>>>>>>>>new s:u0WzB9H2IHA.4 188@TK2MSFTNGP0 4.phx.gbl...
                        >>>>>>>>>>>>>re :
                        >>>>>>>>>>>>> !I think you are misunderstandin g, Juan.
                        >>>>>>>>>>>>> >
                        >>>>>>>>>>>>>We ll, I think you are misunderstandin g *me*.
                        >>>>>>>>>>>>> >
                        >>>>>>>>>>>>>re :
                        >>>>>>>>>>>>> !I had the xml:lang attribute in the html tag
                        >>>>>>>>>>>>>(d eclaratively), like this:
                        >>>>>>>>>>>>>>. ..and it renders to the browser, as it should.
                        >>>>>>>>>>>>> >
                        >>>>>>>>>>>>>Ye s, because it's standard html.
                        >>>>>>>>>>>>> >
                        >>>>>>>>>>>>>re :
                        >>>>>>>>>>>>>!I f I simply add runat="server"
                        >>>>>>>>>>>>> >
                        >>>>>>>>>>>>>Th at declares the control to run server side.
                        >>>>>>>>>>>>> >
                        >>>>>>>>>>>>>Fo r any attribute to be programmed server-side you need a
                        >>>>>>>>>>>>>sc ript,
                        >>>>>>>>>>>>>ju st as you need a script to modify any server control's
                        >>>>>>>>>>>>>at tributes.
                        >>>>>>>>>>>>> >
                        >>>>>>>>>>>>>Di d you run the sample page I sent ?
                        >>>>>>>>>>>>> >
                        >>>>>>>>>>>>> It iterates throught the attributes for the html server
                        >>>>>>>>>>>>>co ntrol,
                        >>>>>>>>>>>>>an d shows that the xml:lang attribute *is* added
                        >>>>>>>>>>>>>pr ogrammatically.
                        >>>>>>>>>>>>> >
                        >>>>>>>>>>>>>re :
                        >>>>>>>>>>>>>!I f I simply add runat="server", leaving in the xml:lang
                        >>>>>>>>>>>>>at tribute that
                        >>>>>>>>>>>>>!r enders without runat="server", all of the (declarative)
                        >>>>>>>>>>>>>at tributes are
                        >>>>>>>>>>>>>!r endered to the browser--except the xml:lang attribute!
                        >>>>>>>>>>>>>Th at is a bug.
                        >>>>>>>>>>>>> >
                        >>>>>>>>>>>>> I think you're confusing html attributes with runat="server"
                        >>>>>>>>>>>>>at tributes.
                        >>>>>>>>>>>>> >
                        >>>>>>>>>>>>>Ht ml attributes can be inserted in normal html.
                        >>>>>>>>>>>>>Se rver-side attributes must be inserted in code.
                        >>>>>>>>>>>>> >
                        >>>>>>>>>>>>>Ma ybe I'm not explaining this as well as I should.
                        >>>>>>>>>>>>>Tr y to get someone else's opinion on this matter, if you
                        >>>>>>>>>>>>>do n't accept mine.
                        >>>>>>>>>>>>> >
                        >>>>>>>>>>>>> >
                        >>>>>>>>>>>>> >
                        >>>>>>>>>>>>>Ju an T. Llibre, asp.net MVP
                        >>>>>>>>>>>>>as p.net faq : http://asp.net.do/faq/
                        >>>>>>>>>>>>>fo ros de asp.net, en español : http://asp.net.do/foros/
                        >>>>>>>>>>>>>== =============== =============== ======
                        >>>>>>>>>>>>>"L ee C." <no.spam@spamme r.comwrote in message
                        >>>>>>>>>>>>>ne ws:enam1gH2IHA. 4552@TK2MSFTNGP 04.phx.gbl...
                        >>>>>>>>>>>>>>> I think you are misunderstandin g, Juan. I had the xml:lang
                        >>>>>>>>>>>>>>> attribute in the html tag (declaratively) , like this:
                        >>>>>>>>>>>>> >>
                        >>>>>>>>>>>>>>< html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"
                        >>>>>>>>>>>>>>l ang="en-US" dir="ltr">
                        >>>>>>>>>>>>> >>
                        >>>>>>>>>>>>>>. ..and it renders to the browser, as it should.
                        >>>>>>>>>>>>> >>
                        >>>>>>>>>>>>>>I f I simply add runat="server", leaving in the xml:lang
                        >>>>>>>>>>>>>>a ttribute that renders without runat="server", all of the
                        >>>>>>>>>>>>>>( declarative) attributes are rendered to the browser--except
                        >>>>>>>>>>>>>>t he xml:lang attribute! That is a bug.
                        >>>>>>>>>>>>> >>
                        >>>>>>>>>>>>>>< html runat="server" xmlns="http://www.w3.org/1999/xhtml"
                        >>>>>>>>>>>>>>x ml:lang="en-US" lang="en-US" dir="ltr">
                        >>>>>>>>>>>>> >>
                        >>>>>>>>>>>>>>C ordially,
                        >>>>>>>>>>>>>>L ee
                        >>>>>>>>>>>>> >>
                        >>>>>>>>>>>>> >>
                        >>>>>>>>>>>>>>" Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in
                        >>>>>>>>>>>>>>m essage news:eyrwjUH2IH A.3920@TK2MSFTN GP02.phx.gbl...
                        >>>>>>>>>>>>>>> Here's a full example which shows that the xml:lang
                        >>>>>>>>>>>>>>> attribute is added programmaticall y :
                        >>>>>>>>>>>>>>> >
                        >>>>>>>>>>>>>>> attributes.aspx :
                        >>>>>>>>>>>>> >>----------------------
                        >>>>>>>>>>>>>>> <%@ Page Language="C#" AutoEventWireup ="True" %>
                        >>>>>>>>>>>>>>> <html xmlns="http://www.w3.org/1999/xhtml" runat="server"
                        >>>>>>>>>>>>>>> id="Myid" >
                        >>>>>>>>>>>>>>> <script language="C#" runat="server">
                        >>>>>>>>>>>>>>> void Page_Load(Objec t sender, EventArgs e)
                        >>>>>>>>>>>>>>> {
                        >>>>>>>>>>>>>>> Myid.Attributes .Add("xml:lang" , "es");
                        >>>>>>>>>>>>>>> Message.InnerHt ml = "<h4>The html control attributes
                        >>>>>>>>>>>>>>> collection contains:</h4>";
                        >>>>>>>>>>>>>>> IEnumerator keys = Myid.Attributes .Keys.GetEnumer ator();
                        >>>>>>>>>>>>>>> while (keys.MoveNext( ))
                        >>>>>>>>>>>>>>> {
                        >>>>>>>>>>>>>>> String key = (String)keys.Cu rrent;
                        >>>>>>>>>>>>>>> Message.InnerHt ml += key + "=" + Myid.Attributes[key] +
                        >>>>>>>>>>>>>>> "<br />";
                        >>>>>>>>>>>>>>> }
                        >>>>>>>>>>>>>>> }
                        >>>>>>>>>>>>>>> </script>
                        >>>>>>>>>>>>>>> <head id="Head1" runat="server">
                        >>>>>>>>>>>>>>> <title>The html control attributes collection</title>
                        >>>>>>>>>>>>>>> </head>
                        >>>>>>>>>>>>>>> <body>
                        >>>>>>>>>>>>>>> <form id="Form1" runat="server">
                        >>>>>>>>>>>>>>> <h3>HtmlContr ol Attribute Collection Example</h3>
                        >>>>>>>>>>>>>>> <br />
                        >>>>>>>>>>>>>>> <span id="Message" enableviewstate ="false" runat="server"
                        >>>>>>>>>>>>> >>/>
                        >>>>>>>>>>>>>>> </form>
                        >>>>>>>>>>>>>>> </body>
                        >>>>>>>>>>>>>>> </html>
                        >>>>>>>>>>>>> >>----------------
                        >>>>>>>>>>>>>>> >
                        >>>>>>>>>>>>>>> I don't think it's a bug to have to add an attribute
                        >>>>>>>>>>>>>>> programmaticall y,
                        >>>>>>>>>>>>>>> because the runat="server" tag only *declares* the html
                        >>>>>>>>>>>>>>> control as a programmable control.
                        >>>>>>>>>>>>>>> >
                        >>>>>>>>>>>>>>> To actually program it, you must use a script.
                        >>>>>>>>>>>>>>> >
                        >>>>>>>>>>>>>>> >
                        >>>>>>>>>>>>>>> >
                        >>>>>>>>>>>>>>> >
                        >>>>>>>>>>>>>>> Juan T. Llibre, asp.net MVP
                        >>>>>>>>>>>>>>> asp.net faq : http://asp.net.do/faq/
                        >>>>>>>>>>>>>>> foros de asp.net, en español : http://asp.net.do/foros/
                        >>>>>>>>>>>>>>> =============== =============== ========
                        >>>>>>>>>>>>>>> "Lee C." <no.spam@spamme r.comwrote in message
                        >>>>>>>>>>>>>>> news:e0rLaPG2IH A.4772@TK2MSFTN GP03.phx.gbl...
                        >>>>>>>>>>>>>>> >Thanks, Juan.
                        >>>>>>>>>>>>>>> >>
                        >>>>>>>>>>>>>>> >I already added similar code to a page event in my
                        >>>>>>>>>>>>>>> >masterpage code-beside.
                        >>>>>>>>>>>>>>> >>
                        >>>>>>>>>>>>>>> > elHtml.Attribut es.Add("xml:lan g",
                        >>>>>>>>>>>>>>> >Resources.Glob alLang.ContentA udienceLanguage )
                        >>>>>>>>>>>>>>> >>
                        >>>>>>>>>>>>>>> >To me, that is a temporary workaround. I still want to
                        >>>>>>>>>>>>>>> >understand whether the "eating" of the attribute I
                        >>>>>>>>>>>>>>> >originally
                        >>>>>>>>>>>>>>> >posted about is a bug, or if this is actually happening
                        >>>>>>>>>>>>>>> >for a reason.
                        >>>>>>>>>>>>>>> >>
                        >>>>>>>>>>>>>>> >Cordially,
                        >>>>>>>>>>>>>>> >Lee
                        >>>>>>>>>>>>>>> >>
                        >>>>>>>>>>>>>>> >>
                        >>>>>>>>>>>>>>> >"Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in
                        >>>>>>>>>>>>>>> >message news:%23gBUqSC2 IHA.4772@TK2MSF TNGP03.phx.gbl. ..
                        >>>>>>>>>>>>>>> >>Hi, Lee.
                        >>>>>>>>>>>>>>> >>>
                        >>>>>>>>>>>>>>> >>re:
                        >>>>>>>>>>>>>>> >>!<html runat="server"
                        >>>>>>>>>>>>>>> >>xmlns="http ://www.w3.org/1999/xhtml" xml:lang="en-US"
                        >>>>>>>>>>>>>>> >>lang="en-US" dir="ltr">
                        >>>>>>>>>>>>>>> >>!no xml:lang attribute is rendered to the browser!
                        >>>>>>>>>>>>>>> >>!Remove the runat="server", and, voila, the xml:lang
                        >>>>>>>>>>>>>>> >>attribute is rendered.
                        >>>>>>>>>>>>>>> >>>
                        >>>>>>>>>>>>>>> >>Try this :
                        >>>>>>>>>>>>>>> >>>
                        >>>>>>>>>>>>>>> >><html xmlns="http://www.w3.org/1999/xhtml" runat="server"
                        >>>>>>>>>>>>>>> >>id="someID" >
                        >>>>>>>>>>>>>>> >>>
                        >>>>>>>>>>>>>>> >><script runat="server">
                        >>>>>>>>>>>>>>> >>someID.Attrib utes("xml:lang" ) = "en-US"
                        >>>>>>>>>>>>>>> >></script>
                        >>>>>>>>>>>>>>> >>>
                        >>>>>>>>>>>>>>> >>>
                        >>>>>>>>>>>>>>> >>>
                        >>>>>>>>>>>>>>> >>Juan T. Llibre, asp.net MVP
                        >>>>>>>>>>>>>>> >>asp.net faq : http://asp.net.do/faq/
                        >>>>>>>>>>>>>>> >>foros de asp.net, en español : http://asp.net.do/foros/
                        >>>>>>>>>>>>>>> >>============= =============== ==========
                        >>>>>>>>>>>>>>> >>>
                        >>>>>>>>>>>>>>> >>"Lee C." <nomail@spam.co mwrote in message
                        >>>>>>>>>>>>>>> >>news:O%23KsAQ A2IHA.4572@TK2M SFTNGP03.phx.gb l...
                        >>>>>>>>>>>>>>> >>>>I think I have discovered a bug in ASP.NET, related to
                        >>>>>>>>>>>>>>> >>>>I18N.
                        >>>>>>>>>>>>>>> >>>>
                        >>>>>>>>>>>>>>> >>>In ASP.NET 3.5 I have to set runat="server" on the html
                        >>>>>>>>>>>>>>> >>>element to use explicit expressions. It appears that
                        >>>>>>>>>>>>>>> >>>ASP.NET
                        >>>>>>>>>>>>>>> >>>eats the xml:lang attribute on the html element when it
                        >>>>>>>>>>>>>>> >>>is set to runat="server".
                        >>>>>>>>>>>>>>> >>>>
                        >>>>>>>>>>>>>>> >>>Of course I want to replace the hardcoded "en-US" values
                        >>>>>>>>>>>>>>> >>>with (resource) explicit expressions; but, for
                        >>>>>>>>>>>>>>> >>>simplicity , try this:
                        >>>>>>>>>>>>>>> >>>>
                        >>>>>>>>>>>>>>> >>><html runat="server"
                        >>>>>>>>>>>>>>> >>>xmlns="htt p://www.w3.org/1999/xhtml" xml:lang="en-US"
                        >>>>>>>>>>>>>>> >>>lang="en-US" dir="ltr">
                        >>>>>>>>>>>>>>> >>>>
                        >>>>>>>>>>>>>>> >>>...And you will find that no xml:lang attribute is
                        >>>>>>>>>>>>>>> >>>rendered to the browser! Remove the runat="server", and,
                        >>>>>>>>>>>>>>> >>>voila, the xml:lang attribute is rendered. :[
                        >>>>>>>>>>>>>>> >>>>
                        >>>>>>>>>>>>>>> >>>...Any ideas?
                        >>>>>>>>>>>>>>> >>>>
                        >>>>>>>>>>>>>>> >>>Cordially,
                        >>>>>>>>>>>>>>> >>>Lee
                        >>>
                        >>>
                        >>
                        >>
                        >
                        >

                        Comment

                        • John Rivers

                          #13
                          Re: ASP.NET Internationaliz ation bug?

                          Troll disguised as good samaritan



                          Comment

                          Working...