Hi Sayed,

Are you using the CVS version of Castor?
If yes can you send the code you use with the mapping file.

Arnaud

> -----Original Message-----
> From: sayed fadhil [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 27, 2002 2:28 PM
> To: [EMAIL PROTECTED]
> Subject: [castor-dev] include error in ampping file
> 
> Hi, I really need help to figure out what is wrong
> with my mapping file. I planned to used castor to
> import data from xml file to database. here is the xml
> schema I used to generate the classes.
> 
> <?xml version="1.0"?>
> <xsd:schema
> xmlns:xsd="http://www.w3.org/2001/XMLSchema";
> 
> targetNamespace="http://castor.exolab.org/Test/Invoice";>
> 
>   <xsd:element name="invoice">
>         <xsd:complexType>
>             <xsd:sequence>
>                 <xsd:element name="cust-id"
> type="xsd:string"/>
>                 <xsd:element name="name"
> type="xsd:string"/>
>                 <xsd:element ref="shipping-method"/>
>                 <xsd:element name="shipping-date"
> type="xsd:date"/>
>                 <xsd:element name="shipping-time"
> type="xsd:time"/>
>              </xsd:sequence>
>         </xsd:complexType>
>   </xsd:element>
> 
>   <!-- Shipping Method -->
>    <xsd:element name="shipping-method">
>         <xsd:complexType>
>            <xsd:sequence>
>                 <xsd:element name="id"
> type="xsd:integer"/>
>                 <xsd:element name="carrier"
> type="xsd:string"/>
>                 <xsd:element name="option"
> type="xsd:string"/>
>             </xsd:sequence>
>         </xsd:complexType>
>    </xsd:element>
> 
> </xsd:schema>
> 
> and here is the mapping file :
> 
> <?xml version="1.0"?>
> <mapping>
>  <class name="test.ShippingMethod" identity="_id" >
>         <map-to table="method" xml="shipping-method"
> />
>         <field name="_id" type="int" required="true">
>                 <sql name="id" type="int" />
>                 <bind-xml name="id" node="element"/>
>         </field>
>         <field name="_carrier" type="java.lang.String"
> >
>                 <sql name="carrier" type="varchar"/>
>                 <bind-xml name="carrier"
> node="element"/>
>         </field>
>         <field name="_option" type="java.lang.String"
> >
>                 <sql name="option" type="varchar"/>
>                 <bind-xml name="option"
> node="element"/>
>                 </field>
>  </class>
> 
>  <class name="test.Invoice" identity="_custId"
> access="shared">
>         <map-to table="invoice" xml="invoice" />
>         <field name="_custId" type="java.lang.String"
> >
>                 <sql name="id" type="varchar"/>
>                 <bind-xml name="cust-id"
> node="element"/>
>         </field>
>         <field name="_name" type="java.lang.String" >
>                 <sql name="name" type="varchar"/>
>                 <bind-xml name="name" node="element"/>
>         </field>
>         <field name="_shippingMethod"
> type="test.ShippingMethod" >
>                 <bind-xml name="shipping-method"
> node="element"/>
>         </field>
>         <field name="_shippingDate"
> type="org.exolab.castor.types.Date" >
>                 <sql name="date" type="date" />
>                 <bind-xml name="shipping-date"
> node="element"/>
>         </field>
>         <field name="_shippingTime"
> type="org.exolab.castor.types.Time" >
>                 <sql name="time" type="time" />
>                 <bind-xml name="shipping-time"
> node="element"/>
>          </field>
>    </class>
> </mapping>
> 
> 
> and the error file that I get is this:
> 
> [test]
> org.exolab.castor.jdo.DatabaseNotFoundException:
> Nested error: org.xml.sax.SAXException: include is
> missing required attribute: href
> [test]   - line: 4 column: 11
> [test] org.xml.sax.SAXException: include is missing
> required attribute: href
> [test]   - line: 4 column: 11
> [test]  at
>
org.exolab.castor.xml.UnmarshalHandler.processAttribute(UnmarshalHandler
.j
> ava:1296)
> [test]  at
>
org.exolab.castor.xml.UnmarshalHandler.processAttributes(UnmarshalHandle
r.
> java:1217)
> [test]  at
>
org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.jav
a:
> 1087)
> [test]  at
> org.apache.xerces.parsers.SAXParser.startElement(SAXParser.java:1340)
> 
> I've search the mailing list archived but didn't find
> any solution .. So Iwould really appriciate if someone
> show me what is wrong with my mapping file.
> 
> regards
> 
> sayed
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Mobile - Jazz up your mobile phone!  Get funky ringtones and
logos!
> http://mobile.yahoo.com.sg/
> 
> -----------------------------------------------------------
> 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

Reply via email to