|
Hi Pete and Tim, Thanks a lot for your help. Pete’s
solution is exactly the operation that I have wanted to do. and
I appreciate your prompt responses. I do have an issue with it though that
comes up after Marshalling the XML into a string. The schema for VIDEOMD
requires the elements to be “qualified” and the marshalled
xml string only has an “xmlns” attribute.
It doesn’t have a prefix on every element. So when I unmarshall
it, the operation doesn’t give an error, but I cannot access the data.
Also the original document from which I am doing the unmarshalling
contains prefixed tags for VIDEOMD. So the prefixes are being dropped somewhere
in between. Has anyone encountered a similar situation?
What would a good workaround for this. Please note that I haven’t used any
mapping file as yet. Is that the way I need to go? Thanks, Prajakta -----Original Message----- I’m not sure if this is your question but if you’re XML
Schema has :- <xs:any> Then after unmarshalling, you can do a xxx.getAnyObject() on the element that contains the any node,
which gives an Object[]. If you want to unmarshall the any node
contents separately you just marshall each Object in the array to the
same StringWriter. This gives you the contents of the any node as an XML
String. You can then unmarshall the XML String
using castor to another set of castor generated classes providing you have an
XML Schema(s) for the any node portion or a mapping file. Pete From: Vaidya,
Prajakta P [mailto:[EMAIL PROTECTED] I am repeating
my previous question here and hope to explain it better. I have two xsd files
“mets” and “VideoMD”. The “Mets”
xsd contains an <any> element. As part of my application, I know that I
will have VIDEOMD elements present as the AnyObject. I want to access the
fields of this VIDEOMD element. When I retrieve the AnyObject , and query its
class, it returns this as VIDEOMD. But I do not understand if I can unmarshall
this AnyObject into the VIDEOMD object. This appears like a dynamic unmarshall
operation. I have been reading the
message board and couldn’t figure this out. Any help would be
appreciated. Thanks, Prajakta This transmission is confidential and intended solely for the person or organisation to whom it is addressed. It may contain privileged and confidential information. If you are not the intended recipient, you should not copy, distribute or take any action in reliance on it. If you have received this transmission in error, please notify the sender immediately. Any opinions or advice contained in this e-mail are those of the individual sender except where they are stated to be the views of RDF Group or EMS plc. All messages passing through this gateway are virus scanned. |
- [castor-dev] Re: [castor-dev]Casting AnyObject into... Vaidya, Prajakta P
- [castor-dev] Re: [castor-dev]Casting AnyObject... Arnaud Blandin
- [castor-dev] field descriptor not found, searc... Christoph Riesenberger
- Re: [castor-dev] field descriptor not foun... Christoph Riesenberger
- [castor-dev] Re: [castor-dev]Casting AnyObject... Vaidya, Prajakta P
