ID/IDREF or Key/Keyref

Discussion in 'XML' started by Ridius, Oct 25, 2007.

  1. Ridius

    Ridius Guest

    Hello.

    I start to study XML and have a question. What`s the difference
    between ID/IDREF
    and Key/Keyref? What's better to use?

    Thanks.
    Ridius, Oct 25, 2007
    #1
    1. Advertising

  2. Ridius wrote:

    > I start to study XML and have a question. What`s the difference
    > between ID/IDREF
    > and Key/Keyref? What's better to use?


    DTDs only support ID/IDREF while XSD schemas additionally support
    key/keyref. ID values need to be unique in the complete document, with
    key values there is no such requirement for the complete document.
    Additionally you can form a key from various element or attribute
    values, that is not possible with ID. See
    <http://www.w3.org/TR/xmlschema-0/#specifyingKeysAndtheirRefs>

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Oct 25, 2007
    #2
    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. Marek Malowidzki

    Key/keyref validation in schema?

    Marek Malowidzki, Aug 18, 2003, in forum: XML
    Replies:
    1
    Views:
    507
    Mark Preston
    Aug 19, 2003
  2. J E E
    Replies:
    0
    Views:
    377
    J E E
    Nov 7, 2003
  3. peterpeter
    Replies:
    0
    Views:
    927
    peterpeter
    Feb 11, 2004
  4. Markus Seibold

    <key><keyref> does not work in XMLSpy

    Markus Seibold, Feb 13, 2004, in forum: XML
    Replies:
    0
    Views:
    1,308
    Markus Seibold
    Feb 13, 2004
  5. Replies:
    2
    Views:
    1,365
Loading...

Share This Page