Hi,

when you use <xsd:any> or <xsd:anyContent> in an XML schema, you are
indicating that -at the point of question within your XML document
instance - anything is valid, including complete sub-trees of XML.

When you unmarshal such an XML document, you'll be able to access the
actual element (document) 'attached' to this very node using an AnyNode
instance. This AnyNode instance (which happens to be similar to a DOM
tree) has got methods to access any content present within this AnyNode,
e.g. access the children of this node as AnyNodes as well.

Does this answer your first question ?

In your XML schema, all you can say is that there's an element that
allows <xsd:any>. There's no way you can specify the structure that can
go into <xsd:any/>.

Regards
Werner

Koku wrote:
> I have an addon question to my original post.  In the following XML, I know
> the tag names for Info, Element1, and Element2.  I don't know the names of
> the USERSPECIFIEDTAGs. 
> 
> <Info>
> <USERSPECIFIEDTAG1>
> <Element1/>
> <Element2/>
> </USERSPECIFIEDTAG1>
> <USERSPECIFIEDTAG2>
> <Element1/>
> <Element2/>
> </USERSPECIFIEDTAG2>
> </Info>
> 
> Is there any way I could use xsd:any for the USERSPECIFIEDTAGs and get to
> the underlying elements in the classes Castor creates?  (When I use xsd:any,
> it creates a vector with the tag names and values - I'm not sure how to
> construct the xsd when the USERSPECIFIED TAG is actually a group.)
> 
> 
> 
> Koku wrote:
>> This certainly does!  Thank you for taking the time to respond
>>
>>
>>
>> Werner Guttmann wrote:
>>> If you started with an XML schema, and used the XML code generator to
>>> generate the Java classes from the schema, you would define the content
>>> of the <FormData> element to be of type <xs:any/>.
>>>
>>> As such, Castor would handle this through an AnyNode instance, which is
>>> actually a DOM-like representation of the XML unmarshalled.
>>>
>>> Does this meet your needs ?
>>>
>>> Regards
>>> Werner
>>>
>>> Koku wrote:
>>>> In the xml I receive there is 'control' data with known tags.  There is
>>>> also
>>>> data that I don't care about, but need to pass along to a helper class. 
>>>> Is
>>>> there a way to unmarshall and marshall in such a way that I don't have
>>>> to
>>>> have all the classes for all possible tags generated?  For example:
>>>>
>>>> <FormInfo>
>>>>    <CommonInfo>
>>>>        <sessionId>12345</sessionId>
>>>>    <\CommonInfo>
>>>>    <FormData>
>>>>       ...
>>>>    <\FormData>
>>>> <\FormInfo>
>>>>
>>>> In this simplified example, the tags in the FormData section could vary
>>>> greatly.  My processing does not access the data in that section, but
>>>> needs
>>>> to pass it to the next class.  Is there a way to marshall and unmarshall
>>>> this xml and not lose those tags (and associated data)?
>>>>
>>>> Any ideas would be appreciated.  Thank you!
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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