16th Chapter XML
tags (space delimited): What the Scala lesson 1.<fred/> (0) gets. <fred/> (0) (0) what to get.
Will be <fred/>. Since <fred/> is a node, and node expands NodeSeq, it represents a length of 1 nodeseq. So when you call <fred/> (0) It's equivalent to calling the Apply () method, accessing his first element, returning the type of node, and the result is <fred/>. So no matter how many times you call (0) you will get <fred/> 2. What is the value of the following code? How you fix it.
<ul>
<li>opening bracket:[</li>
<li>closing bracket:]</li>
<li> Opening brace:{</li>
<li>closing brace:}</li>
</ul>
The main compilation will be problematic because of the cause of {. Repair:
Val ul = <ul>
<li>opening bracket:[</li>
<li>closing bracket:]</li>
< li>{"Opening brace:{"}</li>
<li>{"Opening Brace:}"}</li>
</ul>
println (UL)
3. The topic is slightly
The reason for the difference in behavior is that {"Fred"} The actual type is atom[string]. The former is text 4. Reads an XHTML file and prints all IMG elements without the ALT attribute.
The read process is not said, write down the core logic.
(Imglist \ "img"). Filter (_.attributes ("alt") ==null). foreach (println _)