Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to realize derived response (XSD)?
    primarykey
    data
    text
    <p>I am searching for the best solution of my <code>XML</code> schema (<code>XSD</code>).</p> <p>I have a <code>response</code>:</p> <pre><code>&lt;xs:element name="exampleCatalogResponse"&gt; &lt;xs:complexType&gt; &lt;xs:sequence&gt; &lt;xs:element name="meta" type="tns:metaType" /&gt; &lt;xs:element name="data" type="tns:defaultDataType" /&gt; &lt;/xs:sequence&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; </code></pre> <p>...the <code>defaultDatatype</code>:</p> <pre><code>&lt;xs:complexType name="defaultDataType"&gt; &lt;xs:sequence&gt; &lt;xs:element name="catalog"&gt; &lt;xs:complexType&gt; &lt;xs:sequence maxOccurs="unbounded"&gt; &lt;xs:element name="catalogItem" type="tns:catalogItem" /&gt; &lt;/xs:sequence&gt; &lt;/xs:complexType&gt; &lt;xs:unique name="itemIdConstraint"&gt; &lt;xs:selector xpath="tns:catalogItem" /&gt; &lt;xs:field xpath="tns:id" /&gt; &lt;/xs:unique&gt; &lt;/xs:element&gt; &lt;/xs:sequence&gt; &lt;/xs:complexType&gt; </code></pre> <p>...and the <code>catalogItem</code>:</p> <pre><code>&lt;xs:complexType name="catalogItem"&gt; &lt;xs:sequence&gt; &lt;xs:element name="id" type="xs:nonNegativeInteger" /&gt; &lt;/xs:sequence&gt; &lt;/xs:complexType&gt; </code></pre> <p>...but now there is a special item which specialize <code>catalogItem</code>:</p> <pre><code>&lt;xs:complexType name="specialItem"&gt; &lt;xs:complexContent&gt; &lt;xs:extension base="tns:catalogItem"&gt; &lt;xs:sequence&gt; &lt;xs:element name="code" type="xs:string" /&gt; &lt;/xs:sequence&gt; &lt;/xs:extension&gt; &lt;/xs:complexContent&gt; &lt;/xs:complexType&gt; </code></pre> <p>Now I need an specialized <code>Response</code> for my <code>specialItem</code> for answering the request which expects this <code>specialItem</code>.</p> <p>How can I realise this, without writing another <code>defaultDataType</code> where only the type of <code>catalogItem</code> changes to <code>tns:specialItem</code>?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload