Note that there are some explanatory texts on larger screens.

plurals
  1. POXSD and plain text
    text
    copied!<p>I have a rest/xml service that gives me the following...</p> <pre><code>&lt;verse-unit unit-id="38009001"&gt; &lt;marker class="begin-verse" mid="v38009001"/&gt; &lt;begin-chapter num="9"/&gt;&lt;heading&gt;Judgment on Israel&amp;apos;s Enemies&lt;/heading&gt; &lt;begin-block-indent/&gt; &lt;begin-paragraph class="line-group"/&gt; &lt;begin-line/&gt;&lt;verse-num begin-chapter="9"&gt;1&lt;/verse-num&gt;The burden of the word of the &lt;span class="divine-name"&gt;Lord&lt;/span&gt; is against the land of Hadrach&lt;end-line class="br"/&gt; &lt;begin-line class="indent"/&gt;and Damascus is its resting place.&lt;end-line class="br"/&gt; &lt;begin-line/&gt;For the &lt;span class="divine-name"&gt;Lord&lt;/span&gt; has an eye on mankind&lt;end-line class="br"/&gt; &lt;begin-line class="indent"/&gt;and on all the tribes of Israel,&lt;footnote id="f1"&gt; A slight emendation yields &lt;i&gt; For to the &lt;span class="divine-name"&gt;Lord&lt;/span&gt; belongs the capital of Syria and all the tribes of Israel &lt;/i&gt; &lt;/footnote&gt;&lt;end-line class="br"/&gt; &lt;/verse-unit&gt; </code></pre> <p>I used visual studio to generate a schema from this and used XSD.EXE to generate classes that I can use to deserialize this mess into programmable stuff.</p> <p>I got everything to work and it is deserialized perfectly (almost).</p> <p>The problem I have is with the random text mixed throughout the child nodes. The generated verse-unit objects gives me a list of objects (begin-line, begin-block-indent, etc), and also another list of string objects that represent the bits of string throughout the xml.</p> <p>Here is my schema</p> <pre><code>&lt;xs:element maxOccurs="unbounded" name="verse-unit"&gt; &lt;xs:complexType mixed="true"&gt; &lt;xs:sequence&gt; &lt;xs:choice maxOccurs="unbounded"&gt; &lt;xs:element name="marker"&gt; &lt;xs:complexType&gt; &lt;xs:attribute name="class" type="xs:string" use="required" /&gt; &lt;xs:attribute name="mid" type="xs:string" use="required" /&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; &lt;xs:element name="begin-chapter"&gt; &lt;xs:complexType&gt; &lt;xs:attribute name="num" type="xs:unsignedByte" use="required" /&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; &lt;xs:element name="heading"&gt; &lt;xs:complexType mixed="true"&gt; &lt;xs:sequence minOccurs="0"&gt; &lt;xs:element name="span"&gt; &lt;xs:complexType&gt; &lt;xs:simpleContent&gt; &lt;xs:extension base="xs:string"&gt; &lt;xs:attribute name="class" type="xs:string" use="required" /&gt; &lt;/xs:extension&gt; &lt;/xs:simpleContent&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; &lt;/xs:sequence&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; &lt;xs:element name="begin-block-indent" /&gt; &lt;xs:element name="begin-paragraph"&gt; &lt;xs:complexType&gt; &lt;xs:attribute name="class" type="xs:string" use="required" /&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; &lt;xs:element name="begin-line"&gt; &lt;xs:complexType&gt; &lt;xs:attribute name="class" type="xs:string" use="optional" /&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; &lt;xs:element name="verse-num"&gt; &lt;xs:complexType&gt; &lt;xs:simpleContent&gt; &lt;xs:extension base="xs:unsignedByte"&gt; &lt;xs:attribute name="begin-chapter" type="xs:unsignedByte" use="optional" /&gt; &lt;/xs:extension&gt; &lt;/xs:simpleContent&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; &lt;xs:element name="end-line"&gt; &lt;xs:complexType&gt; &lt;xs:attribute name="class" type="xs:string" use="optional" /&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; &lt;xs:element name="end-paragraph" /&gt; &lt;xs:element name="end-block-indent" /&gt; &lt;xs:element name="end-chapter" /&gt; &lt;/xs:choice&gt; &lt;/xs:sequence&gt; &lt;xs:attribute name="unit-id" type="xs:unsignedInt" use="required" /&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; </code></pre> <p>WHAT I NEED IS THIS. I need the random text that is NOT surrounded by an xml node to be represented by an object so I know the order that everything is in.</p> <p>I know this is complicated, so let me try to simplify it.</p> <p><code>&lt;field name="test_field_0"&gt;<br> Some text I'm sure you don't want.<br> &lt;subfield&gt;Some text.&lt;/subfield&gt;<br> More text you don't want.<br> &lt;/field&gt;</code></p> <p>I need the xsd to generate a field object with items that can have either a text object, or a subfield object. I need to no where the random text is within the child nodes.</p>
 

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