16th Chapter XML

Source: Internet
Author: User
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 _)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.