Hi Bruno,
You can use at least 3 methods:
1- use XSLT to replace the <LISTE_PERSONNES> tags by better tags
2- use an XML Schema to represent the structure of your XML and
generate java classes with the SourceGenerator
<element name="LISTE_PERSONNES" maxOccurs="2">
<complexType>
<choice>
<element name="realisateur" maxOccurs="unbounded"/>
<element name="acteurs maxOccurs="unbounded"/>
</choice>
</complexType>
</element>
3- use a mapping file to describe the class LISTE_PERSONNES and
use the 'container' attribute in the 'field' element...sorry but this
one is not yet documented.
Hope that helps,
Arnaud
> -----Original Message-----
> From: Bruno THOMAS [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 27, 2002 11:47 AM
> To: [EMAIL PROTECTED]
> Subject: [castor-dev] problem of XML structure
>
> Hi all,
>
> The problem I have is more an applicative problem, but I'd like the
> castor-experts point of view if they don't mind. I receive the cinema
> showtimes in an XML file. The structure of a film is the following :
>
> <FILM UID="FI9047480" anneeRealisation="1999" anneeSortie="2000"
> duree="121"
> dateMiseEnSalle="20000412" dowMiseEnSalle="Jeu">
> <TITREFRANCAIS>A tombeau ouvert</TITREFRANCAIS>
> <TITREORIGINAL>Bringing out the Dead</TITREORIGINAL>
> <TYPE code="1">exclusivité</TYPE>
> <GENRE code="DR">drame</GENRE>
> <COULEUR code="0">couleur</COULEUR>
> <INTERDICTIONS code="1">int. -12 ans</INTERDICTIONS>
> <LISTE_PERSONNES>
> <REALISATEUR UID="70">Martin Scorsese</REALISATEUR>
> </LISTE_PERSONNES>
> <LISTE_PERSONNES>
> <ACTEUR UID="2422">Nicolas Cage</ACTEUR>
> <ACTEUR UID="2423">John Goodman</ACTEUR>
> <ACTEUR UID="1517">Ving Rhames</ACTEUR>
> <ACTEUR UID="2424">Patricia Arquette</ACTEUR>
> <ACTEUR UID="2425">Tom Sizemore</ACTEUR>
> </LISTE_PERSONNES>
> <NATIONALITE>américain</NATIONALITE>
> <RESUME>Frank sillonne tous les soirs........</RESUME>
> </FILM>
>
> The problem is the <LISTE_PERSONNES> that occurs twice for different
> objects
> (I think that we can't have polymorphic collections), and the name of
the
> actors and realisators that are not explicitely given a tag.
>
> I tried several configuration, but I can't see a solution. Do you see
a
> workaroud (even if it is a scrit that corrects the structure before
> unmashalling, I see one : deleting </LISTE_PERSONNES> and adding a tag
> name
> to the actor and director tags), or have I to create a specific SAX
parser
> ?
>
> Thanks for you opinions
>
> Bruno Thomas
> --
> alea
> 12 rue Ampere
> 38000 Grenoble
> http://www.alea.fr
>
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
> unsubscribe castor-dev
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev