extending a scheme

S

Stefan Froehlich

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)
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top