Dean:
Here's the schema that of which the java src generated from castor maps
xsd:list of int to java.util.ArrayList. Specifically, I defined
rowIndices and colMarks as util:IntList type. The util:IntList is simply
xsd:list of ItemType int and is defined in the second schema following.

I passed -types j2 to castor SourceGenerator in order to get the
xsd:list -> ArrayList mapping.I used castor 0.9.4.2.

Thanks
Xiaowen
----------------------------------------------------------------
The first schema:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://OR.com/Resolve3/solver/matvec";
    version="$Revision$" xmlns:mv="http://OR.com/Resolve3/solver/matvec";
    xmlns:util="http://OR.com/Resolve3/util";
xmlns:xs="http://www.w3.org/2001/XMLSchema";>
    <xs:import namespace="http://OR.com/Resolve3/util";
schemaLocation="file:///home/swangken/compute/OR/prj/slvrproto/src/com/or/util/schema/common.xsd"/>
    <xs:annotation>
        <xs:documentation>XML Schema for CSR matrix storage
scheme</xs:documentati
on>
    </xs:annotation>
    <xs:element name="csrmat" type="mv:CSRMatrix"/>
    <xs:complexType name="CSRMatrix">
        <xs:sequence>
            <xs:element name="rowIndices" type="util:IntList"/>
            <xs:element name="colMarks" type="util:IntList"/>
            <xs:element name="values" type="util:DoubleList"/>
        </xs:sequence>
        <xs:attributeGroup ref="mv:SparseMatSize"/>
    </xs:complexType>
    <!-- attr grp describing sparse matrix size info -->
    <xs:attributeGroup name="SparseMatSize">
        <xs:attribute name="numRows" type="util:nonNegInteger"/>
        <xs:attribute name="numCols" type="util:nonNegInteger"/>
        <xs:attribute name="numNonzeros" type="util:nonNegInteger"/>
    </xs:attributeGroup>
</xs:schema>
----------------------------------------------------------------
The included schema:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema jxb:version="1.0"
targetNamespace="http://OR.com/Resolve3/util";
    version="$Revision$" xmlns:jxb="http://java.sun.com/xml/ns/jaxb";
    xmlns:or="http://OR.com/Resolve3/util";
xmlns:xs="http://www.w3.org/2001/XMLSch
ema">
    <xs:annotation>
        <xs:documentation> Common type definitions</xs:documentation>
    </xs:annotation>
    <!-- positive double number -->
    <xs:simpleType name="positiveDouble">
        <xs:restriction base="xs:double">
            <xs:minExclusive value="0.0"/>
        </xs:restriction>
    </xs:simpleType>
    <!-- non-negative int -->
    <xs:simpleType name="nonNegInteger">
        <xs:restriction base="xs:int">
            <xs:minInclusive value="0"/>
        </xs:restriction>
    </xs:simpleType>
    <!-- list of int -->
    <xs:simpleType name="IntList">
        <xs:list itemType="xs:int"/>
    </xs:simpleType>
    <!-- list of double -->
    <xs:simpleType name="DoubleList">
        <xs:list itemType="xs:double"/>
    </xs:simpleType>
</xs:schema>

On Mon, 2003-02-10 at 08:05, Dean Hiller wrote:
> your xsd:list is being mapped to an ArrayList?  Can you send me your 
> schema?  Mine is being mapped to a Vector and what is worse, is that 
> unmarshalling and marshalling does not work so I need to fix it, but 
> keep getting side tracked by other issues.
> thanks,
> Dean
> 
> Xiaowen Wang wrote:
> 
> >Hi:
> >In my schema, there're some elements of xsd:list simpleType with the
> >itemType of xsd:int. For the src gen, I used -types j2. These xsd:list
> >elements are then mapped to java.util.ArrayList and the generated src
> >also provide list traversal through Enumeration.  
> >
> >I'm wondering 1) whether I can map these xsd:list into int[] instead of
> >ArrayList; 2) if not, can I at least let the src gen provide Iterator
> >instead of Enumeration for the traversal?
> >
> >Thanks
> >XW
> >
> >----------------------------------------------------------- 
> >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

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

Reply via email to