Extending an existing XML format

  • Thread starter =?iso-8859-1?q?Fran=E7ois_Beretti?=
  • Start date
?

=?iso-8859-1?q?Fran=E7ois_Beretti?=

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
 
J

Joe Kesselman

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top