Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There is nothing in your schema that says that the schema itself should be added to the instance document.</p> <p>You would need something like:</p> <pre><code>&lt;xs:element name="transaction" msdata:IsDataSet="true" msdata:UseCurrentLocale="true"&gt; &lt;xs:complexType&gt; &lt;xs:choice minOccurs="0" maxOccurs="unbounded"&gt; &lt;!-- Adding an element that can supports the schema definition --&gt; &lt;xs:element ref="xs:schema" minOccurs="0" maxOccurs="1"/&gt; &lt;!-- and from here on, what you already have : --&gt; &lt;xs:element name="id"&gt; &lt;xs:complexType&gt; &lt;xs:sequence&gt; &lt;xs:element name="in" type="xs:string" minOccurs="0" /&gt; &lt;xs:element name="sn" type="xs:string" minOccurs="0" /&gt; &lt;xs:element name="book" type="xs:string" minOccurs="0" /&gt; &lt;xs:element name="author" type="xs:string" minOccurs="0" /&gt; &lt;/xs:sequence&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; ... </code></pre> <p>And then you'd have to insert the schema into your transaction JAXB object for it to show up in your instance document.</p> <p>Now, I would like to know more about your use case: are you sure you need to do this ? The document itself (the transaction XML) could simply specify the schema it conforms to, and even specify a location e.g. :</p> <pre><code> &lt;transaction xmlns="urn:mytransactionschema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.example.com/transaction.xsd" &gt; </code></pre> <p>This should give consumers of your instance document the ability to validate the XML better than by including it in the instance doc.</p>
    singulars
    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.
    1. This table or related slice is empty.
    1. VO
      singulars
      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