I only want to map a few values from an XML file into a java object. I want
the values under the CostCenter element to go into a CostEntityPod. I have
a structure like:
<CostCenterBatch>
<CostCenter>
<CostCenterNumber>1</CostCenterNumber>
<DataEntityAction>
<DataEntityActionType>Activate</DataEntityActionType>
</DataEntityAction>
</CostCenter>
</CostCenterBatch>
and part of my mapping looks like:
<class name="com.openInvoice.eDocument.pod.CostEntityPod">
<map-to xml="CostCenter"/>
<field name="CostEntityNumber" *(field name differs from XML
name)
type="java.lang.String">
<bind-xml name="CostCenterNumber"/>
</field>
</class>
I don't have the DataEntityAction field in my pod and would like to ignore
this XML element
-is this possible? The error is below. Thanks
[java] Exception in thread "main" org.xml.sax.SAXException: unable to
find FieldDescriptor for 'DataEntityAction' in ClassDescriptor of CostCenter
[java] at
org.exolab.castor.xml.UnmarshalHandler.startElement(Unknown Source)
[java] at
org.apache.xerces.parsers.SAXParser.startElement(SAXParser.java:1335)
[java] at
org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLValidat
or.java:823)
[java] at
org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XM
LDocumentScanner.java:1222)
[java] at
org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.
java:380)
[java] at
org.apache.xerces.framework.XMLParser.parse(XMLParser.java:900)
[java] at org.exolab.castor.xml.Unmarshaller.unmarshal(Unknown
Source)
[java] at org.exolab.castor.xml.Unmarshaller.unmarshal(Unknown
Source)
[java] at CastorTest.main(CastorTest.java:47)
[java] Java Result: 1
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev