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. Advertisements

  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. Advertisements

  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. Advertisements

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:
    879
    wtsnet
    Nov 25, 2003
  2. Assimalyst
    Replies:
    4
    Views:
    15,436
    Brock Allen
    Jul 25, 2005
  3. mike
    Replies:
    3
    Views:
    15,034
    Karl Seguin
    Nov 24, 2005
  4. Nathan Sokalski

    DataList Creates Tables That Are Not Well-Formed

    Nathan Sokalski, Nov 30, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    492
    Nathan Sokalski
    Nov 30, 2005
  5. Rimu Atkinson

    how is this XML not well-formed???

    Rimu Atkinson, Jul 9, 2003, in forum: XML
    Replies:
    1
    Views:
    1,225
    Peter Flynn
    Jul 15, 2003
  6. Replies:
    4
    Views:
    790
    Diez B. Roggisch
    Mar 27, 2007
  7. Pablo Rey
    Replies:
    8
    Views:
    4,591
    Lawrence D'Oliveiro
    Aug 31, 2007
  8. pt
    Replies:
    3
    Views:
    726
Loading...