ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Koberg <...@koberg.com>
Subject Re: property validation
Date Wed, 27 Oct 2004 23:47:15 GMT
Mark Lybarger wrote:

> 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>

Oh, I didn't know you need this at runtime. I don't think you can use a 
schema for this?? That is, there is no way to get the current DOM of the 
build file to validate. And even if you could, I was thinking you had a 
custom attribute you were trying to validate rather that validating 
something like, "if the value of property/@name equals MAJOR, then 
value of property/@value must be an int".

So forget what I said :)

best,
-Rob

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message