commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Heger <heg...@med.uni-marburg.de>
Subject Re: [configuration] Support for XPath like queries?
Date Wed, 17 Aug 2005 11:51:05 GMT
Christoph Jaeger schrieb:
> Hi,
> 
> I was reading the documentation about XMLConfiguration on
> http://jakarta.apache.org/commons/configuration/howto_xml.html
> and now I wonder how it would be possible to get a list of all the
> fields of a table with a given tableType. The XML structure describe in
> the example looks like:
> 
> 
> <tables>
>   <table tableType="system">
>     <fields>
>       <field>...</field>
>       <field>...</field>
>       <field>...</field>
> ...
>     </fields>
>   </table>
>   <table tableType="application">
>     <fields>
>       <field>...</field>
>       <field>...</field>
>       <field>...</field>
> ...
>     </fields>
>   </table>
> </tables>
> 
> Now you can query a list of fields of the first table using a property
> name of "tables.table(0).fields.field".
> 
> But how would you query a list of fields for the table with tableType
> "system"? One way could be to loop over all "tables.table[@tableType]"
> elements, remember the index of the table containing the given tableType
> and use the syntax described above to get the list of fields.
> 
> I think it would be a lot easier (to write, and also to read the code
> afterwards), if one could just write:
> "tables.table[@tableType='system'].fields.field"
> 
> Is a syntax like this supported by Commons Configuration? I think a read
> about something like this, but can not seem to remember where.
> 
> Best Regards,
> 
> Christoph J├Ąger
> 
> Does the commons-configuration XMLConfiguration class support XPath
> 

Hi Christoph,

XPath syntax is not yet supported. There is an enhancement request for 
this in bugzilla:

http://issues.apache.org/bugzilla/show_bug.cgi?id=35753

I cannot estimate when we come to implement this, but I am myself very 
interested in this topic.

Oliver

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message