What should i change in this XSD

11 Views Asked by At

I have a question with regards to this XSD:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://ns.hr-xml.org/2007-04-15" xmlns:ns="http://ns.setu.nl/2008-01" xmlns:ns2="http://vms.netive.nl/2019-10-14" targetNamespace="http://ns.hr-xml.org/2007-04-15" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="HumanResource">
<xs:complexType>
<xs:sequence>
<xs:element name="HumanResourceId">
<xs:complexType>
<xs:sequence>
<xs:element name="IdValue" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="name" type="xs:string" use="optional"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Assignment">
<xs:complexType>
<xs:sequence>
<xs:element name="AssignmentId">
<xs:complexType>
<xs:sequence>
<xs:element name="IdValue" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="name" type="xs:string" use="optional"/>  
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="assignmentStatus" type="xs:string"/>  
</xs:complexType>
</xs:element>
<xs:element name="NetiveType">
<xs:complexType> 
<xs:sequence>
<xs:element name="HumanResource"/>
<xs:element name="Assignment"/>
</xs:sequence>
</xs:complexType> 
</xs:element>
</xs:schema>

It is valid in ALTOVA-XMLSPY but when i look at "NetiveType" in grid view it show only the HumanResource and Assignment fields, but not the underlying HumanResourceId and AssignmentId fields.

What should i change in the xsd to make that happen?

I have tried various things like <xs:element ref="HumanResource"/> and <xs:element type="HumanResource"/> But they all lead to errors in XMLSPY

0

There are 0 best solutions below