You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Mark Lybarger <ml...@gmail.com> on 2005/05/05 10:10:09 UTC

XMLProperty traversing

I'm new to using the XMLConfiguration and the commons configuration in 
general. i have an xml config file such as:

<system type="TEST">
<url name="OutGoingURL">
<value>http://outoging.test.url.com</value>
<type>java.net.URL</type>
</url>
<url name="InBoundURL">
<value>http://incoming.test.url.com</value>
<type>java.net.URL</type>
</url>
</system>
<system type="TEST2">
<url name="OutGoingURL">
<value>http://outoging.test.url.com</value>
<type>java.net.URL</type>
</url>
<url name="InBoundURL">
<value>http://incoming2.test.url.com</value>
<type>java.net.URL</type>
</url>
</system>

in my application i define an environment variable "ENV" and give the value 
of TEST or TEST2, etc. i'd like to be able to do something like 
myConfiguration.getProperty ( 
"//system/type='TEST'/url[@name='OutGoingURL']/value" );

i'm looking to manage internally some jndi url lookups since my app server 
doesn't give me a clean way to configure these per physical app instance.

thanks!

Re: XMLProperty traversing

Posted by Oliver Heger <ol...@t-online.de>.
It's true that we do not support XPath lookups yet. This is an often 
requested feature though. I am going to have a look at what can be done 
about it, but I am sorry I cannot promise anything concrete yet.

Oliver

Mark Lybarger wrote:

>after reviewing the mailing lists, it doesn't seem that commons 
>configuration xml configurator supports yet xpath like lookups. any news on 
>the status? 
>
>any thoughts on what it would take to implement?
>
>it shouldn't be too hard as the XMLConfigurator has the ability to return 
>w3c document.
>On 5/5/05, Mark Lybarger <ml...@gmail.com> wrote:
>  
>
>>I'm new to using the XMLConfiguration and the commons configuration in 
>>general. i have an xml config file such as:
>>
>><system type="TEST">
>><url name="OutGoingURL">
>><value>http://outoging.test.url.com</value>
>><type>java.net.URL</type>
>></url>
>><url name="InBoundURL">
>><value>http://incoming.test.url.com</value>
>><type>java.net.URL</type>
>></url>
>></system>
>><system type="TEST2">
>><url name="OutGoingURL">
>><value>http://outoging.test.url.com</value>
>><type>java.net.URL</type>
>></url>
>><url name="InBoundURL">
>><value>http://incoming2.test.url.com</value>
>><type>java.net.URL</type>
>></url>
>></system>
>>
>>in my application i define an environment variable "ENV" and give the 
>>value of TEST or TEST2, etc. i'd like to be able to do something like 
>>myConfiguration.getProperty ( 
>>"//system/type='TEST'/url[@name='OutGoingURL']/value" );
>>
>>i'm looking to manage internally some jndi url lookups since my app server 
>>doesn't give me a clean way to configure these per physical app instance.
>>
>>thanks!
>>
>>
>>    
>>
>
>  
>


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


Re: XMLProperty traversing

Posted by Mark Lybarger <ml...@gmail.com>.
after reviewing the mailing lists, it doesn't seem that commons 
configuration xml configurator supports yet xpath like lookups. any news on 
the status? 

any thoughts on what it would take to implement?

it shouldn't be too hard as the XMLConfigurator has the ability to return 
w3c document.
On 5/5/05, Mark Lybarger <ml...@gmail.com> wrote:
> 
> I'm new to using the XMLConfiguration and the commons configuration in 
> general. i have an xml config file such as:
> 
> <system type="TEST">
> <url name="OutGoingURL">
> <value>http://outoging.test.url.com</value>
> <type>java.net.URL</type>
> </url>
> <url name="InBoundURL">
> <value>http://incoming.test.url.com</value>
> <type>java.net.URL</type>
> </url>
> </system>
> <system type="TEST2">
> <url name="OutGoingURL">
> <value>http://outoging.test.url.com</value>
> <type>java.net.URL</type>
> </url>
> <url name="InBoundURL">
> <value>http://incoming2.test.url.com</value>
> <type>java.net.URL</type>
> </url>
> </system>
> 
> in my application i define an environment variable "ENV" and give the 
> value of TEST or TEST2, etc. i'd like to be able to do something like 
> myConfiguration.getProperty ( 
> "//system/type='TEST'/url[@name='OutGoingURL']/value" );
> 
> i'm looking to manage internally some jndi url lookups since my app server 
> doesn't give me a clean way to configure these per physical app instance.
> 
> thanks!
> 
>