I have add the next lines in the examples

      log.info("isValid:" + richiestaSaia.isValid());
      richiestaSaia.validate();

and the result is that the validation is wrong

INFO  (it.datamanagement.saia_xml.test.TestRichiestaSaia:109) -
isValid:false
ERROR (it.datamanagement.saia_xml.test.TestRichiestaSaia:116) -
MarshalException impossibile cotruire il documento XML
ERROR (it.datamanagement.saia_xml.test.TestRichiestaSaia:117) -
ValidationException: The following exception occured while validating field:
_mittente of class:
it.datamanagement.saia_xml.castor.richiesta.RichiestaSAIA: The following
exception occured while validating field: _comuneDiComunicazione of class:
it.datamanagement.saia_xml.castor.richiesta.Mittente: The following
exception occured while validating field: _nomeComune of class:
it.datamanagement.saia_xml.castor.richiesta.ComuneDiComunicazione:
Ravennadoes not match the required regular expression: "([a-zA-Z\- '])*";
   - location of error: XPATH: /richiestaSAIA/mittente
The following exception occured while validating field:
_comuneDiComunicazione of class:
it.datamanagement.saia_xml.castor.richiesta.Mittente: The following
exception occured while validating field: _nomeComune of class:
it.datamanagement.saia_xml.castor.richiesta.ComuneDiComunicazione:
Ravennadoes not match the required regular expression: "([a-zA-Z\- '])*"

Castor tell me that comune di comunicazione is bad when is "Ravenna" 

Thanks
Raffaele


> > -----Messaggio originale-----
> > Da: Werner Guttmann [mailto:[email protected]]
> > Inviato: martedì 17 febbraio 2009 21.10
> > A: [email protected]
> > Oggetto: Re: [castor-user] Validation problem
> >
> > Ciao Raffaele,
> >
> > before looking at this in detail, can I ask you to retry things with
> > Castor 1.3.
> >
> > Regards
> > Werner
> >
> > Fabbri Raffaele wrote:
> > > hello everybody!
> > >
> > > I have a problem with castor version 1.2
> > >
> > > I attach 2 test
> > > TestProvaXML.java
> > > TestRichiestaSaia.java
> > >
> > > The first work finally
> > >
> > > If I set comune.setNomeComune(".Ravenna") field whit pattern
> defined
> > > in Xsd as follows
> > >
> > >   <xs:simpleType name="alfabeticoLocalita">
> > >
> > >     <xs:restriction base="xs:string">
> > >
> > >       <xs:minLength value="1"/>
> > >
> > >       <xs:maxLength value="80"/>
> > >
> > >       <xs:pattern value="([a-zA-Z\- &apos;])*"/>
> > >
> > >     </xs:restriction>
> > >
> > >   </xs:simpleType>
> > >
> > > Castor validator reply with the next message
> > >
> > > ERROR (it.datamanagement.saia_xml.test.TestProvaXML:84) -
> > > ValidationException documento XML non valido ERROR
> > > (it.datamanagement.saia_xml.test.TestProvaXML:85) -
> > > ValidationException: The following exception occured while
> validating
> > field:
> > > _generalita of class:
> > it.datamanagement.saia_xml.castor.provaxml.ProvaXML:
> > > The following exception occured while validating field:
> _luogoNascita
> > > of
> > > class: it.datamanagement.saia_xml.castor.provaxml.Generalita: The
> > > following exception occured while validating field:
> _tipoLuogoChoice
> > of class:
> > > it.datamanagement.saia_xml.castor.provaxml.LuogoNascita: The
> > following
> > > exception occured while validating field: _comune of class:
> > > it.datamanagement.saia_xml.castor.provaxml.TipoLuogoChoice: The
> > > following exception occured while validating field: _nomeComune of
> > class:
> > > it.datamanagement.saia_xml.castor.provaxml.Comune: .Ravennadoes not
> > > match the required regular expression: "([a-zA-Z\- '])*";
> > >    - location of error: XPATH: /ProvaXML The following exception
> > > occured while validating field: _luogoNascita of
> > > class: it.datamanagement.saia_xml.castor.provaxml.Generalita: The
> > > following exception occured while validating field:
> _tipoLuogoChoice
> > of class:
> > > it.datamanagement.saia_xml.castor.provaxml.LuogoNascita: The
> > following
> > > exception occured while validating field: _comune of class:
> > > it.datamanagement.saia_xml.castor.provaxml.TipoLuogoChoice: The
> > > following exception occured while validating field: _nomeComune of
> > class:
> > > it.datamanagement.saia_xml.castor.provaxml.Comune: .Ravennadoes not
> > > match the required regular expression: "([a-zA-Z\- '])*"
> > >
> > > If we run TestRichiestaSaia.java with the same value ".Ravenna" the
> > > validator does not intercept the validation error and create a not
> > > valid xml.
> > >
> > > What I wrong?
> > >
> > > castor_xml_saia_build.1.2.xml is the script to generate castor
> > mapping
> > > object
> > >
> > > Sorry for my bad English.
> > >
> > > Thanks very much
> > > Raffaele
> > >
> > >
> > >
> > >
> > > -------------------------------------------------------------------
> --
> > -
> > > --
> > >
> > > -------------------------------------------------------------------
> --
> > > To unsubscribe from this list, please visit:
> > >
> > >     http://xircles.codehaus.org/manage_email
> >
> > ---------------------------------------------------------------------
> > To unsubscribe from this list, please visit:
> >
> >     http://xircles.codehaus.org/manage_email
> >



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

    http://xircles.codehaus.org/manage_email


Reply via email to