title: Using placeholder in XML file to placing the value from a properties file
body: <p>I would like to have palceholder in my xml file which places the value from a properties file.</p>
  
  <p>The <strong>SystemProperty.xml</strong> file is just a global system configuration file, not any kind of spring configuration, which looks like that</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;PropertyList&gt;
      &lt;Property&gt;
          &lt;Name&gt;CommandTimeout&lt;/Name&gt;
          &lt;Value&gt;60&lt;/Value&gt;
          &lt;Description&gt;Setting the timeout(in seconds)&lt;/Description&gt;
          &lt;DefaultValue&gt;&lt;/DefaultValue&gt;
      &lt;/Property&gt;
      &lt;Property&gt;
          &lt;Name&gt;Address&lt;/Name&gt;
          &lt;Value&gt;${server.IP}&lt;/Value&gt;
          &lt;Description&gt;ip:port&lt;/Description&gt;
          &lt;DefaultValue&gt;&lt;/DefaultValue&gt;
      &lt;/Property&gt;
  &lt;/PropertyList&gt;
  </code></pre>
  
  <p>It is using by XMLConfiguration bean to loading in</p>
  
  <pre><code>&lt;bean
      id="xmlConfiguration"
      class="org.apache.commons.configuration.XMLConfiguration"
      lazy-init="true"&gt;
      &lt;constructor-arg type="java.lang.String"&gt;
          &lt;value&gt;SystemProperty.xml&lt;/value&gt;
      &lt;/constructor-arg&gt;
      &lt;property name="expressionEngine"&gt;
          &lt;bean class="org.apache.commons.configuration.tree.xpath.XPathExpressionEngine" /&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>And use it in my code as below</p>
  
  <pre><code>@Autowired
  @Qualifier("xmlConfiguration")
  XMLConfiguration            xmlConfiguration;
  </code></pre>
  
  <p>However, the <strong><em>${server.IP}</em></strong> placeholder doesn't work any.</p>
  
  <p>In the other hand, for spring configuration xml, I can do that. For example, I have a <strong>Scheduler.xml</strong> which is Quartz configuration xml as below.</p>
  
  <pre><code>    &lt;property name="quartzProperties"&gt;
          &lt;props&gt;
                  &lt;prop key="org.quartz.jobStore.dataSource"&gt;PostgreSQLQuartzDataSource&lt;/prop&gt;
                  &lt;prop key="org.quartz.dataSource.PostgreSQLQuartzDataSource.driver"&gt;org.postgresql.Driver&lt;/prop&gt;
                  &lt;prop key="org.quartz.dataSource.PostgreSQLQuartzDataSource.URL"&gt;jdbc:postgresql://${scheduler.db.host}:${scheduler.db.port}/${scheduler.db.database}&lt;/prop&gt;
                  &lt;prop key="org.quartz.dataSource.PostgreSQLQuartzDataSource.user"&gt;${scheduler.db.username}&lt;/prop&gt;
                  &lt;prop key="org.quartz.dataSource.PostgreSQLQuartzDataSource.password"&gt;${scheduler.db.password}&lt;/prop&gt;
                  &lt;prop key="org.quartz.dataSource.PostgreSQLQuartzDataSource.maxConnections"&gt;10&lt;/prop&gt;
                  ...
          &lt;/props&gt;
      &lt;/property&gt;
  </code></pre>
  
  <p>And <strong>application.properties</strong> file as below</p>
  
  <pre><code># Quartz scheduler database resource
  scheduler.db.host=127.0.0.1
  scheduler.db.port=5432
  scheduler.db.database=scheduler
  scheduler.db.username=test
  scheduler.db.password=test
  
  # Server settings
  server.IP=192.168.111.12
  </code></pre>
  
  <p>By using PropertyPlaceholderConfigurer bean:</p>
  
  <pre><code>&lt;bean
      id="propertyConfigurer"
      class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&gt;
      &lt;property name="locations"&gt;
          &lt;list&gt;
              &lt;value&gt;classpath:application.properties&lt;/value&gt;
          &lt;/list&gt;
      &lt;/property&gt;
  &lt;/bean&gt; 
  </code></pre>
  
  <p>And of cause import the Scheduler.xml in SpringApplication-context.xml</p>
  
  <pre><code>&lt;import resource="Scheduler.xml" /&gt;
  </code></pre>
  
  <p>Is it possible to import properties into a normal XML file for using placeholder? Can I set up it in XMLConfiguration or any other ways?</p>
  
  <p>Any help is appreciated.</p>