title: Scala Importing an XML to Map
body: <p>I'm just learning scala and im trying to import an XML file to a Map. The XML holds definitions using <code>&lt;word&gt;&lt;/word&gt;</code> and <code>&lt;description&gt;&lt;/description&gt;</code>. When I attempt to create the map I get the error:</p>
  
  <pre><code>Value update is not member of scala.collection.immutable.Map[String, String]
  </code></pre>
  
  <p>Any pointers would be appreciated!</p>
  
  <pre><code>    package main
  import scala.xml._
  
  object main {
  
    def main(args: Array[String]): Unit = {
      val definitions = XML.load("src\\main\\Definitions.xml");
      val definitionMap = (Map[String, String]() /: (definitions \ "word")) { (map , defNode) =&gt;
          val word = (defNode \ "word").text.toString()
          val description = (defNode \ "description").text.toString()
          map(word) = description
      }
      println(definitions.getClass())
      println("Number of elements is " + (definitions \\ "word").size)
    }
  
  }
  </code></pre>
  
  <p>and the XML is formatted as such:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;definitions&gt;
      &lt;entry&gt;
          &lt;word&gt;Ontology&lt;/word&gt;
          &lt;description&gt;A set of representational primitives with which to model a domain of knowledge or discourse.&lt;/description&gt;
      &lt;/entry&gt;
  
      &lt;entry&gt;
          &lt;word&gt;Diagnostic&lt;/word&gt;
          &lt;description&gt;The process of locating problems with software, hardware, or any combination thereof in a system, or a network of systems.&lt;/description&gt;
      &lt;/entry&gt;
      &lt;entry&gt;
          &lt;word&gt;Malware&lt;/word&gt;
          &lt;description&gt;Software that is intended to damage or disable computers and computer systems.&lt;/description&gt;
      &lt;/entry&gt;
      &lt;entry&gt;
          &lt;word&gt;Capacitor&lt;/word&gt;
          &lt;description&gt;A device used to store an electric charge, consisting of one or more pairs of conductors separated by an insulator.&lt;/description&gt;
      &lt;/entry&gt;
      &lt;entry&gt;
          &lt;word&gt;Stress Test&lt;/word&gt;
          &lt;description&gt;A test measuring how a system functions when subjected to controlled amounts of stress.&lt;/description&gt;
      &lt;/entry&gt;
      &lt;entry&gt;
          &lt;word&gt;Registry&lt;/word&gt;
          &lt;description&gt;A hierarchical database that stores configuration settings and options on Microsoft Windows operating systems.&lt;/description&gt;
      &lt;/entry&gt;
      &lt;entry&gt;
          &lt;word&gt;Antivirus&lt;/word&gt;
          &lt;description&gt;Designed to detect and remove computer viruses.&lt;/description&gt;
      &lt;/entry&gt;
  &lt;/definitions&gt;
  </code></pre>