Monday, April 21, 2014

Introducation XML and JAXP

- XML parsers là chương trình giúp trích xuất và thao tác với dữ liệu trong một tài liệu XML.
- Lợi ích :

  1. Là một ngôn ngữ độc lập.
  2. Không phụ thuộc vào mã nguồn.
  3. Linh hoạt và phù hợp với hầu hết các ngôn ngữ.
- JAXP cung cấp một parsers để làm việc XML. Có 2 kỹ thuật phân tích dữ liệu XML là DOM và SAX:

  1. DOM: Document Object Model là một kỹ thuật tiếp cận dữ liệu theo hướng đối tượng. trong đó tất cả các thành phần của XML như thẻ, thuộc tính, text… đều được xem như là các đối tượng. Dựa vào các đối tượng này mà chúng ta có thể trích xuất thông tin, thay đổi thông tin hay truy vấn thông tin dựa vào các hàm mà đối tượng cung cấp. 
    1. Ưu điểm:
      • Dẽ dàng sử dụng và phân tích xml.
      • Có thể truy xuất ngầu nhiên.
      • Quản lí tốt dữ liệu phức tạp.
    2. Nhược điểm:
      • Việc đọc chỉ được thực hiện 1 lần tốn thời gian nhất định.
      • Tốn bộ nhớ.
  2. SAX:  Simple API for XML là một phương pháp phân tức XML theo hướng sự kiện, đọc xml từ trên xuống dưới.
    1. Ưu điểm:
      • Tốn ít bộ nhớ.
    2. Nhược điểm:
      • Không support DTD Validate.
      • Không thể truy xuất ngẫu nhiên đối tượng bởi SAX sẽ đọc dữ liệu từ trên xuống dưới.
      • Không thể thêm sữa xóa dữ liệu trong XML.
- Khi nào sử dụng DOM và SAX:
  • Sử dụng SAX cho các tài liệu lớn hoặc cần tiết kiệm bộ nhớ.
  • Khi chỉ cần lấy một nội dụng trong tập hợp các thông tin trong XML sử dụng SAX.
  • Khi cần truy xuất ngẫu nhiên và thao tác với dữ liệu.
  • SAX nhanh hơn DOM.

19 comments:

  1. I guess you are a smart cookie because of your knowledge and insight.I'm trying to learn more knowledge and your articles are so useful for me. I think many people love and need them.
    best-app-currency-converter currency-converter-box-by-autoketing

    ReplyDelete
  2. I am very Happy to find your blog. The site is very interesting,I am sure that if I ask enough people, they'll agree with me, too
    facebook live chat help facebook chat boxautoketing app

    ReplyDelete
  3. I am just looking towards versions write-up. It happens to be best for learn men and women explain in words for the heart besides being familiar with in this particular important design is often just found out.
    App Shipping Bar Master
    Shipping Bar for Shopify
    autoketing.com

    ReplyDelete
  4. This is my first time visit here. From the huge amounts of remarks on your articles,I surmise I am not just one having all the satisfaction right here!
    Discount master, Create Discount master, autoketing

    ReplyDelete
  5. Maybe you could write next articles referring to this article. I want to read even more things about it!
    autoketing.com
    email app download
    email with love by autoketing

    ReplyDelete
  6. Took me time to read all the comments, but I really enjoyed the article. It proved to be Very helpful to me and I am sure to all the commenters here! It’s always nice when you can not only be informed, but also entertained!
    gaigoionline, clip gai goi, gai goi hn, gai bao, gai goi hcm

    ReplyDelete
  7. We are really grateful for your blog post. You will find a lot of approaches after visiting your post. I was exactly searching for. Thanks for such post and please keep it up. Great work
    friv10games club free online juegos, kizi-2018 games online, gogy xyz play now

    ReplyDelete
  8. Your writings are so good.You must be a kind people because you share your knowledge through articles.Thanks a million. I am waiting new posts.
    Games of gogy motox3m3 unblocked abcya3 2 player

    ReplyDelete
  9. It’s actually very complex in this busy life to listen news on Television, so I only use the web for that purpose, and obtain the newest news.
    Happy Wheels Game
    The-light-temple-fireboy-and-watergirl-2 Game
    Jelly-go Game

    ReplyDelete
  10. Hey, I am so thrilled I found your blog, I am here now and could just like to say thank for a tremendous post and all round interesting website.
    madalin stunt cars 2 club play now , the world cup soccer 2018 club online , geometry jump club online games ,

    ReplyDelete
  11. 4 player sheep party best online game
    Ice cream maker game online
    Colorzzle online
    I am just looking towards versions write-up. It happens to be best for learn men and women explain in words for the heart besides being familiar with in this particular important design is often just found out.

    ReplyDelete
  12. That's the reason center on it's essential to precise ground moves well before writing. Might be attainable so that you can extra advisable text that way
    game mr dubstep , moto x3m 4 winter free , santa claus jump best online games ,

    ReplyDelete
  13. Thanks for the auspicious writeup. When I have spare time, I often read your posts.When I need a piece of advice, I will find your posts and read them.
    Blocky Craft Police Squad Talking Tom Gold Run Online blocked game best game Tomb Runner

    ReplyDelete
  14. This website basically beautiful points and things right. My curiosity to learn more and more on this blog. The next occasion I read a weblog, Lets hope so it doesnt disappoint me as much as this.
    online game Papa's Scooperia online game Def Island Kick The Buddy online game

    ReplyDelete
  15. There is such a great amount in this article I would never have considered all alone. Your substance gives perusers things to consider in an intriguing way. Much thanks to you for your unmistakable data.
    miniclip unblocked, a10 games 2019, Jogo quente 2019

    ReplyDelete
  16. Superbly written article, if only all bloggers offered the same content as you, the internet would be a far better place..
    io jogos net
    friv 4 school
    2player games online

    ReplyDelete

  17. play food games
    basketball games free
    soccer free online
    Superbly written article, if only all bloggers offered the same content as you, the internet would be a far better place..

    ReplyDelete

  18. Babe Clicker
    Bouncy Golf
    Brazil World Cup 2014
    It proved to be Very helpful to me and I am sure to all the commentators here!

    ReplyDelete
  19. We call Buddy our 'oops!' We had no intention of getting a third dog, but after we adopted our second dog, Finn, we kept going back to the organization's website to see how many of the other dogs that were up for adoption were still there
    free kizi Games
    friv jogos gratis
    friv 4 school

    ReplyDelete