Title: Message
More information about my problem...
 
I'm working with two namespaces here, generated using the Castor XML Source Generator.  In generating the source, I mapped the two namespace URI's to two packages.  Apparently, some of the types in one package inherit from types in the other package. 
 
Using the sample below, suppose I have a namespace called "ns", and another namespace called "base".  I have a type SomeType in ns which inherits from the same named type in "base".  Now, "someTag" below resolves to the base namespace, but the xsi:type references the derived type.  However, Castor incorrectly resolves the name SomeType to the base type instead of the derived type... therefore correctly saying that it can't find a descriptor for tagFred.
 
This looks like a bug.  What do I need to do to help get it fixed?
-----Original Message-----
From: David Hooker [mailto:[EMAIL PROTECTED]
Sent: Monday, February 09, 2004 3:08 PM
To: [EMAIL PROTECTED]
Subject: [castor-dev] Help with xsi:type

I have an XML file with an element that has something like this:

  <someTag xsi:type="ns:SomeType>
      <ns:tagFred>stuff</ns:tagFred>
      <ns:tagWilma>more stuff</ns:tagWilma>
  </someTag>

When I try to unmarshal, this XML causes this error:

org.xml.sax.SAXException: unable to find FieldDescriptor for 'tagFred' in ClassDescriptor of SomeType
	at org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.java:1566)
	at org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.java:1149)
	at org.apache.xerces.parsers.SAXParser.startElement(SAXParser.java:1376)

Any clues?

 

Reply via email to