commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christian Migowski" <>
Subject commons-configuration XMLConfiguration get attributes with XPathExpressionEngine
Date Tue, 26 Feb 2008 13:15:48 GMT

how can I use XPathExpressionEngine to get a list of XML attributes? It
seems like i cannot get it working, here is an easily reproducable example.

Given the XML file simple.xml:
<?xml version="1.0" encoding="UTF-8"?>
<Pool id="eins">
 <Name>Name 1</Name>
<Pool id="zwei">
 <Name>Name 2</Name>
<Pool id="drei">
 <Name>Name 3</Name>

The code:
 XMLConfiguration config = new XMLConfiguration("simple.xml");
 config.setReloadingStrategy(new FileChangedReloadingStrategy());
 config.setExpressionEngine(new XPathExpressionEngine());
 List x = config.getList("/Pool[@id]");

x ist always empty... I would assume it to contain three elements "eins",
"zwei" & "drei". What am I doing/thinking wrong?


P.S. how can I search the maling list? The archive link from does not seem to
contain a searching functionalilty

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message