commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jim Prantzalos (Updated) (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CONFIGURATION-481) Variable interpolation across files broken in 1.7 & 1.8
Date Sun, 26 Feb 2012 20:50:49 GMT

     [ https://issues.apache.org/jira/browse/CONFIGURATION-481?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jim Prantzalos updated CONFIGURATION-481:
-----------------------------------------

    Description: 
With Commons Configuration 1.6, I was able to declare a variable in a properties file, and
then reference it in a XML file using the ${myvar} syntax.

For example:

global.properties:
{noformat}myvar=abc{noformat}

test.xml:
{code:xml}
<products>
  <product name="abc">
    <desc>${myvar}-product</desc>
  </product>
</products>
{code:xml}
 
config.xml:
<properties fileName="global.properties"/>
<xml fileName="test.xml" config-name="test">
  <expressionEngine config-class="org.apache.commons.configuration.tree.xpath.XPathExpressionEngine"/>
</xml>

When I try to retrieve the value, like so:

{code:java}combinedConfig.getConfiguration("test").configurationAt("products/product[@name='abc']",
true).getString("desc"){code:java}

I get "${myvar}-product" instead of "abc-product".

This was working in Commons Configuration 1.6, but seems to be broken in 1.7 and 1.8.

  was:
With Commons Configuration 1.6, I was able to declare a variable in a properties file, and
then reference it in a XML file using the ${myvar} syntax.

For example:

{noformat}
global.properties:
myvar=abc

test.xml:
<products>
  <product name="abc">
    <desc>${myvar}-product</desc>
  </product>
</products>
 
config.xml:
<properties fileName="global.properties"/>
<xml fileName="test.xml" config-name="test">
  <expressionEngine config-class="org.apache.commons.configuration.tree.xpath.XPathExpressionEngine"/>
</xml>
{noformat}

When I try to retrieve the value, like so:

{code:java}combinedConfig.getConfiguration("test").configurationAt("products/product[@name='abc']",
true).getString("desc"){code:java}

I get "${myvar}-product" instead of "abc-product".

This was working in Commons Configuration 1.6, but seems to be broken in 1.7 and 1.8.

    
> Variable interpolation across files broken in 1.7 & 1.8
> -------------------------------------------------------
>
>                 Key: CONFIGURATION-481
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-481
>             Project: Commons Configuration
>          Issue Type: Bug
>          Components: Interpolation
>    Affects Versions: 1.7, 1.8
>         Environment: Any OS, but have verified with Windows 7 and AIX 6.1, running Java
1.6.0.
>            Reporter: Jim Prantzalos
>
> With Commons Configuration 1.6, I was able to declare a variable in a properties file,
and then reference it in a XML file using the ${myvar} syntax.
> For example:
> global.properties:
> {noformat}myvar=abc{noformat}
> test.xml:
> {code:xml}
> <products>
>   <product name="abc">
>     <desc>${myvar}-product</desc>
>   </product>
> </products>
> {code:xml}
>  
> config.xml:
> <properties fileName="global.properties"/>
> <xml fileName="test.xml" config-name="test">
>   <expressionEngine config-class="org.apache.commons.configuration.tree.xpath.XPathExpressionEngine"/>
> </xml>
> When I try to retrieve the value, like so:
> {code:java}combinedConfig.getConfiguration("test").configurationAt("products/product[@name='abc']",
true).getString("desc"){code:java}
> I get "${myvar}-product" instead of "abc-product".
> This was working in Commons Configuration 1.6, but seems to be broken in 1.7 and 1.8.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message