extending a scheme

Discussion in 'XML' started by Stefan Froehlich, Jul 31, 2011.

  1. 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)
     
    Stefan Froehlich, Jul 31, 2011
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jens Mander
    Replies:
    0
    Views:
    520
    Jens Mander
    Jun 10, 2005
  2. Jens Mander
    Replies:
    2
    Views:
    1,422
    Jerry Coffin
    Sep 1, 2005
  3. Joachim Smit
    Replies:
    2
    Views:
    1,022
    Joachim Smit
    Apr 23, 2004
  4. Steve - DND

    Implementing a Permissions Scheme

    Steve - DND, Mar 5, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    314
    Steve - DND
    Mar 5, 2004
  5. sqlvs

    Application encryption scheme

    sqlvs, Jun 15, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    1,535
    sqlvs
    Jun 19, 2004
Loading...

Share This Page