> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]
> Sent: 01 November 2001 11:37
> To: [EMAIL PROTECTED]
> Subject: [castor-dev] Castor / XSLT problem
>
>
>
> Hi all,
>
> I've created a small program to convert an XML file in java source code.
>
> The problem I have occurs when I try to convert an XML object into a java
> object.
>
> My XML file contains:
>      <JavaAttribute>
>           <comment>
>                <p>
>                Property session.sle indicates bla bla bla.
>                </p>
>           </comment>
>
> While my xsd file contains:
> <xsd:element name="JavaAttribute">
>      <xsd:complexType>
>           <xsd:sequence>
>                <xsd:element name="comment" type="xsd:string"
>                     minOccurs="0"
>                     maxOccurs="unbounded"/>
>
> Appearantly because of the <p> tags, the string which is read into my
> JavaAtribute class is empty. And I really want the entire <p>
> Property ...
> </p> string.
>
> Can someone tell me how to do this ? Do I need to use another type than
> xsd:string ?

The XML Schema way of indicating this is the following:

<xsd:element name="JavaAttribute">
     <xsd:complexType>
          <xsd:sequence>
             <xsd:element name="comment" type="xsd:string"
                  minOccurs="0"
                  maxOccurs="unbounded">
                <xsd:complextype mixed = "true">
                  <xsd:sequence>
                     <xsd:any minOccurs = "0"
                              maxOccurs="unbounded"
                              processContents="skip" />

I don't know if Castor supports this or not. Reference: Professional XML
Schemas, Wrox Press, ISBN : 1-861005-47-4, page 90. This is the best book
I've found on Schemas so far.

Nick Fortescue

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

Reply via email to