Hello all

In order to narrow the issue, I present a more focused use-case.
My XML looks like this:

<item>
    <description>One description</description>
    <media:description>Another desc</media:description>
</item>

I have tried many things with my mapping.xml (with Castor 1.1), but I can't 
succeed in parsing it correctly: I mean getting the 2 description elements 
separately.
Can anyone help me, please? Many thanks.

Christophe

-----Message d'origine-----
De : Delory Christophe 
Envoyé : lundi 27 août 2007 12:40
À : [email protected]
Objet : RE: [castor-user] [XML] Unmarshalling the same element from 2 different 
namespaces

Thanks Werner for your quick reply.

I've ran extensively through the XML mapping documentation, and I still can't 
figure out what to do in my case. I certainly miss some XML features, although 
I use Castor for 4 years now (but without playing with namespaces, obviously).
Could you give me more clues, please?
Thanks for your patience.

Christophe

-----Message d'origine-----
De : Werner Guttmann [mailto:[EMAIL PROTECTED] 
Envoyé : lundi 27 août 2007 11:07
À : [email protected]
Objet : Re: [castor-user] [XML] Unmarshalling the same element from 2 different 
namespaces

Chritophe,

it looks like you are getting slighly confused how to define namespace 
and namespace prefices in a Castor mapping file.

Please have a look at

http://castor.org/xml-mapping.html#3.3-The-%3Cmap-to%3E-element

and

http://castor.org/xml-mapping.html#3.5-The-%3Cbind-xml%3E-element

and the <map-to/> and <bind-xml/> elements in particular to get an idea 
about how to do this.

Werner

Delory Christophe wrote:
> Hello all
> 
> I wish to unmarshall a MediaRSS XML document
> (http://search.yahoo.com/mrss).
> In such a document, an "item" element may accept two child elements: the
> regular "description" element issued from the RSS specification, and the
> "media:description" element coming from the MediaRSS extension. The same
> case applies to the "title" element, by the way.
> I can't unmarshal correctly such a document: in my example, the
> "setMediaDescription" is always called for both elements, while the
> "setRssDescription" (which occurs later in the mapping file) is never
> invoked.
> 
> I insert here the related fragment of the mapping file:
> 
>   <field name="mediaDescription" type="string"
> get-method="getMediaDescription" set-method="setMediaDescription">
>     <bind-xml xmlns:media="http://search.yahoo.com/mrss/";
> name="media:description" node="element" />
>   </field>
>   <field name="rssDescription" type="string"
> get-method="getRssDescription" set-method="setRssDescription">
>     <bind-xml name="description" node="element" />
>   </field>
> 
> Does anyone have an idea?
> I already crawled through the FAQ, mailing lists & documentation,
> without success.
> Thanks a lot.
> 
> Christophe Delory
> 
> ---------------------------------------------------------------------
> 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