Missing entitites - Invalid or not well-formed ?

Discussion in 'XML' started by Andy Dingley, Oct 15, 2004.

  1. Andy Dingley

    Andy Dingley Guest

    Suppose I have a XML document, in a format such as RSS.
    I then use a reference to a well-known HTML entity, such as é

    Clearly this isn't "correct" (the entity is unknown) - but is this
    an error of well-formedness (i.e. at the XML level) or an error of
    validity (incompatible with the referenced schema) ?
     
    Andy Dingley, Oct 15, 2004
    #1
    1. Advertising

  2. Andy Dingley

    jmm-list-gn Guest

    Andy Dingley wrote:
    > Suppose I have a XML document, in a format such as RSS.
    > I then use a reference to a well-known HTML entity, such as é
    >
    > Clearly this isn't "correct" (the entity is unknown) - but is this
    > an error of well-formedness (i.e. at the XML level) or an error of
    > validity (incompatible with the referenced schema) ?
    >

    It is not well-formed: it is a syntax error, an unknown entity.
    Validation is more of a lexical (meaning) test.

    --
    jmm dash list (at) sohnen-moe (dot) com
    (Remove .AXSPAMGN for email)
     
    jmm-list-gn, Oct 15, 2004
    #2
    1. Advertising

  3. In article <>,
    Andy Dingley <> wrote:

    >Suppose I have a XML document, in a format such as RSS.
    >I then use a reference to a well-known HTML entity, such as &eacute;
    >
    >Clearly this isn't "correct" (the entity is unknown) - but is this
    >an error of well-formedness (i.e. at the XML level) or an error of
    >validity (incompatible with the referenced schema) ?


    That depends.

    If there is no external DTD, and standalone="yes" is not specified,
    then it is only a validity error. The reason for this is that a
    parser that doesn't read the external DTD can't be sure that there
    isn't a declaration there.

    If there is no external DTD, or standalone="yes" is specified, then
    any processor can be sure that there isn't a declaration, and the
    error is a well-formedness error.

    Bear in mind that even if it's "only" a validity error, many programs
    will not be able to process such a document because they require fully
    expanded documents. XSLT is a typical example of this.

    Also bear in mind that DTD validation is the only kind of validation
    related to entity declarations. Other schema mechanisms (XML Schemas,
    RelaxNG, Schematron etc) do not address this issue because they are
    not tied in to parsing in the way that DTD validation is.

    -- Richard
     
    Richard Tobin, Oct 15, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. wtsnet
    Replies:
    4
    Views:
    680
    wtsnet
    Nov 25, 2003
  2. Assimalyst
    Replies:
    4
    Views:
    14,106
    Brock Allen
    Jul 25, 2005
  3. Replies:
    4
    Views:
    648
    Diez B. Roggisch
    Mar 27, 2007
  4. Pablo Rey
    Replies:
    8
    Views:
    3,362
    Lawrence D'Oliveiro
    Aug 31, 2007
  5. pt
    Replies:
    3
    Views:
    514
Loading...

Share This Page