Ruby Way using Rexml parsing xml

Source: Internet
Author: User

Rexml is a processor written entirely in Ruby, with a variety of APIs, two classic APIs that are distinguished by dom-like and sax-like. The first is to read the entire file into memory and then store it as a layered form (that is, a tree). The second is "parse as you Go", which is more appropriate when your files are large and memory is limited.

Look at the following book.xml:

Reference

 <library shelf= "recent acquisitions" > <section name= "Ruby" > <book isbn= "0672328844" > <title>the Ruby way</title> <author>hal fulton</author> <descriptio N> Second Edition. 
            The book is are now reading. 
        Ain ' t recursion grand? </description> </book> </section> <section name= "Space" > <book ISBN = "0684835509" > <title>the case for mars</title> <author>robert zubrin</a 
            Uthor> <description>pushing toward a second home for the human race. </description> </book> <book isbn= "074325631X" > <title>first man:t His life of Neil A. armstrong</title> <author>james R. hansen</author> <desc Ription>definitive Biography of thE-Man on the moon. </description> </book> </section> </library> 

Related Article

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.