Comments on Programming Scalaurn:uuid:0492bf61-5bf0-377b-afca-af3acef58db12009-08-11T20:58:57-07:00 <div>Reading XML <p id="para_that_backslash_what_the_docu">That backslash - what the documentation calls a <span class="emphasis"><em>projection function</em></span> - says, &#8220;find me elements named <span class="emphasis"><em>bread</em></span>&#8221;. We&#8217;ll always get a <code class="literal">NodeSeq</code> back when using a projection function. If we&#8217;re only interested in what&#8217;s between the tags, we can use the <code class="literal">text</code> method.</p> <blockquote><p>Will add some text about this. </p> &#8212; deanwampler (2009-07-12 21:59:51) </blockquote> </div>urn:uuid:000773f8-414e-375b-913b-a450b6fd6f6adeanwampler2009-07-12T21:59:51-07:00Comment on 'Reading XML' <div>Reading XML <p id="para_that_backslash_what_the_docu">That backslash - what the documentation calls a <span class="emphasis"><em>projection function</em></span> - says, &#8220;find me elements named <span class="emphasis"><em>bread</em></span>&#8221;. We&#8217;ll always get a <code class="literal">NodeSeq</code> back when using a projection function. If we&#8217;re only interested in what&#8217;s between the tags, we can use the <code class="literal">text</code> method.</p> <blockquote><p>That was supposed to be \\ and \. :-) </p> &#8212; dcsobral (2009-07-03 23:02:00) </blockquote> </div>urn:uuid:a956659f-cdaf-3fa0-913d-a9b6609ba053dcsobral2009-07-03T23:02:00-07:00Comment on 'Reading XML' <div>Reading XML <p id="para_that_backslash_what_the_docu">That backslash - what the documentation calls a <span class="emphasis"><em>projection function</em></span> - says, &#8220;find me elements named <span class="emphasis"><em>bread</em></span>&#8221;. We&#8217;ll always get a <code class="literal">NodeSeq</code> back when using a projection function. If we&#8217;re only interested in what&#8217;s between the tags, we can use the <code class="literal">text</code> method.</p> <blockquote><p> and \ represent a poor subset of XPath. But you can combine them with filters and maps and flatMaps. Which means, of course, you can combine them with for comprehensions. Some examples like the title of all books who have Dean Wampler as one of the books authors, comparing XPath and for-comprehensions might be good. </p> &#8212; dcsobral (2009-07-03 23:01:40) </blockquote> </div>urn:uuid:de8e1613-9745-3170-b849-54fa518efc92dcsobral2009-07-03T23:01:40-07:00Comment on 'Reading XML'