XML jargon: declaration vs. definition

Discussion in 'XML' started by Razvan, Feb 9, 2005.

  1. Razvan

    Razvan Guest

    Hi !





    Consider the following XML element:

    <!ELEMENT value (#PCDATA)>
    <!ATTLIST value year CDATA #IMPLIED>

    Is this a declaration or a definition ? In Java/C++ there is a clear
    distinction between declaration and definition.
    How about XML ?




    Regards,
    Razvan
    Razvan, Feb 9, 2005
    #1
    1. Advertising

  2. In article <>,
    Razvan <> wrote:

    > Is this a declaration or a definition ? In Java/C++ there is a clear
    >distinction between declaration and definition.
    >How about XML ?


    XML doesn't have such a distinction. What would it mean?

    -- Richard
    Richard Tobin, Feb 9, 2005
    #2
    1. Advertising

  3. Razvan

    Razvan Guest

    > XML doesn't have such a distinction. What would it mean?

    You can certainly imagine things, like: when an element
    appears inside an xml instance it is declared, *but* if it is not
    defined inside the associated DTD/"XML Schema" then you have an error.
    The same if it is not properly defined.
    I am not asking about "imaginative things" but about the state
    of the matters. You are saying that I can interchangeably use the term
    "definition" and "declaration" because they have the same meaning in
    XML. CORECT ?



    Regards,
    Razvan
    Razvan, Feb 9, 2005
    #3
  4. Razvan wrote:


    > I am not asking about "imaginative things" but about the state
    > of the matters. You are saying that I can interchangeably use the term
    > "definition" and "declaration" because they have the same meaning in
    > XML. CORECT ?


    I don't think so, for instance the XML 1.0 specification here
    <http://www.w3.org/TR/REC-xml/>
    defines what "the XML declaration" in an XML document is e.g. the
    <?xml version="1.0" encoding="UTF-8"?>
    at the beginning of the document and that should be called "XML
    declaration" then and not "XML definition".
    An XML document can also contain a "document type declaration" and that
    should be called that way and not "document type definition" as that is
    something different, the XML document contains a <!DOCTYPE ...>
    "document type declaration" node which contais or points to a grammar,
    the DTD or "document type definition", see
    <http://www.w3.org/TR/REC-xml/#sec-prolog-dtd>

    So while the XML 1.0 specification uses both terms, "declaration" and
    "definition", the proper term should be used in the proper context as
    defined by the specification.



    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Feb 9, 2005
    #4
  5. Razvan

    Razvan Guest

    Anybody care to comment ?


    Razvan
    Razvan, Feb 10, 2005
    #5
    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. Rhino

    Animation jargon

    Rhino, Oct 29, 2005, in forum: Java
    Replies:
    12
    Views:
    2,581
    Andrew Thompson
    Nov 9, 2005
  2. Jianli Shen
    Replies:
    1
    Views:
    557
    Victor Bazarov
    Mar 13, 2005
  3. Ark
    Replies:
    1
    Views:
    398
    Chris Torek
    Aug 7, 2004
  4. Jon Slaughter
    Replies:
    4
    Views:
    424
    Jon Slaughter
    Oct 26, 2005
  5. Exception Jargon

    , Jul 8, 2007, in forum: Java
    Replies:
    10
    Views:
    672
    Twisted
    Jul 14, 2007
Loading...

Share This Page