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

validating xhtml entities

Expand Messages
  • Jesse Alama
    I like the way that nXML mode validates my XML documents on the fly. It seems that concerning entities, though, there can be false negatives (i.e., nXML says
    Message 1 of 2 , May 18, 2012
    • 0 Attachment
      I like the way that nXML mode validates my XML documents on the fly.
      It seems that concerning entities, though, there can be false
      negatives (i.e., nXML says that the document is valid, but it is not).
      For example, in XHTML, one can write, say

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
      <title>An XHTML 1.0 Strict standard template</title>
      </head>
      <body>
      <p> </p>
      </body>
      </html>

      and this document is (correctly) judged to be valid. Plugging in a
      bogus entity

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
      <title>An XHTML 1.0 Strict standard template</title>
      </head>
      <body>
      <p>&bogus;</p>
      </body>
      </html>

      is likewise judged to be valid, but this is not correct, at least
      under the definition of "valid" that matters for my purposes (the
      result needs to be valid XHTML -- validator.w3.org flags the bogus
      entity as bad XHTML).

      To verify entities in XHTML, one could just scan the document,
      comparing every entity occurring inside it against a fixed list of
      acceptable XHTML entities. I would rather not code such a thing,
      though, unless it's really necessary. Judging from the documenation
      (in the "DTDs" section of the nXML info docs), I gather that indeed
      nXML does not care to "validate" entities in the sense I intend. But
      perhaps I'm wrong.

      Thanks,

      Jesse

      --
      Jesse Alama
      http://centria.di.fct.unl.pt/~alama/
    • Dave Pawson
      nxml is a tool for Relax NG Jesse? sort of not interested in DTD s? Try another tool for DTD validation, I use rxp http://www.cogsci.ed.ac.uk/~richard/rxp.html
      Message 2 of 2 , May 18, 2012
      • 0 Attachment
        nxml is a tool for Relax NG Jesse?
        sort of not interested in DTD's?
        Try another tool for DTD validation, I use rxp
        http://www.cogsci.ed.ac.uk/~richard/rxp.html

        HTH

        On 18 May 2012 16:38, Jesse Alama <alama@...> wrote:
        > I like the way that nXML mode validates my XML documents on the fly.
        > It seems that concerning entities, though, there can be false
        > negatives (i.e., nXML says that the document is valid, but it is not).
        > For example, in XHTML, one can write, say
        >
        >  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        >    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
        >  <html xmlns="http://www.w3.org/1999/xhtml">
        >  <head>
        >  <title>An XHTML 1.0 Strict standard template</title>
        >  </head>
        >  <body>
        >  <p> </p>
        >  </body>
        >  </html>
        >
        > and this document is (correctly) judged to be valid.  Plugging in a
        > bogus entity
        >
        >  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        >    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
        >  <html xmlns="http://www.w3.org/1999/xhtml">
        >  <head>
        >  <title>An XHTML 1.0 Strict standard template</title>
        >  </head>
        >  <body>
        >  <p>&bogus;</p>
        >  </body>
        >  </html>
        >
        > is likewise judged to be valid, but this is not correct, at least
        > under the definition of "valid" that matters for my purposes (the
        > result needs to be valid XHTML -- validator.w3.org flags the bogus
        > entity as bad XHTML).
        >
        > To verify entities in XHTML, one could just scan the document,
        > comparing every entity occurring inside it against a fixed list of
        > acceptable XHTML entities.  I would rather not code such a thing,
        > though, unless it's really necessary.  Judging from the documenation
        > (in the "DTDs" section of the nXML info docs), I gather that indeed
        > nXML does not care to "validate" entities in the sense I intend.  But
        > perhaps I'm wrong.
        >
        > Thanks,
        >
        > Jesse
        >
        > --
        > Jesse Alama
        > http://centria.di.fct.unl.pt/~alama/
        >
        >
        > ------------------------------------
        >
        > Yahoo! Groups Links
        >
        >
        >



        --
        Dave Pawson
        XSLT XSL-FO FAQ.
        Docbook FAQ.
        http://www.dpawson.co.uk
      Your message has been successfully submitted and would be delivered to recipients shortly.