Java Mailing List Archive

Apache Ant Archive

» Ant Users List
» Ant Developers List
Using Java xml properties file with Ant

Using Java xml properties file with Ant

2007-07-20       - By nswoboda@(protected)
Reply:     1     2     3     4     5     6  

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:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "">

 <entry key="appName">Name</entry>
 <entry key="startBean">Something</entry>
 <entry key="versionNumber">2.5</entry>

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:

<xmlproperty file="" prefix="temp" />

But then all the values get thrown into the

<echo> using Prop=${} </echo>


    [echo]  using Prop=Name,Something,2.5

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

Second question, since the Sun dtd specifies SYSTEM (not a publicid), is
it possible to use xmlcatalog?



Conversation, n.:
  A vocal competition in which the one who is catching his breath
  is called the listener.

To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 - Jax Systems, LLC, U.S.A.