Overview
Features
Download
Documentation
Community
Add-Ons & Services

get Configuration value from atribute filtered element

Please post support and help requests here.

get Configuration value from atribute filtered element

Postby zzwf » 28 Oct 2009, 12:33

Hi,

I do like the getString/getInt/getBool ... way to access the application configuration -- its very handy and simple, although I couldn't found where the complete syntax to access properties is documented. I found out how to access attributes of an element of a XML configuration via "the.document.tree[@attribute]" more or less by myself.

I was wondering if it is possible to access an specific element of an XML configuration by its filtered attribute
Code: Select all
<elements>
   <element id="1" value="A" />
   <element id="2" value="B" />
</elements>

Is it possible to access the value attribute of an element where id="2"?

I tried something like "elements.element[@id=2][@attribute]" but didn't find anything? Is something like this possible?

thank you very much.
zzwf
 
Posts: 11
Joined: 22 Jul 2009, 13:17

Re: get Configuration value from atribute filtered element

Postby guenter » 28 Oct 2009, 12:41

The documentation for XMLConfiguration has the details: http://pocoproject.org/docs/Poco.Util.X ... ation.html

Accessing a certain element by its attribute value is currently not supported.
guenter
 
Posts: 1165
Joined: 11 Jul 2006, 16:27
Location: Austria

Re: get Configuration value from atribute filtered element

Postby zzwf » 28 Oct 2009, 16:16

Thank you, I don't know why I didn't found that one :oops:

It doesn't help with everything I wanted, but for the most part the n-index syntax "prob[n][@attribute]" does the job.
zzwf
 
Posts: 11
Joined: 22 Jul 2009, 13:17


Return to Support

Who is online

Users browsing this forum: killerbobjr and 3 guests