0

I am working with an xsd which I'm expanding on: "http://opcfoundation.org/UA/ModelDesign.xsd".

The relevant part I'm currently stuck on is below. I have a new ComplexType ExtendedObjectDesign in my local XSD that is equivalent to an "ObjectDesign" which in turns extends InstanceDesign and NodeDesign (all from ModuleDesign.xsd). The only difference between my ExtendedObjectDesign and the below ObjectDesign is that my "Children" can include a new type which also inherits from 'InstanceDesign' as do all the items currently in children. I am a loss as how to proceed. I have tried extending/redefining the "ListOfChildren" type but I always get format errors.

Any suggestions would be appreciated.

NodeDesign from ModuleDesign.xsd (The type ObjectDesign ultimately implements)

<xs:complexType name="NodeDesign">
    <xs:annotation>
      <xs:documentation>
        <html:p>
          The base type of all node designs.
        </html:p>
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
       ...
       ...
       <xs:element name="Children" type="ListOfChildren" minOccurs="0">
        <xs:annotation>
          <xs:documentation>
            <html:p>
              The Children are the Properties or Components of a Node.
            </html:p>
          </xs:documentation>
        </xs:annotation>
      </xs:element>
      ...
    </xs:sequence>
     ...
  </xs:complexType>

ListOfChildren from ModuleDesign.xsd

  <xs:complexType name="ListOfChildren">
    <xs:sequence>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="Object" type="ObjectDesign" minOccurs="0" />
        <xs:element name="Variable" type="VariableDesign" minOccurs="0" />
        <xs:element name="Property" type="PropertyDesign" minOccurs="0" />
        <xs:element name="Method" type="MethodDesign" minOccurs="0" />
      </xs:choice>
    </xs:sequence>
  </xs:complexType>

I want to redefine ListOfChildren (hopefully universally as I still use ListOfChildren other places to include the new item below. ListOfChildren from ModuleDesign.xsd

  <xs:complexType name="ListOfChildren">
    <xs:sequence>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="Object" type="ObjectDesign" minOccurs="0" />
        <xs:element name="Variable" type="VariableDesign" minOccurs="0" />
        <xs:element name="Property" type="PropertyDesign" minOccurs="0" />
        <xs:element name="Method" type="MethodDesign" minOccurs="0" />
        <xs:element name="MyType" type="MyTypeDesign" minOccurs="0" />
      </xs:choice>
    </xs:sequence>
  </xs:complexType>
HelpfulPaul
  • 68
  • 1
  • 4
  • You have explained the background to your problem very well, but you have not provided details of the actual problem. I think you probably need a , so please provide the XML that you need to model and your modification to the xsds. Please remember to quote the error message(s) that you get for each scenario. – kimbert Jan 16 '23 at 17:43

0 Answers0