Docsity

Lecture Notes on XML, Continued - Program Language Techniques | CMSC 433, Study notes of Programming Languages

Partial preview of the text

Download Lecture Notes on XML, Continued - Program Language Techniques | CMSC 433 and more Study notes Programming Languages in PDF only on Docsity!

XML, continued

CMSC 433

Dec 6th

Resources

  • Sun’s XML tutorial
    • http://java.sun.com/xml/tutorial_intro.html
  • XML Processing in Java
    • http://www.cafeconleche.org/books/xmljava/
  • A Design Review of JDOM
    • http://www.artima.com/intv/jdomP.html
  • XML project, distributes to linux cvs

XML Tree API’s

  • DOM
    • Oldest (1998?), cross-language (Javascript, …)
    • Not very Java like
  • JDOM
  • XOM
    • Most recent (2002)
    • “XOM diverges from these models is that it strives for absolute correctness and maximum simplicity.”

Tree based APIs

  • Can be easier to use than push/observer style APIs such as SAX
  • Builds entire structure in memory
    • Requires 2-10 times as much space as the character representation of the XML document
  • Good for building and transforming trees, arbitary tree walks

Some DOM notes

  • Only one exception class, with short exception codes
  • Interface/Factory based
  • Nodes cannot be detached
  • Can’t change DocType
  • No built-in support for XPath and XSLT

JDOM

  • More Java friendly API
    • getChildren() returns List
      • Unfortunately not List