Note that there are some explanatory texts on larger screens.

plurals
  1. PODefault value from DTD in xStream
    primarykey
    data
    text
    <p>Geven XML file</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;!DOCTYPE ExternalRequestContext [ &lt;!ELEMENT ExternalRequestContext EMPTY&gt; &lt;!ATTLIST ExternalRequestContext requestType CDATA #REQUIRED deepEnrichment (true | false) "false" channelMandatory (true | false) "true"&gt; ] &gt; &lt;ExternalRequestContext requestType="News" deepEnrichment="false" /&gt; </code></pre> <p>And xStream code</p> <pre><code>@XStreamAlias("ExternalRequestContext") class ERC { private String requestType; private boolean deepEnrichment; private boolean channelMandatory; } ... XStream x = new XStream(); x.processAnnotations(ERC.class); ERC erc = (ERC)x.fromXML(new FileReader("C:/Projects/Forwarder/Test.xml")); x.toXML(erc, System.out); </code></pre> <p>My browser renders it as following:</p> <pre><code>&lt;ExternalRequestContext requestType="News" deepEnrichment="false" channelMandatory="true" /&gt; </code></pre> <p>Note that <strong>channelMandatory="true"</strong> (browser processed the DTD instruction)</p> <p>while xStream produces</p> <pre><code>&lt;ExternalRequestContext&gt; &lt;deepEnrichment&gt;false&lt;/deepEnrichment&gt; &lt;channelMandatory&gt;false&lt;/channelMandatory&gt; &lt;/ExternalRequestContext&gt; </code></pre> <p>Here <strong>channelMandatory="false"</strong> (xStream ignored the "channelMandatory (true | false) "true"" DTD instruction)</p> <p>What do I miss? How to "tell" xStream to process DTD instructions? And how do I enable DTD validation in xStream?</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.
 

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