471,086 Members | 1,451 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,086 software developers and data experts.

Extending an existing XML format

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:object-identifier>1.2.3.4.5.6.7.8.9</dsml:object-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:object-identifier>1.2.3.4.5.6.7.8.9</dsml:object-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

May 18 '07 #1
1 1619
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/#Co...pe_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
May 19 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

75 posts views Thread by David MacQuigg | last post: by
4 posts views Thread by Brandon Miller | last post: by
3 posts views Thread by Redefined Horizons | last post: by
2 posts views Thread by A. Farber | last post: by
21 posts views Thread by Daz | last post: by
17 posts views Thread by Rudi Hausmann | last post: by
7 posts views Thread by Maximus Decimus | last post: by
1 post views Thread by Andreas M. | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.