Thanks I have tried to install/use new castor-1.3 but now the both examples don't work fine.
Can you help me? 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\- '])*"/> > > > > </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 >
TestProvaXML.java
Description: Binary data
TestRichiestaSaia.java
Description: Binary data
<!--XML/HTML File:
*
* ====================================================================
* Title: XBeanGenerator
* ====================================================================
*
* $Author: casax $
* $Date: 2009/02/18 07:43:13 $
*
*
*
* Parametri:
*
* prodotto - nome della directory di prodotto
*
*
*
To enable this property, edit the castor builder.properties file:
# Set to true if you want to use Object Wrappers instead
# of primitives (e.g Float instead of float).
# false by default.
#org.exolab.castor.builder.primitivetowrapper=false
-->
<project name="Saia Castor XML Generator 1.3" default="Generator" basedir="..">
<description>
Generazione dei XBean partendo dai file *.xsd contenuti in una directory
</description>
<!-- ==================================================================== -->
<!-- PACKAGE -->
<!-- ==================================================================== -->
<property name="prodotto" value="saia_xml"/>
<property name="package.dir" value="it/datamanagement/${prodotto}/castor"/>
<property name="package.name" value="it.datamanagement.${prodotto}.castor"/>
<!-- ==================================================================== -->
<!-- DIRECTORY -->
<!-- ==================================================================== -->
<property name="xsd.dir" value="${basedir}/xsd"/>
<property name="conf.dir" value="${basedir}/WEB-INF"/>
<property name="lib.dir" value="${basedir}/WEB-INF/lib"/>
<property name="build.lib.dir" value="${basedir}/castor/lib_1.3"/>
<property name="build.java.dir" value="${basedir}/WEB-INF/src"/>
<target name="Prova">
<echo> </echo>
</target>
<target name="Genera">
<mkdir dir="${build.java.dir}/${package.dir}/${xsd.module}"/>
<delete>
<fileset dir="${build.java.dir}/${package.dir}/${xsd.module}"/>
</delete>
<java classname="org.exolab.castor.builder.SourceGeneratorMain" fork="yes">
<arg value="-i"/>
<arg value="${xsd.dir}/${xsd.file}.xsd"/>
<arg value="-dest"/>
<arg value="${build.java.dir}"/>
<arg value="-package"/>
<arg value="${package.name}.${xsd.module}"/>
<arg value="-f"/>
<arg value="-types"/>
<arg value="j2"/>
<classpath>
<pathelement path="${build.lib.dir}"/>
<pathelement path="${conf.dir}"/>
<fileset dir="${build.lib.dir}">
<include name="**/*.jar"/>
</fileset>
<!--fileset dir="${lib.dir}">
<include name="**/*.jar"/>
</fileset-->
</classpath>
</java>
</target>
<!-- ==================================================================== -->
<!-- TASK: GENERATOR -->
<!-- ==================================================================== -->
<target name="GeneratorAzioni">
<antcall target="Genera">
<param name="xsd.module" value="azioni"/>
<param name="xsd.file" value="azioni"/>
</antcall>
</target>
<target name="GeneratorDataStore">
<antcall target="Genera">
<param name="xsd.module" value="ds"/>
<param name="xsd.file" value="ds"/>
</antcall>
</target>
<target name="GeneratorConfig">
<antcall target="Genera">
<param name="xsd.module" value="config"/>
<param name="xsd.file" value="SaiaTabelleDecodifica"/>
</antcall>
</target>
<target name="GeneratorRichiesta">
<antcall target="Genera">
<param name="xsd.module" value="richiesta"/>
<param name="xsd.file" value="ap5/RichiestaSAIA"/>
</antcall>
</target>
<target name="GeneratorRisposta">
<antcall target="Genera">
<param name="xsd.module" value="risposta"/>
<param name="xsd.file" value="ap5/RispostaSAIA"/>
</antcall>
</target>
<target name="GeneratorProvaXML">
<antcall target="Genera">
<param name="xsd.module" value="provaxml"/>
<param name="xsd.file" value="ProvaXML"/>
</antcall>
</target>
<!--
<target name="Generator" depends="GeneratorDataStore,GeneratorRichiesta,GeneratorRisposta">
-->
<target name="Generator" depends="GeneratorRichiesta,GeneratorRisposta">
<mkdir dir="${build.java.dir}/${package.dir}"/>
<delete>
<fileset dir="${build.java.dir}/${package.dir}"/>
</delete>
<!--
-i C:/Javadev/wsAccerta/Accerta/castor/xsd/accerta.xsd
-dest C:/tmp/castor/src
-package it.datamanagement.accerta.castor
-f
-types j2
-->
</target>
</project>
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email

