Hi all,
i'm using the Commons Configuration library to manage XML configurations. I'm trying to manage this configuration using the built-in XPath expression engine based on Commons JXPath.
My XML configuration document looks like following:

<?xml version="1.0" encoding="utf-8"?>
<cfg:configuration
    xmlns:cfg="http://www.noemalife.com/configuration/xml/main";
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://www.noemalife.com/configuration/xml/main configuration.xsd">

<cfg:entry name="background">blue</cfg:entry>
<cfg:entry name="showmenu" mode="free">yes</cfg:entry>
<cfg:entry name="showstatusbar">yes</cfg:entry>

</cfg:configuration>

Now the problem is that i really don't know how to manage the cfg namespace.
That is:
- if i execute configuration.getProperty("cfg:ent...@name='background']"); it doesn't work at all, returning NULL (i also tryed with configuration.getProperty("/cfg:ent...@name='background']") or configuration.getProperty("/cfg:configuration/cfg:ent...@name='background']").....same result!) - if i REMOVE the namespace declarations from the configuration root element and i execute configuration.getProperty("ent...@name='background']"); i get the right result. But i need the namespace declaration.

Does anybody knows how to manage namespaces?

Thank you very much.

Lorenzo

--
Ing. Lorenzo Cavina
Analyst \ Emr Development

NoemaLife S.p.A
Via Gobetti, 52
40129 Bologna - ITALY
T +39 051 70.98.247
F +39 051 70.98.200
[email protected]

www.noemalife.com

Reply via email to