Note that there are some explanatory texts on larger screens.

plurals
  1. POSpring configuration file cannot parse elements defined in my own schema
    text
    copied!<p>I have a very simple xsd which defines an element "cache"</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt; &lt;xsd:schema xmlns="http://mysite/schema/cache" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://mysite/schema/cache"&gt; &lt;xsd:complexType name="objectType" abstract="false"&gt; &lt;xsd:attribute name="target" type="xsd:string"&gt; &lt;/xsd:attribute&gt; &lt;/xsd:complexType&gt; &lt;xsd:complexType name="cacheType"&gt; &lt;xsd:sequence&gt; &lt;xsd:element name="object" type="xsd:string" maxOccurs="unbounded" /&gt; &lt;/xsd:sequence&gt; &lt;/xsd:complexType&gt; &lt;xsd:element name="cache" type="cacheType"&gt;&lt;/xsd:element&gt; &lt;/xsd:schema&gt; </code></pre> <p>I have a spring config file with :</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;objects xmlns="http://www.springframework.net" xmlns:cache="http://mysite/schema/cache" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://mysite/schema/cache http://mysite/cache.xsd"&gt; &lt;description&gt; &lt;/description&gt; &lt;cache:cache&gt; &lt;cache:object target="site"/&gt; &lt;/cache:cache&gt; &lt;/objects&gt; </code></pre> <p>During the call to </p> <pre><code>Spring.Objects.Factory.Xml.XmlObjectDefinitionReader.DoLoadObjectDefinitions at startup, I get the following error: [XmlSchemaValidationException: The 'http://mysite/schema/cache:cache' element is not declared.] </code></pre> <p>This suggests that spring cant find my schema, but the xsd is available.</p> <p>Any ideas why this isnt working?</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