Hi

I am looking into castor for our project and would like to find out, how n x
m cross-refrencing works. Most probably I have overseen some important
point. Status: I defined an xsd and an xml (sample below) where I would like
to reference mor items from within tax items, and vice-versa. I found some
hints in this newsgroup (expecially
http://www.mail-archive.com/[email protected]/msg00418.html) and I
therefore used

        <xsd:attribute name="tax" type="xsd:IDREFS"/>

to reference the objects and

        <xsd:attribute name="id" type="xsd:ID"/>

to identify them. The classes do compile well, and no exceptions are thrown.
But it seems that I did not understand the system quite well, as during
unmarshalling the vectors of the cross referenced objects are not filled and
are empty.

I would appreciate to know the missing link? Does anybody can help me.

Thanks in advance

Daniel Frey

============================================================================
============
<?xml version="1.0" encoding="UTF-8"?>
<data>
        <tax ID="T1" mor="M1">
                <level>1</level>
                <name>Keine Taxa</name>
                <rank>0</rank>
                <tax ID="T2" mor="">
                        <level>2</level>
                        <name>Lichenes</name>
                        <rank>1020</rank>
                        <tax ID="T4" mor="M280 M283 M286">
                                <level>11</level>
                                <name>Cladonia rangiferina</name>
                                <rank>1040</rank>
                        </tax>
                </tax>
        </tax>
        <mor ID="M1" tax="T1">
                <name>Morphologie</name>
                <type>3</type>
                <mor ID="M274" tax="">
                        <name>Thallus</name>
                        <type>3</type>
                        <mor ID="M278" tax="">
                                <name>Form</name>
                                <type>2</type>
                                <mor ID="M280" tax="T4">
                                        <name>fl�chig, blattartig</name>
                                        <text>Thallus blattartig, �
flach</text>
                                        <type>1</type>
                                </mor>
                        </mor>
                        <mor ID="M282" tax="">
                                <name>Farbe</name>
                                <type>2</type>
                                <mor ID="M283" tax="T4">
                                        <name>gr�nlich bis braun</name>
                                        <text>Thallus gr�nlich bis
braun</text>
                                        <type>1</type>
                                </mor>
                        </mor>
                        <mor ID="M285" tax="">
                                <name>Wuchsform</name>
                                <type>2</type>
                                <mor ID="M286" tax="T4">
                                        <name>aufsteigend</name>
                                        <text>Thallus aufsteigend</text>
                                        <type>1</type>
                                </mor>
                        </mor>
                </mor>
        </mor>
</data>
============================================================================
============
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";
elementFormDefault="qualified">
        <xsd:element name="name" type="xsd:string"/>
        <xsd:element name="text" type="xsd:string"/>
        <xsd:element name="type" type="xsd:int"/>
        <xsd:element name="level" type="xsd:int"/>
        <xsd:element name="rank" type="xsd:int"/>
        <xsd:element name="data">
                <xsd:complexType>
                        <xsd:sequence>
                                <xsd:element ref="tax"/>
                                <xsd:element ref="mor"/>
                        </xsd:sequence>
                </xsd:complexType>
        </xsd:element>
        <xsd:element name="mor">
                <xsd:complexType>
                        <xsd:sequence>
                                <xsd:element ref="name"/>
                                <xsd:element ref="text" minOccurs="0"/>
                                <xsd:element ref="type"/>
                                <xsd:element ref="mor" minOccurs="0" 
maxOccurs="unbounded"/>
                        </xsd:sequence>
                        <xsd:attribute name="id" type="xsd:ID"/>
                        <xsd:attribute name="tax" type="xsd:IDREFS"/>
                </xsd:complexType>
        </xsd:element>
        <xsd:element name="tax">
                <xsd:complexType>
                        <xsd:sequence>
                                <xsd:element ref="name"/>
                                <xsd:element ref="level"/>
                                <xsd:element ref="rank"/>
                                <xsd:element ref="tax" minOccurs="0" 
maxOccurs="unbounded"/>
                        </xsd:sequence>
                        <xsd:attribute name="id" type="xsd:ID"/>
                        <xsd:attribute name="mor" type="xsd:IDREFS"/>
                </xsd:complexType>
        </xsd:element>
</xsd:schema>

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to