Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > schema and default xml

Reply
Thread Tools

schema and default xml

 
 
inquirydog
Guest
Posts: n/a
 
      07-13-2004
Hi-

I am using xml to hold configuration data for a project, and
using
schema to define what the configuration file should look like. I
wanted to
get some advice on an intelligant way to specify and create a default
config
file. In other words, when the developer puts a new element in the
schema
(ie, backgroundColor), (s)he should also specify the default value
(ie- green). This could be done in the same file as the schema (I
could for certain circumstances use the xsl:default attribute for
simpletypes), or in another file (we could just specify the actual
default value). Then I would like to be able to do the following:

1). Autogenerate the default file from however it is
specified.

2). In the case of a version upgrade in the schema
(configuration file), automatically add in the default values to the
actual configuration file for elements that are added. In other
words, if version 1 only has a "backgroundColor" element, which in the
config file is "rose", and in version 2 the schema adds a
"forgroundColor" with default value "white", a new default file will
be generated by merging the actual config file with the default of the
new version (bgcolor=rose, fgcolor=white- the default fgcolor is taken
since that element is new, the bgcolor default is not set since that
was already specified in the old config file.

In theory this can be done the following way.

1). Encode defaults in the xsd file. For simpleType there is
a xsd:default attribute which would work, for lists something else
would need to be done.

2). Use xslt to translate the data in the xsd file described
in 1). to an xml file.

3). Use some sort of xmldiff program to diff the config file
from the default.

4). Apply the result to the version n+1 default file to build
the new default.

I am unaware of what good xmldiff and xmlmerge style programs
exist to do this. Suggestiong on any of this idea?

thanks
-Inquirydog
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
web.xml / XML schema issue, why do some XML schema attributes disappear asciz@starmail.com Java 3 02-20-2007 09:56 AM
Validation with XSD using XML::LibXML::Schema, and XML::Validator::Schema huntingseasonson@gmail.com Perl Misc 5 11-29-2006 12:37 PM
[XML Schema] Including a schema document with absent target namespace to a schema with specified target namespace Stanimir Stamenkov XML 3 04-25-2005 09:59 AM
XML Schema to XML Schema Conversion Hari Om XML 1 03-02-2004 09:04 PM
XML schema regular expressions question and recommended XML Schema book Fred Smith XML 1 02-05-2004 11:12 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57