title: The namespace associated with the prefix 'diffgr' could not be resolved.in castor
body: <p>i am getting following xml</p>
  
  <pre><code>&lt;root xmlns="urn:schemas-microsoft-com:xml-diffgram-v1"&gt;
  &lt;FromCity xmlns="" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"
      diffgr:id="FromCity1" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
      msdata:rowOrder="0"&gt;
      &lt;StateID&gt;1073&lt;/StateID&gt;
      &lt;State&gt;Ahmedabad&lt;/State&gt;
  &lt;/FromCity&gt;
  &lt;FromCity xmlns="" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"
      diffgr:id="FromCity2" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
      msdata:rowOrder="1"&gt;
      &lt;StateID&gt;1051&lt;/StateID&gt;
      &lt;State&gt;Amritsar&lt;/State&gt;
  &lt;/FromCity&gt;
  &lt;FromCity xmlns="" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"
      diffgr:id="FromCity3" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
      msdata:rowOrder="2"&gt;
      &lt;StateID&gt;1024&lt;/StateID&gt;
      &lt;State&gt;Bangalore&lt;/State&gt;
  &lt;/FromCity&gt;
  &lt;FromCity xmlns="" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"
      diffgr:id="FromCity4" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
      msdata:rowOrder="3"&gt;
      &lt;StateID&gt;1074&lt;/StateID&gt;
      &lt;State&gt;Bhopal&lt;/State&gt;
  &lt;/FromCity&gt;
  &lt;FromCity xmlns="" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"
      diffgr:id="FromCity5" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
      msdata:rowOrder="4"&gt;
      &lt;StateID&gt;1034&lt;/StateID&gt;
      &lt;State&gt;Chandigarh&lt;/State&gt;
  &lt;/FromCity&gt;
  &lt;FromCity xmlns="" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"
      diffgr:id="FromCity6" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
      msdata:rowOrder="5"&gt;
      &lt;StateID&gt;1025&lt;/StateID&gt;
      &lt;State&gt;Chennai&lt;/State&gt;
  &lt;/FromCity&gt;
  &lt;FromCity xmlns="" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"
      diffgr:id="FromCity7" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
      msdata:rowOrder="6"&gt;
      &lt;StateID&gt;1075&lt;/StateID&gt;
      &lt;State&gt;Dehradun&lt;/State&gt;
  &lt;/FromCity&gt;
  &lt;FromCity xmlns="" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"
      diffgr:id="FromCity8" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
      msdata:rowOrder="7"&gt;
      &lt;StateID&gt;1001&lt;/StateID&gt;
      &lt;State&gt;Delhi / NCR&lt;/State&gt;
  &lt;/FromCity&gt;
  &lt;FromCity xmlns="" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"
      diffgr:id="FromCity9" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
      msdata:rowOrder="8"&gt;
      &lt;StateID&gt;1062&lt;/StateID&gt;
      &lt;State&gt;Gwalior&lt;/State&gt;
  &lt;/FromCity&gt;
  &lt;FromCity xmlns="" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"
      diffgr:id="FromCity10" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
      msdata:rowOrder="9"&gt;
      &lt;StateID&gt;1011&lt;/StateID&gt;
      &lt;State&gt;Hyderabad&lt;/State&gt;
  &lt;/FromCity&gt;
  &lt;FromCity xmlns="" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"
      diffgr:id="FromCity11" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
      msdata:rowOrder="10"&gt;
      &lt;StateID&gt;1035&lt;/StateID&gt;
      &lt;State&gt;Jaipur&lt;/State&gt;
  &lt;/FromCity&gt;
  &lt;FromCity xmlns="" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"
      diffgr:id="FromCity12" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
      msdata:rowOrder="11"&gt;
      &lt;StateID&gt;1063&lt;/StateID&gt;
      &lt;State&gt;Jhansi&lt;/State&gt;
  &lt;/FromCity&gt;
  &lt;FromCity xmlns="" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"
      diffgr:id="FromCity13" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
      msdata:rowOrder="12"&gt;
      &lt;StateID&gt;1036&lt;/StateID&gt;
      &lt;State&gt;Jodhpur&lt;/State&gt;
  &lt;/FromCity&gt;
  &lt;FromCity xmlns="" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"
      diffgr:id="FromCity14" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
      msdata:rowOrder="13"&gt;
      &lt;StateID&gt;1064&lt;/StateID&gt;
      &lt;State&gt;Khajuraho&lt;/State&gt;
  &lt;/FromCity&gt;
  &lt;FromCity xmlns="" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"
      diffgr:id="FromCity15" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
      msdata:rowOrder="14"&gt;
      &lt;StateID&gt;1026&lt;/StateID&gt;
      &lt;State&gt;Kolkata&lt;/State&gt;
  &lt;/FromCity&gt;
  &lt;FromCity xmlns="" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"
      diffgr:id="FromCity16" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
      msdata:rowOrder="15"&gt;
      &lt;StateID&gt;1072&lt;/StateID&gt;
      &lt;State&gt;Ludhiana&lt;/State&gt;
  &lt;/FromCity&gt;
  &lt;FromCity xmlns="" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"
      diffgr:id="FromCity17" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
      msdata:rowOrder="16"&gt;
      &lt;StateID&gt;1010&lt;/StateID&gt;
      &lt;State&gt;Mumbai&lt;/State&gt;
  &lt;/FromCity&gt;
  &lt;FromCity xmlns="" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"
      diffgr:id="FromCity18" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
      msdata:rowOrder="17"&gt;
      &lt;StateID&gt;1065&lt;/StateID&gt;
      &lt;State&gt;Orchha&lt;/State&gt;
  &lt;/FromCity&gt;
  &lt;FromCity xmlns="" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"
      diffgr:id="FromCity19" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
      msdata:rowOrder="18"&gt;
      &lt;StateID&gt;1016&lt;/StateID&gt;
      &lt;State&gt;Pune&lt;/State&gt;
  &lt;/FromCity&gt;
  &lt;FromCity xmlns="" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"
      diffgr:id="FromCity20" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
      msdata:rowOrder="19"&gt;
      &lt;StateID&gt;1037&lt;/StateID&gt;
      &lt;State&gt;Udaipur&lt;/State&gt;
  &lt;/FromCity&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>and following is my mapping</p>
  
  <pre><code>&lt;class name="pkg.SourceCityWheelzResponse"&gt;
      &lt;description xmlns=""&gt;Default mapping for class
          GhraPayOrderRequest
      &lt;/description&gt;
      &lt;map-to xml="root" ns-prefix="diffgr"
          ns-uri="urn:schemas-microsoft-com:xml-diffgram-v1" /&gt;
      &lt;field name="fromCities" type="pkg.FromCity" collection="arraylist"&gt;
          &lt;bind-xml name="root:FromCity" node="element"
              xmlns:root="urn:schemas-microsoft-com:xml-diffgram-v1" /&gt;
      &lt;/field&gt;
  
  &lt;/class&gt;
  &lt;class name="pkg.FromCity"&gt;
      &lt;description xmlns=""&gt;Default mapping for class
          GhraPayOrderRequest
      &lt;/description&gt;
      &lt;map-to xml="FromCity" ns-prefix="diffgr"
          ns-uri="urn:schemas-microsoft-com:xml-diffgram-v1" /&gt;
  
      &lt;field name="stateId" type="java.lang.String"&gt;
          &lt;bind-xml name="FromCity:StateID" node="element"
              xmlns:FromCity="urn:schemas-microsoft-com:xml-diffgram-v1" /&gt;
      &lt;/field&gt;
      &lt;field name="state" type="java.lang.String"&gt;
          &lt;bind-xml name="FromCity:State" node="element"
              xmlns:FromCity="urn:schemas-microsoft-com:xml-diffgram-v1" /&gt;
      &lt;/field&gt;
  &lt;/class&gt;
  </code></pre>
  
  <p>but i am getting following error</p>
  
  <pre><code>org.springframework.oxm.UnmarshallingFailureException: Castor unmarshalling exception; nested exception is org.exolab.castor.xml.MarshalException: The namespace associated with the prefix 'diffgr' could not be resolved.
      at org.springframework.oxm.castor.CastorMarshaller.convertCastorException(CastorMarshaller.java:675)
      at org.springframework.oxm.castor.CastorMarshaller.unmarshalDomNode(CastorMarshaller.java:554)
      at org.springframework.oxm.support.AbstractMarshaller.unmarshalDomSource(AbstractMarshaller.java:307)
      at org.springframework.oxm.support.AbstractMarshaller.unmarshal(AbstractMarshaller.java:125)
  </code></pre>
  
  <p>Please help me to solve this</p>