Loading ...
Sorry, an error occurred while loading the content.
 

False-positive validation errors

Expand Messages
  • lucas_gonze
    Labels and inputs in forms are incorrectly flagged as invalid. In this valid sample document, the label and input will be considered errors and will cause
    Message 1 of 22 , Aug 12, 2008
      Labels and inputs in forms are incorrectly flagged as invalid. In this
      valid sample document, the label and input will be considered errors
      and will cause nxml-mode to do stop doing useful validation:

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml">
      <head><title></title></head>
      <body>
      <form action="" method="get">
      <label for="inputname">Label for field: </label>
      <input type="text" name="inputname" id="inputname" />
      </form>
      </body>
      </html>
    • Lennart Borgman (gmail)
      ... Hi Lucas, I am not sure, but I believe the reason for this is that nxml-mode does not have a schema for XHTML 1.0 Transitional. It uses Strict instead. You
      Message 2 of 22 , Aug 12, 2008
        lucas_gonze wrote:
        >
        >
        > Labels and inputs in forms are incorrectly flagged as invalid. In this
        > valid sample document, the label and input will be considered errors
        > and will cause nxml-mode to do stop doing useful validation:
        >
        > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
        > <http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd>">
        > <html xmlns="http://www.w3.org/1999/xhtml <http://www.w3.org/1999/xhtml>">
        > <head><title></title></head>
        > <body>
        > <form action="" method="get">
        > <label for="inputname">Label for field: </label>
        > <input type="text" name="inputname" id="inputname" />
        > </form>
        > </body>
        > </html>


        Hi Lucas,

        I am not sure, but I believe the reason for this is that nxml-mode does
        not have a schema for XHTML 1.0 Transitional. It uses Strict instead.

        You are very welcome to contribute .rnc files for Transitional if you
        want to!
      • Lucas Gonze
        On Tue, Aug 12, 2008 at 6:33 PM, Lennart Borgman (gmail) ... So what s needed is a Relax NG schema for XHTML 1.0 Transitional? -L
        Message 3 of 22 , Aug 12, 2008
          On Tue, Aug 12, 2008 at 6:33 PM, Lennart Borgman (gmail)
          <lennart.borgman@...> wrote:
          > I am not sure, but I believe the reason for this is that nxml-mode does
          > not have a schema for XHTML 1.0 Transitional. It uses Strict instead.
          >
          > You are very welcome to contribute .rnc files for Transitional if you
          > want to!

          So what's needed is a Relax NG schema for XHTML 1.0 Transitional?

          -L
        • Lucas Gonze
          ... http://www.thaiopensource.com/relaxng/xhtml/xhtml.rng which is documented at http://www.thaiopensource.com/relaxng/xhtml/ has a modest chance of meeting
          Message 4 of 22 , Aug 12, 2008
            > a Relax NG schema for XHTML 1.0 Transitional?

            http://www.thaiopensource.com/relaxng/xhtml/xhtml.rng
            which is documented at
            http://www.thaiopensource.com/relaxng/xhtml/
            has a modest chance of meeting the need. Can you help me understand
            the difference between .rnc and .rng?

            Also, I should point out that nxml-mode should make the lack of a
            schema explicit. It's a bug if the validation is wrong, but it's just
            a missing feature if there's a user-visible message saying that
            validation doesn't work in XHTML 1.0 Transitional.
          • Dave Pawson
            ... Is it also a bug if the 10001 other schemas in the world are not supported? The schemas provided are there as examples. If you want more, add them. regards
            Message 5 of 22 , Aug 12, 2008
              2008/8/13 Lucas Gonze <lucas.gonze@...>:
              >> a Relax NG schema for XHTML 1.0 Transitional?
              >
              > http://www.thaiopensource.com/relaxng/xhtml/xhtml.rng
              > which is documented at
              > http://www.thaiopensource.com/relaxng/xhtml/
              > has a modest chance of meeting the need. Can you help me understand
              > the difference between .rnc and .rng?
              >
              > Also, I should point out that nxml-mode should make the lack of a
              > schema explicit.

              Is it also a bug if the 10001 other schemas in the world are not supported?

              The schemas provided are there as examples. If you want more, add them.

              regards




              --
              Dave Pawson
              XSLT XSL-FO FAQ.
              http://www.dpawson.co.uk
            • Lennart Borgman (gmail)
              ... Yes, exactly. It would be very nice if you wrote this. For it to be of greater value you should sign papers for Emacs so that it can be included there.
              Message 6 of 22 , Aug 13, 2008
                Lucas Gonze wrote:
                >
                >
                > On Tue, Aug 12, 2008 at 6:33 PM, Lennart Borgman (gmail)
                > <lennart.borgman@... <mailto:lennart.borgman%40gmail.com>> wrote:
                > > I am not sure, but I believe the reason for this is that nxml-mode does
                > > not have a schema for XHTML 1.0 Transitional. It uses Strict instead.
                > >
                > > You are very welcome to contribute .rnc files for Transitional if you
                > > want to!
                >
                > So what's needed is a Relax NG schema for XHTML 1.0 Transitional?


                Yes, exactly. It would be very nice if you wrote this. For it to be of
                greater value you should sign papers for Emacs so that it can be
                included there.

                Thanks.
              • Lennart Borgman (gmail)
                ... I do not know this very well, but there are good links from the web site. ... I think everyone is aware of that, but no one has had time to fix this. Or,
                Message 7 of 22 , Aug 13, 2008
                  Lucas Gonze wrote:
                  >
                  >
                  > > a Relax NG schema for XHTML 1.0 Transitional?
                  >
                  > http://www.thaiopensource.com/relaxng/xhtml/xhtml.rng
                  > <http://www.thaiopensource.com/relaxng/xhtml/xhtml.rng>
                  > which is documented at
                  > http://www.thaiopensource.com/relaxng/xhtml/
                  > <http://www.thaiopensource.com/relaxng/xhtml/>
                  > has a modest chance of meeting the need. Can you help me understand
                  > the difference between .rnc and .rng?

                  I do not know this very well, but there are good links from the web site.

                  > Also, I should point out that nxml-mode should make the lack of a
                  > schema explicit. It's a bug if the validation is wrong, but it's just
                  > a missing feature if there's a user-visible message saying that
                  > validation doesn't work in XHTML 1.0 Transitional.


                  I think everyone is aware of that, but no one has had time to fix this.
                  Or, rather, that it handles your transitional files at all is a fix.

                  And yes, it would be good if that was documented in Emacs. Patches are
                  welcome!
                • Steinar Bang
                  ... RNC and RNG are two different syntaxes for the Relax-NG schemas. RNG is an XML representation of the schemas. RNC (aka the Relax-NG compact notation )
                  Message 8 of 22 , Aug 13, 2008
                    >>>>> "Lucas Gonze" <lucas.gonze@...>:

                    > ... Can you help me understand the difference between .rnc and .rng?

                    RNC and RNG are two different syntaxes for the Relax-NG schemas. RNG is
                    an XML representation of the schemas. RNC (aka "the Relax-NG compact
                    notation") is an, as it says, compact, and also very human-readable
                    format for the Relax-NG schemas.

                    The trang utility can easily convert between the two.

                    nxml needs the schemas in the compact (RNC) notation.
                  • Steinar Bang
                    ... FWIW I do all my schema editing in the RNC notation. When attempting a move to XML schemas, I got too annoyed with the verbosity and noise cluttering up
                    Message 9 of 22 , Aug 13, 2008
                      >>>>> Steinar Bang <sb@...>:

                      >>>>> "Lucas Gonze" <lucas.gonze@...>:
                      >> ... Can you help me understand the difference between .rnc and .rng?

                      > RNC and RNG are two different syntaxes for the Relax-NG schemas. RNG is
                      > an XML representation of the schemas. RNC (aka "the Relax-NG compact
                      > notation") is an, as it says, compact, and also very human-readable
                      > format for the Relax-NG schemas.

                      FWIW I do all my schema editing in the RNC notation. When attempting a
                      move to XML schemas, I got too annoyed with the verbosity and "noise"
                      cluttering up the logic. The response to my complaints have been "it's
                      supposed to be edited using GUI tools, one should not attempt hand
                      editing these schemas".

                      The XML notation of Relax-NG is far less cluttered than XSD, but it's
                      still far harder to read than the same schema in the compact notation.
                    • Florent Georges
                      ... I don t know if nXML can be considered a GUI tool, but I do edit XSDL schemas by hand, with nXML ;-) --drkm
                      Message 10 of 22 , Aug 13, 2008
                        Steinar Bang wrote:

                        > The response to my complaints have been "it's
                        > supposed to be edited using GUI tools, one should not
                        > attempt hand editing these schemas".

                        I don't know if nXML can be considered a GUI tool, but I do edit XSDL
                        schemas by hand, with nXML ;-)

                        --drkm





















                        _____________________________________________________________________________
                        Envoyez avec Yahoo! Mail. Une boite mail plus intelligente http://mail.yahoo.fr
                      • Lucas Gonze
                        ... On Wed, Aug 13, 2008 at 2:42 AM, Lennart Borgman (gmail) ... I have created an rnc file from http://www.thaiopensource.com/relaxng/xhtml/xhtml.rng and done
                        Message 11 of 22 , Aug 13, 2008
                          >> So what's needed is a Relax NG schema for XHTML 1.0 Transitional?

                          On Wed, Aug 13, 2008 at 2:42 AM, Lennart Borgman (gmail)
                          <lennart.borgman@...> wrote:
                          > Yes, exactly. It would be very nice if you wrote this.

                          I have created an rnc file from
                          http://www.thaiopensource.com/relaxng/xhtml/xhtml.rng and done a
                          little testing to confirm that it doesn't completely fail. See
                          xhtml-transitional-in-nxml.tgz at
                          http://tech.groups.yahoo.com/group/emacs-nxml-mode/files/
                        • Lucas Gonze
                          On Wed, Aug 13, 2008 at 2:44 AM, Lennart Borgman (gmail) ... That is one way to fix it. But that doesn t address the larger issue that failing silently when
                          Message 12 of 22 , Aug 13, 2008
                            On Wed, Aug 13, 2008 at 2:44 AM, Lennart Borgman (gmail)
                            <lennart.borgman@...> wrote:
                            > I think everyone is aware of that, but no one has had time to fix this.
                            > Or, rather, that it handles your transitional files at all is a fix.

                            That is one way to fix it. But that doesn't address the larger issue
                            that failing silently when there is no schema is a bug. I have spent
                            a lot of time figuring out that the problem in my HTML is actually in
                            the validator. I then found a place to report the error to XHTML-mode
                            owners. They told me it was a problem in nxml-mode. I reported the
                            problem on the nxml-mode wiki. No answer there. I waited a couple
                            weeks to be sure that was not a usable way to reach the maintainers of
                            nxml-mode. Then I looked for another potential home for maintainers,
                            found this group and reported the error. All that work was caused by
                            the error happening silently rather than being explicit.

                            If nxml-mode doesn't have a schema to validate a file, it should
                            disable validation and report the lack of a schema to the user.
                          • lucas_gonze
                            ... Sample schemas.xml for loading this schema:
                            Message 13 of 22 , Aug 13, 2008
                              --- In emacs-nxml-mode@yahoogroups.com, "Lucas Gonze"
                              <lucas.gonze@...> wrote:
                              >
                              > >> So what's needed is a Relax NG schema for XHTML 1.0 Transitional?
                              >
                              > On Wed, Aug 13, 2008 at 2:42 AM, Lennart Borgman (gmail)
                              > <lennart.borgman@...> wrote:
                              > > Yes, exactly. It would be very nice if you wrote this.
                              >
                              > I have created an rnc file from
                              > http://www.thaiopensource.com/relaxng/xhtml/xhtml.rng and done a
                              > little testing to confirm that it doesn't completely fail. See
                              > xhtml-transitional-in-nxml.tgz at
                              > http://tech.groups.yahoo.com/group/emacs-nxml-mode/files/

                              Sample schemas.xml for loading this schema:

                              <?xml version="1.0"?>
                              <locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0">
                              <doctypePublicId publicId="-//W3C//DTD XHTML 1.0 Transitional//EN"
                              uri="rnc/xhtml-transitional-frameset.rnc"/>
                              </locatingRules>

                              Sample .emacs for loading schemas.xml:

                              ;; use custom validator for xhtml transitional in nxml-mode and
                              nxhtml-mode
                              (setq rng-schema-locating-files
                              (append rng-schema-locating-files-default
                              '("~/.emacs.d/xhtml-transitional-in-nxml/schemas.xml")))

                              I am posting these notes for the benefit of future web searchers
                              working on the same issue.
                            • Lennart Borgman (gmail)
                              Hi Lucas It is very nice to see that you actually wrote this .rnc file! I think the best way to use it would be to add it to Emacs itself since nxml-mode will
                              Message 14 of 22 , Aug 13, 2008
                                Hi Lucas

                                It is very nice to see that you actually wrote this .rnc file!

                                I think the best way to use it would be to add it to Emacs itself since
                                nxml-mode will be a part of Emacs 23. Do you want that?
                              • Lennart Borgman (gmail)
                                ... Thank you for your patience and endurance. I have put a note at the top of the nxml-mode page on Emacs Wiki to avoid such situations in the future. I think
                                Message 15 of 22 , Aug 13, 2008
                                  Lucas Gonze wrote:
                                  > On Wed, Aug 13, 2008 at 2:44 AM, Lennart Borgman (gmail)
                                  > <lennart.borgman@... <mailto:lennart.borgman%40gmail.com>> wrote:
                                  > > I think everyone is aware of that, but no one has had time to fix this.
                                  > > Or, rather, that it handles your transitional files at all is a fix.
                                  >
                                  > That is one way to fix it. But that doesn't address the larger issue
                                  > that failing silently when there is no schema is a bug. I have spent
                                  > a lot of time figuring out that the problem in my HTML is actually in
                                  > the validator. I then found a place to report the error to XHTML-mode
                                  > owners. They told me it was a problem in nxml-mode. I reported the
                                  > problem on the nxml-mode wiki. No answer there. I waited a couple
                                  > weeks to be sure that was not a usable way to reach the maintainers of
                                  > nxml-mode.

                                  Thank you for your patience and endurance.

                                  I have put a note at the top of the nxml-mode page on Emacs Wiki to
                                  avoid such situations in the future.

                                  I think the lesson you have learned this hard way is worth attention. It
                                  is quite hard to avoid this confusion with software maintained the way
                                  Emacs libraries are. Lack of time and understanding of the complexities
                                  that can arise are two difficulties (but I am sure there are more).

                                  Perhaps you want to give some suggestions to the Emacs Wiki maintainers?


                                  Then I looked for another potential home for maintainers,
                                  > found this group and reported the error. All that work was caused by
                                  > the error happening silently rather than being explicit.
                                  >
                                  > If nxml-mode doesn't have a schema to validate a file, it should
                                  > disable validation and report the lack of a schema to the user.
                                • Lucas Gonze
                                  On Wed, Aug 13, 2008 at 12:40 PM, Lennart Borgman (gmail) ... That s a good idea. Easy and effective. -L
                                  Message 16 of 22 , Aug 13, 2008
                                    On Wed, Aug 13, 2008 at 12:40 PM, Lennart Borgman (gmail)
                                    <lennart.borgman@...> wrote:
                                    > I have put a note at the top of the nxml-mode page on Emacs Wiki to
                                    > avoid such situations in the future.

                                    That's a good idea. Easy and effective.

                                    -L
                                  • Lucas Gonze
                                    On Wed, Aug 13, 2008 at 12:23 PM, Lennart Borgman (gmail) ... That s a good thing and I m for it. Do you know what the steps are in packaging it up? What do
                                    Message 17 of 22 , Aug 13, 2008
                                      On Wed, Aug 13, 2008 at 12:23 PM, Lennart Borgman (gmail)
                                      <lennart.borgman@...> wrote:
                                      > I think the best way to use it would be to add it to Emacs itself since
                                      > nxml-mode will be a part of Emacs 23. Do you want that?

                                      That's a good thing and I'm for it.

                                      Do you know what the steps are in packaging it up? What do other
                                      schemas look like in CVS?
                                    • Lennart Borgman (gmail)
                                      ... If you do not want to checkout the sources you can browse them on the web here: http://cvs.savannah.gnu.org/viewvc/emacs/etc/schema/?root=emacs Patches use
                                      Message 18 of 22 , Aug 13, 2008
                                        Lucas Gonze wrote:
                                        >
                                        >
                                        > On Wed, Aug 13, 2008 at 12:23 PM, Lennart Borgman (gmail)
                                        > <lennart.borgman@... <mailto:lennart.borgman%40gmail.com>> wrote:
                                        > > I think the best way to use it would be to add it to Emacs itself since
                                        > > nxml-mode will be a part of Emacs 23. Do you want that?
                                        >
                                        > That's a good thing and I'm for it.
                                        >
                                        > Do you know what the steps are in packaging it up? What do other
                                        > schemas look like in CVS?


                                        If you do not want to checkout the sources you can browse them on the
                                        web here:

                                        http://cvs.savannah.gnu.org/viewvc/emacs/etc/schema/?root=emacs

                                        Patches use to be the preffered way to send changes if existing files
                                        are changed. I believe the new files could just be sent as attachment.
                                      • Lucas Gonze
                                        We ll need the source RNG files from James Clark to be put under the GPL by him. Is he still on this list?
                                        Message 19 of 22 , Aug 13, 2008
                                          We'll need the source RNG files from James Clark to be put under the GPL by him.

                                          Is he still on this list?
                                        • Lucas Gonze
                                          I have emailed James Clark about his putting his RNG sources under the GPL.
                                          Message 20 of 22 , Aug 13, 2008
                                            I have emailed James Clark about his putting his RNG sources under the GPL.

                                            On Wed, Aug 13, 2008 at 4:28 PM, Lucas Gonze <lucas.gonze@...> wrote:
                                            > We'll need the source RNG files from James Clark to be put under the GPL by him.
                                            >
                                            > Is he still on this list?
                                            >
                                          • Edward O'Connor
                                            ... Correct me if I m wrong, but I think nxml is correct: the above is invalid HTML 4.01. requires block children; your form needs a , , or
                                            Message 21 of 22 , Aug 19, 2008
                                              lucas gonze wrote:

                                              > Labels and inputs in forms are incorrectly flagged as invalid. In this
                                              > valid sample document, the label and input will be considered errors
                                              > and will cause nxml-mode to do stop doing useful validation:
                                              >
                                              > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                                              > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                                              > <html xmlns="http://www.w3.org/1999/xhtml">
                                              > <head><title></title></head>
                                              > <body>
                                              > <form action="" method="get">
                                              > <label for="inputname">Label for field: </label>
                                              > <input type="text" name="inputname" id="inputname" />
                                              > </form>
                                              > </body>
                                              > </html>

                                              Correct me if I'm wrong, but I think nxml is correct: the above is
                                              invalid HTML 4.01. <form> requires block children; your form needs a
                                              <p>, <div>, or (better yet) a <fieldset> to contain your <label> and
                                              <input>.


                                              Ted
                                            • Lucas Gonze
                                              ... This is XHTML 1.0 Transitional, though. The W3C validator does flag the missing block element if the form is part of an HTML 4.01 document, but doesn t
                                              Message 22 of 22 , Aug 19, 2008
                                                On Tue, Aug 19, 2008 at 6:27 PM, Edward O'Connor <hober0@...> wrote:
                                                > Correct me if I'm wrong, but I think nxml is correct: the above is
                                                > invalid HTML 4.01. <form> requires block children; your form needs a
                                                > <p>, <div>, or (better yet) a <fieldset> to contain your <label> and
                                                > <input>.

                                                This is XHTML 1.0 Transitional, though.

                                                The W3C validator does flag the missing block element if the form is
                                                part of an HTML 4.01 document, but doesn't flag it in an XHTML 1.0
                                                Transitional document. To check whether this is an error in the
                                                validator I looked up the DTD and didn't find the same requirement as
                                                HTML 4.01, and I didn't see this requirement documented in the spec.
                                                It's possible that I missed it.

                                                > lucas gonze wrote:
                                                >
                                                >> Labels and inputs in forms are incorrectly flagged as invalid. In this
                                                >> valid sample document, the label and input will be considered errors
                                                >> and will cause nxml-mode to do stop doing useful validation:
                                                >>
                                                >> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                                                >> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                                                >> <html xmlns="http://www.w3.org/1999/xhtml">
                                                >> <head><title></title></head>
                                                >> <body>
                                                >> <form action="" method="get">
                                                >> <label for="inputname">Label for field: </label>
                                                >> <input type="text" name="inputname" id="inputname" />
                                                >> </form>
                                                >> </body>
                                                >> </html>
                                                >
                                                > Correct me if I'm wrong, but I think nxml is correct: the above is
                                                > invalid HTML 4.01. <form> requires block children; your form needs a
                                                > <p>, <div>, or (better yet) a <fieldset> to contain your <label> and
                                                > <input>.
                                                >
                                                >
                                                > Ted
                                                >
                                                >
                                                > ------------------------------------
                                                >
                                                > Yahoo! Groups Links
                                                >
                                                >
                                                >
                                                >
                                              Your message has been successfully submitted and would be delivered to recipients shortly.