Flatten XSD

Discussion in 'XML' started by mre@dublin.ie, May 6, 2005.

  1. Guest

    Is there a program that will flatten an XSD, that is, will transform...

    <xsd:element name="name" type="nameType"/>

    <xsd:complexType name="nameType">
    <xsd:sequence>
    <xsd:element name="firstname" type="xsd:string"/>
    <xsd:element name="surname" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>

    ....into...

    <xsd:element name="name">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="firstname" type="xsd:string"/>
    <xsd:element name="surname" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>

    .... It should also handle includes/imports, merge complexContent, and
    what have you?

    I want to be able to take multiple XSDs, most of which contain just
    type information in various namespaces, and turn it all it one big
    file, one namespace.

    If there is no program that can do this I'll write one myself. However,
    as I'm an XSD beginner; how does complexContent and group merge? I'm
    guessing that, other than these two, the rest is as straight-forward as
    my example above - is there anything I need to watch out for?

    Thank you for any help,
    Regards,
    MRe
    , May 6, 2005
    #1
    1. Advertising

  2. Guest

    I've started writing a prog myself and would appreciate any helps
    anyone can give

    What does <xsd:element ref="foo:bar"> mean? Do I replace that element
    with the 'bar' element? The bar element looks like this <xsd:element
    name="bar" type="foo:barType" abstract="true">. It seems to me that ref
    and type are almost the same thing?

    Also,
    This is short version of something I got off www.w3schools.com...

    <xsd:element name="employee" type="fullpersoninfo"/>
    <xsd:complexType name="personinfo">
    <xsd:sequence><xsd:element name="firstname"
    type="xsd:string"/></xsd:sequence>
    <xsd:attribute name="lastUpdateDate" type="xsd:date" use="optional" />
    </xsd:complexType>
    <xsd:complexType name="fullpersoninfo">
    <xsd:complexContent>
    <xsd:extension base="personinfo">
    <xsd:sequence><xsd:element name="address"
    type="xsd:string"/></xsd:sequence>
    </xsd:extension>
    </xsd:complexContent>
    </xsd:complexType>

    ....should it become...

    <xsd:element name="employee">
    <xsd:complexType >
    <xsd:complexContent>
    <xsd:sequence><xsd:element name="firstname"
    type="xsd:string"/></xsd:sequence>
    <xsd:attribute name="lastUpdateDate" type="xsd:date" use="optional"
    />
    <xsd:sequence><xsd:element name="address"
    type="xsd:string"/></xsd:sequence>
    </xsd:complexContent>
    </xsd:complexType>
    </xsd:element>

    ....or should the double xsd:sequence be grouped into one, or should
    something else happen, or what?

    Also,
    What does group and substitutionGroup mean for my program.

    Please help, please!
    Thank you,
    Regards,
    MRe
    , May 6, 2005
    #2
    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. Markus
    Replies:
    1
    Views:
    1,081
    Markus
    Nov 22, 2005
  2. Rick Razzano

    XSD document for XSD defintion

    Rick Razzano, Sep 26, 2003, in forum: XML
    Replies:
    1
    Views:
    469
    C. M. Sperberg-McQueen
    Sep 26, 2003
  3. Replies:
    1
    Views:
    848
    Martin Honnen
    Jan 14, 2004
  4. Francis Avila
    Replies:
    0
    Views:
    455
    Francis Avila
    Nov 2, 2003
  5. Replies:
    2
    Views:
    379
    Steve Pope
    Sep 27, 2006
Loading...

Share This Page