On Sun, May 31, 2009 at 10:37 PM, Ralph Goers <ralph.go...@dslextreme.com>wrote:

> This should have gone to the dev list.
>
> On May 31, 2009, at 10:33 PM, Ralph Goers wrote:
>
>
>> On May 31, 2009, at 9:24 AM, chris0 wrote:
>>
>>
>>> Hello,
>>>
>>> I'm making this proposal because I couldn't find a good solution to a
>>> problem that I recently had.
>>>
>>> What I wanted to do was to configure an application with a simple XML
>>> file,
>>> something along the lines of:
>>>
>>> <config>
>>>        <title>test</title>
>>>        <version
>>>                major="1"
>>>                minor="2"/>
>>>        <roles>
>>>                <role name="admin"/>
>>>                <role name="user"/>
>>>        </roles>
>>>        <users>
>>>                <user name="joe" password="pass" role="admin"/>
>>>                <user name="harry" password="secret" role="user"/>
>>>        </users>
>>> </config>
>>>
>>> So the point is that it's really a very simple bit of XML data and what I
>>> wanted was a nice easy way to read it in.
>>
>>
This is *exactly* the kind of thing that Commons Digester was designed for.

--
Martin Cooper




> The current options seem to be
>>> SAX, DOM or JAXB.
>>>
>>>  Why not just use Commons Configuration and do:
>>
>> HierarchicalConfiguration config = new XMLConfiguration("config.xml");
>> String title = config.getString("title");
>> int majorVersion = config.getInt("versi...@major]");
>>
>> etc.
>>
>> Ralph
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> For additional commands, e-mail: dev-h...@commons.apache.org
>
>

Reply via email to