Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>" if i comment out the AccountRequest.xsd value from the config and then run my tests again the marshal/unmarshal for the second class (AccountResponse) they all pass, if I then uncomment it I get the error: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'accountResponse'. "</p> </blockquote> <p>Sounds like the Schema object being created by SchemaFactory.newSchema() is only processing the first xsd in the list. </p> <p>If you have multiple schema files that are in the same namespace (targetNamespace?) then It could be this bug that is causing trouble: </p> <p><a href="https://issues.apache.org/jira/browse/XERCESJ-1130" rel="nofollow">https://issues.apache.org/jira/browse/XERCESJ-1130</a> </p> <p>What I did to work around this bug was creating a parent xsd file that included the other xsd files and then set the "schemaResourceResolver" property in the xml configuration with a LSResourceResolver implementation (See <a href="http://blog.frankel.ch/xml-validation-with-importedincluded-schemas" rel="nofollow">http://blog.frankel.ch/xml-validation-with-importedincluded-schemas</a> for example).. </p> <p>In your xml configuration add this: </p> <p>parent.xsd file looks like this:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.yourdomain.com/FIXED/EXAMPLE" targetNamespace="http://www.yourdomain.com/FIXED/EXAMPLE" elementFormDefault="qualified" version="1.000" id="some_id"&gt; &lt;xs:include schemaLocation="AccountRequest.xsd"/&gt; &lt;xs:include schemaLocation="AccountResponse.xsd"/&gt; &lt;/xs:schema&gt; </code></pre> <p>In your xml configuration change the schemas property to:</p> <pre><code>&lt;property name="schemas"&gt; &lt;list&gt; &lt;value&gt;classpath:schema/parent.xsd&lt;/value&gt; &lt;/list&gt; &lt;/property&gt; </code></pre>
    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. 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