Extending an existing XML format

Discussion in 'XML' started by =?iso-8859-1?q?Fran=E7ois_Beretti?=, May 18, 2007.

  1. Hi,

    I want to design an XML format for my application. Documents using
    this format will describe LDAP classes and attributes. I have found
    the DSML format ( http://xml.coverpages.org/dsmlv1.html ) which does a
    part of what I want.

    But I want to add some information to it. For example, with DSML I can
    write :

    <dsml:attribute-type
    id="myAttribute">
    <dsml:name>myAttribute</dsml:name>
    <dsml:description>Some description</dsml:description>
    <dsml:eek:bject-identifier>1.2.3.4.5.6.7.8.9</dsml:eek:bject-identifier>
    </dsml:attribute-type>

    And I need more information, like :

    <dsml:attribute-type
    id="myAttribute">
    <dsml:name>myAttribute</dsml:name>
    <dsml:description>Some description</dsml:description>
    <dsml:eek:bject-identifier>1.2.3.4.5.6.7.8.9</dsml:eek:bject-identifier>
    <schema-guid>{4f56d89ed-4578-32c9-456e-4879cf3641ab}</schema-guid>
    <indexed>true</indexed>
    </dsml:attribute-type>

    What are the best practices to extend an existing XML format ? If I
    add some elements, will the document still respect the original
    schema ?

    DSML use xmlns:dsml="http://www.dsml.org/DSML" (don't try this uri, it
    is broken)

    if I write my namespace, can I refer to the DSML namespace ? Same
    question for a XML Schema.

    I read the XML docs but did not understand everything. I searched the
    web without success. If there are some examples you can just show me.

    Thank you very much

    Fran├žois
    =?iso-8859-1?q?Fran=E7ois_Beretti?=, May 18, 2007
    #1
    1. Advertising

  2. Schemas can be allow themselves to be extended via extension/restriction
    of complex types; see the Schema Structures document for a discussion of
    how to do this. (Look for discussion of "derivation" and "derived types")

    http://www.w3.org/TR/xmlschema-1/#Complex_Type_Definitions

    However, schemas can also impose limits on derivation, so whether you
    can create a derived type that adds the fields you want will depend on
    how the original schema was written. Read that schema, or try it and see
    if it works.

    > if I write my namespace, can I refer to the DSML namespace ? Same
    > question for a XML Schema.


    Schemas can refer to things defined by other schema documents.

    Namespaces don't "refer to" anything; they are only a way to manage the
    names of things so we don't wind up with conflicting definitions of the
    same element or attribute.

    --
    () ASCII Ribbon Campaign | Joe Kesselman
    /\ Stamp out HTML e-mail! | System architexture and kinetic poetry
    Joe Kesselman, May 19, 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. nrm
    Replies:
    3
    Views:
    517
  2. Lee Falataco
    Replies:
    2
    Views:
    344
    Bullschmidt
    Aug 10, 2004
  3. Marc Heiler

    Extending to an existing case menu

    Marc Heiler, Nov 24, 2007, in forum: Ruby
    Replies:
    1
    Views:
    93
    Phrogz
    Nov 24, 2007
  4. Replies:
    0
    Views:
    176
  5. Andreas M.
    Replies:
    0
    Views:
    64
    Andreas M.
    May 5, 2008
Loading...

Share This Page