1) try using regexps for validation
2) access is via ${MAJOR} - you´ve forgotten the curly braces

Jan

> -----Ursprüngliche Nachricht-----
> Von: Mark Lybarger [mailto:[EMAIL PROTECTED]
> Gesendet am: Mittwoch, 27. Oktober 2004 13:39
> An: Ant Users List
> Betreff: RE: property validation
> 
> this is interesting indeed.
> 
> i'm only vaguely familar with schemas and their use.  i have 
> a build.xml which does my build.  does my custom schema go 
> into build.xs?  how do i reference that from build.xml?
> 
> here's a simple build.xml that needs to validate a property 
> MAJOR is numeric:
> 
> <?xml version="1.0"?>
> <project name="test" default="all" basedir=".">
>   <property file="test.properties"/>
>   <target name="all">
>     <input message="please enter MAJOR version:" addproperty="MINOR"/>
>     <echo>found property $MAJOR</echo>
>   </target>
> </project>
> 
> 
> > -----Original Message-----
> > From: Robert Koberg [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, October 27, 2004 7:19 PM
> > To: Ant Users List
> > Subject: Re: property validation
> > 
> > 
> > Mark Lybarger wrote:
> > 
> > > i'd like to validate some properties in my build file. we 
> > have version numbers specified as MAJOR, MINOR, and BUG and 
> > i'd like to make sure they're numeric (preferably 2 digits or 
> > under).  does anyone know how i can possibly use ant's script 
> > (javascript) or something else to validate this?
> > > 
> > 
> > write a custom schema. In XML Schema you would do something like:
> > 
> > <xs:attribute
> >    name="MAJOR"
> >    use="required"
> >    type="xs:int"/>
> > 
> > Many people find Relax NG much easier to work with, so you 
> > might want to 
> > use it.
> > 
> > best,
> > -Rob
> > 
> > 
> > > thanks
> > > 
> > > 
> > > 
> > > 
> > --------------------------------------------------------------
> > ----------
> > > 
> > > 
> > 
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > 
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

Reply via email to