Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > extending a scheme

Reply
Thread Tools

extending a scheme

 
 
Stefan Froehlich
Guest
Posts: n/a
 
      07-31-2011
I receive, validate and process XML files satisfying a given XSD (which is
<http://www.epaxios.com/bmecat_2005.xsd> to be precise). Now one of my
customers extends his XML-files (manually, without scheme or validation)
from something like:

| [...]
| <FEATURE_CONTENT>
| <FT_DATATYPE>alphanumeric</FT_DATATYPE>
| <FT_VALUES>
| <FT_VALUE>
| <VALUE_SIMPLE>Name</VALUE_SIMPLE>
| <CONFIG_INFO>
| <CONFIG_CODE>CODE</CONFIG_CODE>
| </CONFIG_INFO>
| </FT_VALUE>
| [...]
| </FT_VALUES>
| <FT_MANDATORY>true</FT_MANDATORY>
| </FEATURE_CONTENT>
| [...]

to

| <FEATURE_CONTENT>
| <FT_DATATYPE>alphanumeric</FT_DATATYPE>
| <FT_VALUES mandatory="false">
| <FT_VALUE>
| <VALUE_SIMPLE>Name</VALUE_SIMPLE>
| <CONFIG_INFO>
| <CONFIG_CODE>CODE</CONFIG_CODE>
| </CONFIG_INFO>
| <FT_REFERENCE>
| <FT_ID_TO>FEATURE_ID</FT_ID_TO>
| <FT_VALUES mandatory="false">
| <FT_VALUE>
| <VALUE_SIMPLE>Foo</VALUE_SIMPLE>
| </FT_VALUE>
| [...]
| </FT_VALUES>
| </FT_REFERENCE>
| </FT_VALUE>
| [...]
| </FT_VALUES>
| <FT_MANDATORY>true</FT_MANDATORY>
| </FEATURE_CONTENT>

So basically one attribute "mandatory" is added and an addtional complex
type "FT_REFERENCE" is introduced.

I want to validate this, and I want to validate it with the same scheme I
use for all the other files, too. So I am looking for a (the?) correct
way to extend the existing scheme to my needs. Namespaces came to my mind
first, e.g. something like:

| <FEATURE_CONTENT>
| <cust:FT_VALUES mandatory="false">
| <cust:FT_VALUE>
| [...]
| </cust:FT_VALUE>
| </cust:FT_VALUES>
| </FEATURE_CONTENT>

But this requires FEATURE_CONTENT to be redefined. As I learned (my
understanding of XML is a at rather basic level) there is something
called "redefine", which - unfortunately - works only on complex types
having a destinctiv name, which is not the case here.

Is there any - correct and elegant - way to do what I want _without_
copying and adapting the original XSD (which seems to be extremely ugly
to me)?

Bye,
Stefan

--
http://kontaktinser.at/ - die kostenlose Kontaktboerse fuer Oesterreich
Offizieller Erstbesucher(TM) von mmeike

Stefan - die eleganteste Potenz von sehenswert!
(Sloganizer)
 
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
Do we use the classful address scheme yet? minseokoh@hanafos.com Cisco 2 11-18-2005 02:43 PM
fast universal compression scheme and its implementation in VHDL Jens Mander VHDL 2 09-01-2005 10:08 PM
fast universal compression scheme and its implementation in VHDL Jens Mander VHDL 0 06-10-2005 06:28 AM
IP Address Scheme for Multiple DMZs on Multiple PIXs Scotchy Cisco 2 10-07-2004 03:35 PM
501 Protocol scheme 'file' is not supported Joachim Smit Perl 2 04-23-2004 07:37 AM



Advertisments