Hi Arnaud!
 
I'm using the castor-0.9.3-xml.jar
and when I use the xml like
 
...
<HTTP>
    <Get/>   
</HTTP>
...
 
the exception message was...
-------------------------------------------
ValidationException: Post is a required field.;
-------------------------------------------
 
however, what is CVS version?
It means that Full CVS snapshot (castor-0.3.9-src.zip)??
I downloaded that version and build class files using build.bat.
And I made jar file from class files that I built.
but it say same Exception..
 
If my schema is good, what can I try more ??
 
 
And I have one more question. :)
I want to use the schema like below,
-----------------------------------------------------------------------------------
<xsd:element name="OnlineResource">
  <xsd:complexType>
    <xsd:attribute name="xmlns:xlink" type="xsd:string" fixed="http://www.w3.org/1999/xlink"/>
    <xsd:attribute name="xlink:type" type="xsd:string" fixed="simple"/>
    <xsd:attribute name="xlink:href" type="xsd:string" use="required"/>
  </xsd:complexType>
</xsd:element>
-----------------------------------------------------------------------------------
Can I use " : " in attribute name?
 
I generated the source code from that schema.
and unmarshal the xml file.
but it say Exception like below,
---------------------------------------------------------------------
org.xml.sax.SAXException: OnlineResource is missing required attribute: href
---------------------------------------------------------------------
 
If I omitted " : " from the attribute name, It say no Exception.
 
Can't I  use " : "  in attribute name?
If that is true, and I have to use the name like "aaa:aaa" for attributd name,
Is there a way that can solve this problem?
 
thanks for your kindness, Arnaud
 
Regard,
sophia
 
 
 
 
 
----- Original Message -----
Sent: Saturday, September 22, 2001 5:36 AM
Subject: Re: [castor-dev] could you make my schema right???

Hi Sophia,
 
your schema is good and unmarshall should not produce exceptions.
Which version are you using? It is 0.9.3 try the CVS version, it should have
contain validation improvements.
 
Arnaud
-----Original Message-----
From: �ڽ��� [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 20, 2001 11:00 PM
To: [EMAIL PROTECTED]
Subject: [castor-dev] could you make my schema right???

I'd like to translate DTD to Schema...for using Castor.
 
so, I translated like below...
 
--------DTD--------
<!ELEMENT HTTP (Get | Post)+>
 
--------SCHEMA--------
    <xsd:element name="HTTP" minOccurs="1">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:choice minOccurs="1" maxOccurs="unbounded">
              <xsd:element name="Get" type="GetLink"/>
              <xsd:element name="Post" type="PostLink"/>
            </xsd:choice>
          </xsd:sequence> 
        </xsd:complexType>
      </xsd:element>
 
 
I have generated source code from xml schema using Castor.
and I got problem to using th source...
 
I think the DTD means,
<HTTP>
    <Get/>      -----------(1)
</HTTP>
 
or
 
<HTTP>
    <Post/>    -----------(2)
</HTTP>
 
or
 
<HTTP>
    <Get/>
    <Post/>
</HTTP>
 
but when I unmarshal (1) or (2) xml file, I got the exception...
that is Get and Post, both of them required field...
Did I make wrong Schema???
 
anybody help me...
 
 
regard,
sophia

Reply via email to