ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nswob...@clip.dia.fi.upm.es
Subject Re: Using Java xml properties file with Ant
Date Fri, 20 Jul 2007 15:45:16 GMT
> It would be nice if there were a way for the xmlproperty task to create pro=
> ps with an XPath like syntax.  Something like:
> 
> temp.properties.entry(key=3D"appName")  would return Name

I think that we would want something like this, the other suggestions
imply some 'known' ordering on the properties in the xml file which
isn't in the spirit of things.

But the thing that surprises me is that the XML file is in the 'blessed
by Sun' format for properties, so ideally the property task should be
able to read it.  loadFromXML was introduced in 1.5, is the issue
related to not wanting to have to rewrite it for ant to work with older
java versions?

Nik

> > ----- Original Message -----
> > From: nswoboda@clip.dia.fi.upm.es
> > To: user@ant.apache.org
> > Subject: Using Java xml properties file with Ant
> > Date: Fri, 20 Jul 2007 16:05:19 +0200 (CEST)
> >=20
> >=20
> > We are building a piece of software which has a number of Java
> > properties files in xml format (the kind which are read with
> > Properties.loadFromXML).  An example:
> >=20
> > <?xml version=3D"1.0" encoding=3D"UTF-8"?>
> > <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
> >=20
> > <properties>
> >    <entry key=3D"appName">Name</entry>
> >    <entry key=3D"startBean">Something</entry>
> >    <entry key=3D"versionNumber">2.5</entry>
> > </properties>
> >=20
> > I would like to be able to read these files and use their properties from
> > within ant.  The property task doesn't seem to handle properties files
> > in xml so I have been trying to use the xmlproperty task:
> >=20
> > <xmlproperty file=3D"temp.properties.xml" prefix=3D"temp" />
> >=20
> > But then all the values get thrown into the temp.properties.entry
> > property:
> >=20
> > <echo> using Prop=3D${temp.properties.entry} </echo>
> >=20
> > gives:
> >=20
> >       [echo]  using Prop=3DName,Something,2.5
> >=20
> > I assume that this should be trivial but I can't find a good solution to
> > get it to do the obvious thing (load three separate properties).
> > Suggestions?
> >=20
> > Second question, since the Sun dtd specifies SYSTEM (not a publicid), is
> > it possible to use xmlcatalog?
> >=20
> > Thanks,
> >=20
> > Nik
> > ____________________________________________________
> >=20
> > Conversation, n.:
> > 	A vocal competition in which the one who is catching his breath
> > 	is called the listener.
> >=20
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> 
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 


____________________________________________________

"I am ready to meet my Maker.  Whether my Maker is prepared for the
great ordeal of meeting me is another matter."
		-- Winston Churchill

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


Mime
View raw message