title: How can I reference a string variable in a map:util element in a spring xml file when the string is defined in the same file?
body: <p>Below is the context of an xml file where I am defining a map and its elements. Some of the elements in the map will end up being comprised of xpaths where some portion of the xpaths will be the same. I want to create variables that will represent the portions of those xpaths that are redundant across elements.</p>
  
  <p>I have defined a bean with an id and a property and a value. No matter what I try, I am unable to reference the value of the bean. All I ever get when I ask for the value of Map.get("devo").get("error404CategoriesContainer") is "${errorContainer}". I want it to give me "//div[@id='noResultsFeatures']//div[contains(@class,'noResultsFeaturesContainer')]".</p>
  
  <p>The bean I am trying to create as a variable starts at &lt;bean id="errorContainer"
  The map entry where I am trying to use it is the &lt;entry key="error404CategoriesContainer" element. Regardless of which 3 things I try, I always get the same value. The text value of the item in the map, not the text value of the variable.</p>
  
  <p>I have searched everywhere, but I am not able to find a solution. I have tried a # symbol instead of a $ symbol. I have tried different ways of defining the bean and trying to "ref" the bean, all to no avail. Can someone guide me to a solution?</p>
  
  <p>Here is the content of the xml file</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
  xsi:schemaLocation="
  http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
  http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd"&gt;
  
  &lt;bean id="errorContainer" class="java.lang.String"&gt;
      &lt;property name="error404CategoryContainer" value="//div[@id='noResultsFeatures']//div[contains(@class,'noResultsFeaturesContainer')]"/&gt;
  &lt;/bean&gt;
  
  &lt;util:map id="devo"&gt;
      &lt;entry key="FourOFour"&gt;
          &lt;util:map&gt;                
              &lt;entry key="error404FeaturedCategoriesHeader" value="//h2[@id='noResultsFeaturesHeader' and contains(text(),'Featured Categories')]" /&gt;
  
  
     None of these works – I only have one in the file at a time.
  
              &lt;entry key="error404CategoriesContainer" value="${errorContainer}" /&gt;
              &lt;entry key="error404CategoriesContainer" value="${errorContainer. error404CategoryContainer}" /&gt;
              &lt;entry key="error404CategoriesContainer" value="${error404CategoryContainer}" /&gt;
  
  
              &lt;entry key="error404CategoriesContainerLinks" value="//div[@id='noResultsFeatures']//div[contains(@class,'noResultsFeaturesContainer')][${1}]//ul//li" /&gt;
              &lt;entry key="error404CategoriesContainerLinkByCategoryAndLinkNumber" value="//div[@id='noResultsFeatures']//div[contains(@class,'noResultsFeaturesContainer')][${1}]//ul//li[${2}]//a" /&gt;
          &lt;/util:map&gt;
      &lt;/entry&gt;
  &lt;/util:map&gt;
  </code></pre>
  
  <p></p>