FAQ
Hi everybody,

I have a very serious problem according the ID allocation of MyFaces. MyFaces
generates IDs which contains ':' but this is invalid due to the W3C
XHTML-Standard. Most of you will appraise this as a "disfigurement" but the
situation becomes very serious if you need to integrade MathML-formulas in
your myfaces-web-app.

Because MathML need a "application/xhtml+xml" mime-type for the html-documents
which causes most browsers to validate the document against the dtd. Then the
browser recognize that this document is not a valid xhtml/xml-document
(because of invalid id's) and the document is not beeing showed in the
browser - instead the browser displays a "file is not a valid
xml-document"-message!

Is there a workaround to generate VALID ids with myfaces? Otherwise I'm not
able to integrate MathML-formulas in my myfaces-web-app which will make my
hole content-mangement-system unsuitable for the hole research center!

Greetings,
Hendrik

Search Discussions

  • Martin Marinschek at May 20, 2005 at 11:31 am
    Well, the id generation is standardized by the JSF-Spec.

    I have already wondered why they standardized the rendering of invalid
    ids, but it seems they did...

    Also the starting underscore seems to be invalid according to the
    XHTML spec - no way around that either, sorry.

    regards,

    Martin
    On 5/20/05, Hendrik Neumann wrote:
    Hi everybody,

    I have a very serious problem according the ID allocation of MyFaces. MyFaces
    generates IDs which contains ':' but this is invalid due to the W3C
    XHTML-Standard. Most of you will appraise this as a "disfigurement" but the
    situation becomes very serious if you need to integrade MathML-formulas in
    your myfaces-web-app.

    Because MathML need a "application/xhtml+xml" mime-type for the html-documents
    which causes most browsers to validate the document against the dtd. Then the
    browser recognize that this document is not a valid xhtml/xml-document
    (because of invalid id's) and the document is not beeing showed in the
    browser - instead the browser displays a "file is not a valid
    xml-document"-message!

    Is there a workaround to generate VALID ids with myfaces? Otherwise I'm not
    able to integrate MathML-formulas in my myfaces-web-app which will make my
    hole content-mangement-system unsuitable for the hole research center!

    Greetings,
    Hendrik
  • Hendrik Neumann at May 20, 2005 at 12:37 pm
    Martin,

    please tell me, that you're kidding! I simply can not believe that Sun
    Microsystems passes a spec which bashes offical web-standards! What is about
    MathML, SVG and so on: they need a valid XML-file to work, which JSF
    apparently is not creating. This simply means that all new and modern
    HTML-extensions which should be established with XHTML are not possible with
    JSF, because the spec defines invalid XML-documents which forces me as a
    developer to use HTML4 from 1999. And this means that the JSF-spec is only
    practical for dinky "Hello World"-web-apps without any forward-looking
    techniques...

    I simply can not believe this... JSF forces me to use outdated standards and
    techniques... this is simply harrowing!

    Isn't it possible to develop my own ID-Generators or such a thing? Or is it
    possible to tell the web-browsers that they shouldn't take care about wrong
    ids? Or a Java-Script which replaces the invalid IDs? I had already tried to
    set manually id-names which solves the problems for a few moments but after a
    few clicks on the pages, my own ids are extended in the invalid way with the
    ":" and "_"-characters and the web-browser refuses to show my pages. This
    small id-disfigurement makes JSF in fact unusable to me if there really isn't
    a workaround...

    Regards,
    Hendrik

    P.S: Of course this email IS NOT aimed against you MyFaces-guys - you have
    done a great work, thank you very much for this (nevervethless it seems that
    jsf was the wrong spec for my project)!
  • Martin Marinschek at May 20, 2005 at 1:04 pm
    Hi Hendrik

    I am very sorry for that - but it is unfortunately as it is, at least
    according to my knowledge. Maybe I am telling you rubbish, you should
    also contact the JSF reference implementation people on their mailing
    list and please tell back what you hear there if they know of any
    remedy.

    One way of going around that I would have - what about using the
    "forceId" attribute that all the MyFaces extended standard components
    provide (and the custom components should provide)?

    If you keep yourself to unique ids, this would be a viable solution.

    regards,

    Martin
    On 5/20/05, Hendrik Neumann wrote:
    Martin,

    please tell me, that you're kidding! I simply can not believe that Sun
    Microsystems passes a spec which bashes offical web-standards! What is about
    MathML, SVG and so on: they need a valid XML-file to work, which JSF
    apparently is not creating. This simply means that all new and modern
    HTML-extensions which should be established with XHTML are not possible with
    JSF, because the spec defines invalid XML-documents which forces me as a
    developer to use HTML4 from 1999. And this means that the JSF-spec is only
    practical for dinky "Hello World"-web-apps without any forward-looking
    techniques...

    I simply can not believe this... JSF forces me to use outdated standards and
    techniques... this is simply harrowing!

    Isn't it possible to develop my own ID-Generators or such a thing? Or is it
    possible to tell the web-browsers that they shouldn't take care about wrong
    ids? Or a Java-Script which replaces the invalid IDs? I had already tried to
    set manually id-names which solves the problems for a few moments but after a
    few clicks on the pages, my own ids are extended in the invalid way with the
    ":" and "_"-characters and the web-browser refuses to show my pages. This
    small id-disfigurement makes JSF in fact unusable to me if there really isn't
    a workaround...

    Regards,
    Hendrik

    P.S: Of course this email IS NOT aimed against you MyFaces-guys - you have
    done a great work, thank you very much for this (nevervethless it seems that
    jsf was the wrong spec for my project)!
  • John Fallows at May 20, 2005 at 5:39 pm
    It looks like ':' is supported by XML ID type.

    According to XML 1.0 specification, section 3.3.1, Attribute Types:

    http://www.w3.org/TR/2004/REC-xml-20040204/#sec-attribute-types

    the validity constraint for ID type, must follow the XML Name production:

    [5] Name ::= (Letter | '_' | ':') (NameChar)*

    which includes colon as a legal character.

    Kind Regards,
    John Fallows.
  • Rob Decker at May 20, 2005 at 6:04 pm
    The html and xhtml specs allow colons as well although not as the first character:

    http://www.w3.org/TR/html4/types.html#h-6.2

    http://www.w3.org/TR/xhtml1/#C_8

    --
    Rob

    @objectsource.org


    ---------- Original Message -----------
    From: John Fallows <john.r.fallows@gmail.com>
    To: MyFaces Discussion <users@myfaces.apache.org>, martin@marinschek.com
    Cc: mail@hendrik-neumann.de
    Sent: Fri, 20 May 2005 17:38:47 +0000
    Subject: Re: Serious problems with MyFaces ID allocation which is not conform to XHTML!
    It looks like ':' is supported by XML ID type.

    According to XML 1.0 specification, section 3.3.1, Attribute Types:

    http://www.w3.org/TR/2004/REC-xml-20040204/#sec-attribute-types

    the validity constraint for ID type, must follow the XML Name production:

    [5] Name ::= (Letter | '_' | ':') (NameChar)*

    which includes colon as a legal character.

    Kind Regards,
    John Fallows.
    ------- End of Original Message -------
  • Csík Norbert at May 20, 2005 at 6:05 pm
    Hi!

    I'm generating XHTML output without any problem at page validation
    (using Firefox).

    --
    Csík Norbert http://norbert.web.elte.hu/
    Programtervező matematikus
    Trilobita Informatikai Rt. - rendszertervező fejlesztőmérnök
    ___ keep sm:)ing _________________________ooo__C( O O )L__ooo__
    http://www.aion.hu/ - A csik.NET otthona
    http://www.spreadfirefox.com/ - Rediscover the web
    Légy pontos: Mérj mikro-milliméterben! Jelölj krétával! Vágj baltával!
  • Martin Marinschek at May 20, 2005 at 10:39 pm
    wow, that was fast and mani-voiced ;)

    I personally didn't know about the colons and if those were invalid,
    but the leading underscore (of automatically assigned ids) is though,
    and the HTML validator always complained about that.

    I wonder why you, Norbert, don't have any problems with that?

    regards,

    Martin
    On 5/20/05, Csík Norbert wrote:
    Hi!

    I'm generating XHTML output without any problem at page validation
    (using Firefox).

    --
    Csík Norbert http://norbert.web.elte.hu/
    Programtervező matematikus
    Trilobita Informatikai Rt. - rendszertervező fejlesztőmérnök
    ___ keep sm:)ing _________________________ooo__C( O O )L__ooo__
    http://www.aion.hu/ - A csik.NET otthona
    http://www.spreadfirefox.com/ - Rediscover the web
    Légy pontos: Mérj mikro-milliméterben! Jelölj krétával! Vágj baltával!
  • Martin Marinschek at May 21, 2005 at 12:27 am
    @John: XHTML is stricter in what is allowed than XML alone would be,
    you are right...

    @Hendrik: now you shouldn't have a problem at all with the id's - they
    are completely valid in the XML specifications, though the leading
    underscore disturbs in the XHTML spec?

    regards,

    Martin
    On 5/21/05, Martin Marinschek wrote:
    wow, that was fast and mani-voiced ;)

    I personally didn't know about the colons and if those were invalid,
    but the leading underscore (of automatically assigned ids) is though,
    and the HTML validator always complained about that.

    I wonder why you, Norbert, don't have any problems with that?

    regards,

    Martin
    On 5/20/05, Csík Norbert wrote:
    Hi!

    I'm generating XHTML output without any problem at page validation
    (using Firefox).

    --
    Csík Norbert http://norbert.web.elte.hu/
    Programtervező matematikus
    Trilobita Informatikai Rt. - rendszertervező fejlesztőmérnök
    ___ keep sm:)ing _________________________ooo__C( O O )L__ooo__
    http://www.aion.hu/ - A csik.NET otthona
    http://www.spreadfirefox.com/ - Rediscover the web
    Légy pontos: Mérj mikro-milliméterben! Jelölj krétával! Vágj baltával!
  • Csík Norbert at May 23, 2005 at 8:00 am
    Hi Martin!
    I wonder why you, Norbert, don't have any problems with that?
    You've got me. You're right. The only thing I forgot is I use may own
    IDs all the time. So I have form:siteName, form:siteAddress, etc as
    ID's, so there is no IDs stating with '_' and these ara valid ids.

    But look inside the specifications:

    Due to the XML spec IDs starting with an '_' is valid.
    As of HTML 4.01 (http://www.w3.org/TR/html401/types.html#type-name) it
    is invalid.
    As of XHTML 1.0 (http://www.w3.org/TR/html/#C_8) it is invalid to be
    backward compatible.

    So starting the Client ID with '_' is invalid.

    --
    Csík Norbert http://norbert.web.elte.hu/
    Programtervező matematikus
    Trilobita Informatikai Rt. - rendszertervező fejlesztőmérnök
    ___ keep sm:)ing _________________________ooo__C( O O )L__ooo__
    http://www.aion.hu/ - A csik.NET otthona
    http://www.spreadfirefox.com/ - Rediscover the web
    Légy pontos: Mérj mikro-milliméterben! Jelölj krétával! Vágj baltával!
  • Hendrik Neumann at May 20, 2005 at 11:16 pm
    Hi Martin,

    I think forcedIDs will not help because a normal html-site created with
    myfaces is more or less completly unusable and invalid due to mime type
    application/xhtml+xml: the java-script-codes themself are not valid anymore,
    they are placed at invalid positions and the nesting of the html-tags is also
    not 100% correct (tfoot and so on)... 26-50 error-messages from the
    W3C-validator on each of my jsf-sites (okay, maybe some of them are my own
    mistakes). Setting this mime-type on the jsf-sites also kills all
    jsf-command-links and some other functionallity (whatever javascript or
    non-javascript is set in web.xml)!!!!! This is simply a nightmare - it is
    definitely not possible to use JSF and modern XHTML with its extensions like
    MathML or SVG... so you really have to use HTML4.1 from 1999....

    Thank you for your hint about contancting the JSF reference implementation
    people and asking them what the hell they had thought to themselfs when they
    defined this flawed specification - I will do this and tell you what they
    said...

    BTW: I have found a time-consuming workaround: I have to migrate from your
    x:panelLayout to normal html-frames. Then I need to set the
    application/xhtml+xml-mime-type just for the jsf-sites which contain SVG- and
    MathML-Elements, all the other sites will get the normal text/html
    mime-type... maybe I will have to improvise a little bit... but I think this
    could rescue the whole project for the research center...

    For some more informations about the mime-type-problem see:
    http://www.xml.com/pub/a/2003/03/19/dive-into-xml.html

    regards and thanks again to the whole myfaces team for your work (but the spec
    itself is a disappointing joke),

    Hendrik

    Martin Marinschek <martin.marinschek@gmail.com> schrieb am 20.05.2005
    15:05:10:
    Hi Hendrik

    I am very sorry for that - but it is unfortunately as it is, at least
    according to my knowledge. Maybe I am telling you rubbish, you should
    also contact the JSF reference implementation people on their mailing
    list and please tell back what you hear there if they know of any
    remedy.

    One way of going around that I would have - what about using the
    "forceId" attribute that all the MyFaces extended standard components
    provide (and the custom components should provide)?

    If you keep yourself to unique ids, this would be a viable solution.

    regards,

    Martin
    On 5/20/05, Hendrik Neumann wrote:
    Martin,

    please tell me, that you're kidding! I simply can not believe that Sun
    Microsystems passes a spec which bashes offical web-standards! What is
    about
    MathML, SVG and so on: they need a valid XML-file to work, which JSF
    apparently is not creating. This simply means that all new and modern
    HTML-extensions which should be established with XHTML are not possible
    with
    JSF, because the spec defines invalid XML-documents which forces me as a
    developer to use HTML4 from 1999. And this means that the JSF-spec is only
    practical for dinky "Hello World"-web-apps without any forward-looking
    techniques...

    I simply can not believe this... JSF forces me to use outdated standards
    and
    techniques... this is simply harrowing!

    Isn't it possible to develop my own ID-Generators or such a thing? Or is
    it
    possible to tell the web-browsers that they shouldn't take care about
    wrong
    ids? Or a Java-Script which replaces the invalid IDs? I had already tried
    to
    set manually id-names which solves the problems for a few moments but
    after a
    few clicks on the pages, my own ids are extended in the invalid way with
    the
    ":" and "_"-characters and the web-browser refuses to show my pages. This
    small id-disfigurement makes JSF in fact unusable to me if there really
    isn't
    a workaround...

    Regards,
    Hendrik

    P.S: Of course this email IS NOT aimed against you MyFaces-guys - you have
    done a great work, thank you very much for this (nevervethless it seems
    that
    jsf was the wrong spec for my project)!
    Am Freitag, 20. Mai 2005 15:04 schrieb Martin Marinschek:
    Hi Hendrik

    I am very sorry for that - but it is unfortunately as it is, at least
    according to my knowledge. Maybe I am telling you rubbish, you should
    also contact the JSF reference implementation people on their mailing
    list and please tell back what you hear there if they know of any
    remedy.

    One way of going around that I would have - what about using the
    "forceId" attribute that all the MyFaces extended standard components
    provide (and the custom components should provide)?

    If you keep yourself to unique ids, this would be a viable solution.

    regards,

    Martin
    On 5/20/05, Hendrik Neumann wrote:
    Martin,

    please tell me, that you're kidding! I simply can not believe that Sun
    Microsystems passes a spec which bashes offical web-standards! What is
    about MathML, SVG and so on: they need a valid XML-file to work, which
    JSF apparently is not creating. This simply means that all new and modern
    HTML-extensions which should be established with XHTML are not possible
    with JSF, because the spec defines invalid XML-documents which forces me
    as a developer to use HTML4 from 1999. And this means that the JSF-spec
    is only practical for dinky "Hello World"-web-apps without any
    forward-looking techniques...

    I simply can not believe this... JSF forces me to use outdated standards
    and techniques... this is simply harrowing!

    Isn't it possible to develop my own ID-Generators or such a thing? Or is
    it possible to tell the web-browsers that they shouldn't take care about
    wrong ids? Or a Java-Script which replaces the invalid IDs? I had already
    tried to set manually id-names which solves the problems for a few
    moments but after a few clicks on the pages, my own ids are extended in
    the invalid way with the ":" and "_"-characters and the web-browser
    refuses to show my pages. This small id-disfigurement makes JSF in fact
    unusable to me if there really isn't a workaround...

    Regards,
    Hendrik

    P.S: Of course this email IS NOT aimed against you MyFaces-guys - you
    have done a great work, thank you very much for this (nevervethless it
    seems that jsf was the wrong spec for my project)!
  • Martin Marinschek at May 21, 2005 at 11:23 pm
    Hi Hendrik,

    can you tell me about the problems with our javascripts and the
    nestings? maybe you could even submit a bug or two if you nail down a
    problem?

    regards,

    Martin
    On 5/20/05, Hendrik Neumann wrote:
    Hi Martin,

    I think forcedIDs will not help because a normal html-site created with
    myfaces is more or less completly unusable and invalid due to mime type
    application/xhtml+xml: the java-script-codes themself are not valid anymore,
    they are placed at invalid positions and the nesting of the html-tags is also
    not 100% correct (tfoot and so on)... 26-50 error-messages from the
    W3C-validator on each of my jsf-sites (okay, maybe some of them are my own
    mistakes). Setting this mime-type on the jsf-sites also kills all
    jsf-command-links and some other functionallity (whatever javascript or
    non-javascript is set in web.xml)!!!!! This is simply a nightmare - it is
    definitely not possible to use JSF and modern XHTML with its extensions like
    MathML or SVG... so you really have to use HTML4.1 from 1999....

    Thank you for your hint about contancting the JSF reference implementation
    people and asking them what the hell they had thought to themselfs when they
    defined this flawed specification - I will do this and tell you what they
    said...

    BTW: I have found a time-consuming workaround: I have to migrate from your
    x:panelLayout to normal html-frames. Then I need to set the
    application/xhtml+xml-mime-type just for the jsf-sites which contain SVG- and
    MathML-Elements, all the other sites will get the normal text/html
    mime-type... maybe I will have to improvise a little bit... but I think this
    could rescue the whole project for the research center...

    For some more informations about the mime-type-problem see:
    http://www.xml.com/pub/a/2003/03/19/dive-into-xml.html

    regards and thanks again to the whole myfaces team for your work (but the spec
    itself is a disappointing joke),

    Hendrik

    Martin Marinschek <martin.marinschek@gmail.com> schrieb am 20.05.2005
    15:05:10:
    Hi Hendrik

    I am very sorry for that - but it is unfortunately as it is, at least
    according to my knowledge. Maybe I am telling you rubbish, you should
    also contact the JSF reference implementation people on their mailing
    list and please tell back what you hear there if they know of any
    remedy.

    One way of going around that I would have - what about using the
    "forceId" attribute that all the MyFaces extended standard components
    provide (and the custom components should provide)?

    If you keep yourself to unique ids, this would be a viable solution.

    regards,

    Martin
    On 5/20/05, Hendrik Neumann wrote:
    Martin,

    please tell me, that you're kidding! I simply can not believe that Sun
    Microsystems passes a spec which bashes offical web-standards! What is
    about
    MathML, SVG and so on: they need a valid XML-file to work, which JSF
    apparently is not creating. This simply means that all new and modern
    HTML-extensions which should be established with XHTML are not possible
    with
    JSF, because the spec defines invalid XML-documents which forces me as a
    developer to use HTML4 from 1999. And this means that the JSF-spec is only
    practical for dinky "Hello World"-web-apps without any forward-looking
    techniques...

    I simply can not believe this... JSF forces me to use outdated standards
    and
    techniques... this is simply harrowing!

    Isn't it possible to develop my own ID-Generators or such a thing? Or is
    it
    possible to tell the web-browsers that they shouldn't take care about
    wrong
    ids? Or a Java-Script which replaces the invalid IDs? I had already tried
    to
    set manually id-names which solves the problems for a few moments but
    after a
    few clicks on the pages, my own ids are extended in the invalid way with
    the
    ":" and "_"-characters and the web-browser refuses to show my pages. This
    small id-disfigurement makes JSF in fact unusable to me if there really
    isn't
    a workaround...

    Regards,
    Hendrik

    P.S: Of course this email IS NOT aimed against you MyFaces-guys - you have
    done a great work, thank you very much for this (nevervethless it seems
    that
    jsf was the wrong spec for my project)!
    Am Freitag, 20. Mai 2005 15:04 schrieb Martin Marinschek:
    Hi Hendrik

    I am very sorry for that - but it is unfortunately as it is, at least
    according to my knowledge. Maybe I am telling you rubbish, you should
    also contact the JSF reference implementation people on their mailing
    list and please tell back what you hear there if they know of any
    remedy.

    One way of going around that I would have - what about using the
    "forceId" attribute that all the MyFaces extended standard components
    provide (and the custom components should provide)?

    If you keep yourself to unique ids, this would be a viable solution.

    regards,

    Martin
    On 5/20/05, Hendrik Neumann wrote:
    Martin,

    please tell me, that you're kidding! I simply can not believe that Sun
    Microsystems passes a spec which bashes offical web-standards! What is
    about MathML, SVG and so on: they need a valid XML-file to work, which
    JSF apparently is not creating. This simply means that all new and modern
    HTML-extensions which should be established with XHTML are not possible
    with JSF, because the spec defines invalid XML-documents which forces me
    as a developer to use HTML4 from 1999. And this means that the JSF-spec
    is only practical for dinky "Hello World"-web-apps without any
    forward-looking techniques...

    I simply can not believe this... JSF forces me to use outdated standards
    and techniques... this is simply harrowing!

    Isn't it possible to develop my own ID-Generators or such a thing? Or is
    it possible to tell the web-browsers that they shouldn't take care about
    wrong ids? Or a Java-Script which replaces the invalid IDs? I had already
    tried to set manually id-names which solves the problems for a few
    moments but after a few clicks on the pages, my own ids are extended in
    the invalid way with the ":" and "_"-characters and the web-browser
    refuses to show my pages. This small id-disfigurement makes JSF in fact
    unusable to me if there really isn't a workaround...

    Regards,
    Hendrik

    P.S: Of course this email IS NOT aimed against you MyFaces-guys - you
    have done a great work, thank you very much for this (nevervethless it
    seems that jsf was the wrong spec for my project)!
  • Matt Blum at May 20, 2005 at 6:02 pm
    The starting underscore is invalid according to the XHTML spec, but
    post-initial colons are just fine:

    http://www.w3.org/TR/xhtml1/#C_8

    -Matt
    On 5/20/05, Martin Marinschek wrote:

    Well, the id generation is standardized by the JSF-Spec.

    I have already wondered why they standardized the rendering of invalid
    ids, but it seems they did...

    Also the starting underscore seems to be invalid according to the
    XHTML spec - no way around that either, sorry.

    regards,

    Martin
    On 5/20/05, Hendrik Neumann wrote:
    Hi everybody,

    I have a very serious problem according the ID allocation of MyFaces. MyFaces
    generates IDs which contains ':' but this is invalid due to the W3C
    XHTML-Standard. Most of you will appraise this as a "disfigurement" but the
    situation becomes very serious if you need to integrade MathML-formulas in
    your myfaces-web-app.

    Because MathML need a "application/xhtml+xml" mime-type for the
    html-documents
    which causes most browsers to validate the document against the dtd. Then the
    browser recognize that this document is not a valid xhtml/xml-document
    (because of invalid id's) and the document is not beeing showed in the
    browser - instead the browser displays a "file is not a valid
    xml-document"-message!

    Is there a workaround to generate VALID ids with myfaces? Otherwise I'm not
    able to integrate MathML-formulas in my myfaces-web-app which will make my
    hole content-mangement-system unsuitable for the hole research center!

    Greetings,
    Hendrik

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupusers @
categoriesmyfaces
postedMay 20, '05 at 11:20a
activeMay 23, '05 at 8:00a
posts13
users6
websitemyfaces.apache.org

People

Translate

site design / logo © 2019 Grokbase