Thanks for the hints and help so far. I couldn't easily get the <interface> element in the binding file to work for me, so I've gone to the next step.

I've created report castor-1861 with an example to encapsulate this issue. However I have a sneaking suspicion that there is an easy way to do this or that I am just missing something (mapping/namespace/type?). I'll reproduce the relevant parts of the example here and you can just ignore this if indeed it's a bug.

The XML files I am unmarshalling reference a DTD. I converted the DTD to a schema using XMLSPy. Here is a portion of the xsd file showing a top level element and a child element.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--W3C Schema generated by XMLSpy v2005 sp1 U (<http://www.xmlspy.com)-->http://www.xmlspy.com)--> <!--Please add namespace attributes, a targetNamespace attribute and import elements according to your requirements--> <xs:schema xmlns:xs="<http://www.w3.org/2001/XMLSchema>http://www.w3.org/2001/XMLSchema"; xmlns="<http://hhn.com>http://hhn.com"; targetNamespace="<http://hhn.com>http://hhn.com"; elementFormDefault="qualified">
        <xs:element name="library">
                <xs:complexType>
                        <xs:sequence>
                                <xs:choice minOccurs="0" maxOccurs="unbounded">
                                        <xs:element ref="variable"/>
                                </xs:choice>
                        </xs:sequence>
<xs:attribute name="name" type="xs:string" use="required"/> <xs:attribute name="description" type="xs:string" use="required"/>
                        <xs:attribute name="id" type="xs:string"/>
                </xs:complexType>
        </xs:element>
        <xs:element name="variable">
                <xs:complexType>
                        <xs:complexContent>
                                <xs:restriction base="xs:anyType">
<xs:attribute name="name" type="xs:string" use="required"/> <xs:attribute name="type" default="TEXT">
                                                <xs:simpleType>

        <xs:restriction base="xs:NMTOKEN">

        <xs:enumeration value="TEXT"/>

        <xs:enumeration value="NUMERIC"/>
                                                        </xs:restriction>
                                                </xs:simpleType>
                                        </xs:attribute>
<xs:attribute name="description" type="xs:string" use="required"/> <xs:attribute name="default" type="xs:string" use="required"/> <xs:attribute name="id" type="xs:string"/>
                                </xs:restriction>
                        </xs:complexContent>
                </xs:complexType>
        </xs:element>
</xs:schema>

From this, I generated castor source code in the "com.healthhero.castor.careobjects" package.

Here's a relevant portion of an XML file that I have to unmarshal:

<?xml version="1.0"?>
<!DOCTYPE library SYSTEM "<http://composer1.healthhero.com/WebObjects/Composer9_1.woa/Contents/WebServerResources/carecontent.dtd>http://composer1.healthhero.com/WebObjects/Composer9_1.woa/Contents/WebServerResources/carecontent.dtd";>
<library
    name="Standard Heart Failure Library"
    description=" "
    language="English"
    >
    <variable
        name="specificBPdevice"
        type="TEXT"
        description="specific BP device"
        default="your blood pressure cuff"
        >
    </variable>
    <sublibrary
        name="01-Resource utilization-HF spec"
        description="Resource Utilization- ER/Ambulance/Hospital- CHF Specific"
        >
.
.
.
    </sublibrary>
</library>

Finally, I try to unmarshal a file like the one above with Unmarshaller.unmarshal(Reader).

I get "the class for the root element 'lbrary' could not be found.[file [not available]; line; 7; column; 6]"

--

Nick Pilch / [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email

Reply via email to