I take it you are not familiar with (for example) the Standard Business Document Header (SBDH) from United Nations Centre for Trade Facilitation and Electronic Business (UN/CEFACT)? (Specifications, see http://www.uncefactforum.org/ATG/ATG2.htm) It is a standard used to wrap other XML business documents with a header containing timestamp, sender and recipient, transmission id etc. The contained document, which is where the data you'd want to unmarshall is, is represented by a
 <xs:any namespace="##other" processContents="lax"/>
in the Schema.

In the project I'm currently working on, the document within the header follows a GS1 XML standard, it's a GDSN Catalogue Item Notification (http://www.gs1.org/services/gsmp/kc/ecom/xml/gdsn_grid.html) wrapped in multiple GS1 headers to be exact. Also, this standard allows for extensions added within that document as <xsd:any minOccurs="0" maxOccurs="unbounded" namespace="##any" processContents="lax"/>

Currently I'm parsing the headers (both SBDH and GS1) with JDOM. Then I Unmarshall the Catalog Item data with Castor. But I also want to unmarshall the extensions, returned by Castor as AnyObject, with Castor after looking at the "root" tag name to determine which extension is used (i.e. which class to unmarshall to).

Can you see now why unmarshalling AnyObject could be very useful?
I guess it would take some effort for you to understand the particular example above and I don't think I could find the time for a while to minimize it enough to be easily grasped. So could you just take my word for it...?

Or is it me who have it all backwards? Should I attack this problem from a different angle???

/Mattias J


Werner Guttmann wrote (2008-01-16 23:08):
Hi Matthias,

it was me who closed this issue, as I couldn't get my head around as to why somebody would want to *unmarshal* from an AnyNode instance. Can you provide me with a fully fledged JUnit test case that demonstrated to me the benefit of such an approach ?

In other words, I am more than willing to re-open this issue if there's somebody that makes me understand as to why such a feature is desirable.

Regards
Werner

Mattias Jiderhamn wrote:
What is the recommended way to unmarshall an AnyNode object with version 1.1.2.1? Why was bug report 203 (http://jira.codehaus.org/browse/CASTOR-203) resolved as Won't Fix? Is there something in the patch that is recommended against?

Thanks in advance,
 Mattias

---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email




---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email



---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email

Reply via email to