Commons Configuration
  1. Commons Configuration
  2. CONFIGURATION-173

[configuration] Missing useful functionality of XPath in HierarchicalConfiguration

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

      Description

      Hi,

      I find out that there is missing very usefull functionality for
      org.apache.commons.configuration.HierarchicalConfiguration.

      For instance, I have XML like below:

      <?xml version="1.0" encoding="UTF-8"?>
      <Configuration>
      <Service name="contract.funds" class="my.MyClass">
      <ServiceParameters>
      <Param key="generate.request" value="true" />
      <Param key="request.xml.name"
      value="LifeFunds_REQ.xml" />
      <Param key="transform.response" value="true" />
      <Param key="reply.xml.name"
      value="dummy/LifeFunds_REP.xml" />
      <Param key="digester-rules.xml"
      value="LifeFunds_rules.xml" />
      </ServiceParameters>
      </Service>

      <Service name="contract.servicing.agents" class="my.MyClass">
      <ServiceParameters>
      <Param key="generate.request" value="true" />
      <Param key="request.xml.name"
      value="LifeServicingAgents_REQ.xml" />
      <Param key="transform.response" value="true" />
      <Param key="reply.xml.name"
      value="dummy/LifeServicingAgents_REP.xml" />
      <Param key="digester-rules.xml"
      value="LifeServicingAgents_rules.xml" />
      </ServiceParameters>
      </Service>

      <Service name="contract.additional.info" class="my.MyClass">
      <ServiceParameters>
      <Param key="generate.request" value="true" />
      <Param key="request.xml.name"
      value="LifeAdditionalInfo_REQ.xml" />
      <Param key="transform.response" value="true" />
      <Param key="reply.xml.name"
      value="dummy/LifeAdditionalInfo_REP.xml" />
      <Param key="digester-rules.xml"
      value="LifeAdditionalInfo_rules.xml" />
      </ServiceParameters>
      </Service>
      </Configuration>

      From the application I would like to go directly to the configuration of
      service with name: "contract.funds" instead of reading whole hierarhi and check
      if the name is equals "contract.funds" I prefer to get its parameters like this:

      config.getProperty("Service[@name='contract.funds']").ServiceParameters.Param)

      instead of calling in a loop:

      for(int i=0;;i++){
      if(config.getProperty("Service("i")[@name]").equals("contract.funds"))

      { // DO SOMETHING }

      }

      So in a simple words - it would be very helpfull if there will be full
      supoorted the XML Path Language (XPath) during requesting properties.

      Best regards
      Rafal

        Activity

        Henri Yandell made changes -
        Affects Version/s 1.1 Final [ 12311695 ]
        Henri Yandell made changes -
        Component/s Configuration [ 12311107 ]
        Assignee Jakarta Commons Developers Mailing List [ commons-dev@jakarta.apache.org ]
        Project Commons [ 12310458 ] Commons Configuration [ 12310467 ]
        Affects Version/s 1.1 Final [ 12311652 ]
        Key COM-2223 CONFIGURATION-173
        Henri Yandell made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 35753 12342375
        Rafal Zablocki created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Rafal Zablocki
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development