Skip to content

XSD with xs:redefine #11

@stckcrsh

Description

@stckcrsh

Sorry i dont know if this is an issue or I am doing this completely wrong

I have two xsd files that i am trying to parse
The first has some complex types basic stuff, but the second one has xs:redefine to alter the complex types from the first xsd

example
base.xsd

<xs:complexType name="transaction">
    <xs:sequence>
        <xs:element name="id" type="xs:string" minOccurs="0"/>
        <xs:element name="timestamp" type="xs:dateTime" minOccurs="0"/>
    </xs:sequence>
</xs:complexType>

extend.xsd

<xs:redefine schemaLocation="base.xsd">
  <xs:complexType name="transaction">
    <xs:complexContent>
        <xs:extension base="transaction">
            <xs:sequence>
                <xs:element name="partial" type="xs:string" minOccurs="0" />
                <xs:element name="originSrc" type="xs:string" minOccurs="0" />
                <xs:element name="originalPrd" type="xs:string" minOccurs="0" />
                <xs:element name="crn" type="xs:string" minOccurs="0" />
            </xs:sequence>
        </xs:extension>
    </xs:complexContent>
  </xs:complexType> 
</xs:redefine

This is the resulting Typescript i get

interface _transaction extends BaseType {
    id?: string;
    timestamp?: Date;
}
export interface transaction extends _transaction { constructor: { new(): transaction }; }
export var transaction: { new(): transaction };

As I said earlier this might not be an issue, but a problem with how things are done on my side. As some backstory we are upgrading the frontend on an old service that my company has to angular2. They do not want to update any of the server stuff (all the xsds) and i have to generate visualizations off this data that is returned and i do not wish to go through all the xsd files they have and manually try to get this data in.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions