XML in a Nutshell 122
XML in a Nutshell | |
author | Elliotte Rusty Harold & W. Scott Means |
pages | 480 |
publisher | O'Reilly & Associates |
rating | 8.5 |
reviewer | chromatic |
ISBN | 0-596-00058-8 |
summary | A solid and useful reference for XML developers. |
The Scoop
While one of the original goals of XML was to create a specification simple enough that a computer science student could produce a working parser in a week, a few new developments have complicated things slightly. The sea of W3C-recommended acronyms includes namespaces, XPath, XSL, XPointers, schemas, and dozens of specific XML applications. Adopting the simple rules of well-formed data helps, but the quickly-growing stable of related technologies is enough to make the sturdiest information architect weep. The specifications aren't as easy to read as, say, the latest Terry Pratchett novel, either.
XML in a Nutshell covers just the most important concepts. Cleanly written, it walks through the XML aspects likely to be used in most projects. As it assumes existing familiarity with the subjects, it does not spend much time in tutorial mode. Instead, these are the guts of the subjects, arranged nicely in dissection jars.
The first section covers XML basics. This includes the ubiquitous grove of angle brackets, the semantic intent and implication, a good chapter on DTDs, as well as internationalization concerns. The short discussion of namespaces is the clearest explanation this author has yet encountered.
Part two delves further into the reasons for using XML, exploring documents that use the structure to explain semantic relationships. DocBook and XHTML appear, as extended examples. Further, it explores the assistive technologies of XSL, XPath, XLinks, and XPointers. Again, the discussions of XSL and XPath compare very favorably to longer works, intended as tutorials. A brief examination of CSS and XSL Formatting Objects rounds out the section.
Part three explores the use of XML as a data transport. In this section, programming languages come into play. There's a strong hint of Java in the air, though most of the discussion follows a language-neutral path. Both the DOM and SAX parsing models have a dedicated chapter. They're short, but the essential pieces are described simply and effectively.
The final section makes or breaks the book. Luckily, XML in a Nutshell won't have much chance to gather dust. The two-hundred page reference section includes the most useful information. There's an annotated copy of the XML 1.0 Reference, arranged logically. The XSL reference, in particular, is quite good. DOM and SAX programmers will also enjoy their respective chapters. Finally, it's nice to have a large set of printed character tables handy.
What's to Consider
The parsing examples don't go much beyond DOM or SAX, and there's more than a strong Java flavor. (Of course, the models are very similar in most modern languages.) As well, some of the class interfaces in the SAX reference are hard to read. This is probably due to the complexity of the information instead of any editorial decision. There's also little discussion of actual XML applications. Instead, the book covers the principles behind perhaps 90% of XML usage. Again, this is not a complaint, just a clarification of the intended audience.
The Summary
The value of XML in a Nutshell should be readily apparent to XML developers. The material is well-organized and concise. It's a quintessential Nutshell book, upholding a tradition of utility and quality. Readers who've already been exposed to the presented material will likely keep this book close at hand.
Table of Contents
- XML Concepts
- Introducing XML
- XML Fundamentals
- Document Type Definitions
- Namespaces
- Internationalization
- Narrative-Centric Documents
- XML as a Document Format
- XML on the Web
- XSL Transformations
- XPath
- XLinks
- XPointers
- Cascading Stylesheets (CSS)
- XSL Formatting Objects (XSL-FO)
- Data-Centric Documents
- XML as a Data Format
- Programming Models
- Document Object Model (DOM)
- SAX
- Reference
- XML 1.0 Reference
- XPath Reference
- XSLT Reference
- DOM Reference
- SAX Reference
- Character Sets
You can purchase this book at Fatbrain.
No XML Schema, unfortunately (Score:2, Interesting)
Some people are under the misapprehension that XML's role is as the successor to HTML; that's a very limited viewpoint. Far more important and interesting is the role of XML as a language and host independent way of specifying data, particularly with respect to relational databases, and to type in conventional languages.
Online XML references? (Score:2, Interesting)
Re:XML is not likely to succeed (Score:2, Interesting)
XML allows mini-development languages to be made. For instance, an installation tool can offer XML objects for various actions (query-package, remove-package, install-package) and offer attributes for each (package-name, extra-args, show-statusbar, show-hourglass, show-drummingfingers, etc.). Using simple tags, these objects can be assembled into sophisticated installation apps with very little coding (or deep knowledge of C/C++/Java/C#/whatever). That's just one example.
Creating super-high-level languages that allow non-techies to make sophisticated graphic apps is a Good Thing(TM), and XML can make it all possible. I think that's pretty cool.
Java & XML (Score:4, Interesting)
Possibly a better book (also on O'Reilly title) is O'Reilly's Java & XML (ISBN: 0-596-00016-2 or EAN: 9780596000165). I have read this book and found it to be execellent. Although it is java-centric, it discusses concepts that could be easily applied to other languages. The book has good coverage of XML as well as usage of SAX, DOM, and JDOM, and using XML with databases, as configuration files, and in wireless devices. It also covers XSL/T and focuses on Apache XML projects.
A GOOD READ for anyone iterested in using XML.
I'm Sorry But I don't Get It (Score:2, Interesting)
How the XML is constructed is just like the usual context-free language. Any context-free grammar language (C/C++, Java, Pascal, etc) can easily be parsed by any functional language, such as Scheme, LISP, ML, or OCAML. Because context-free language is based on recursive grammar, it is pretty direct to translate it into the functional language. Manipulating and constructing the AST are also very easy.
Mapping 1:1 from XML to functional language representation is highly exaggerated. In ML, for example, one would have to build the table data structure -- eventhough this thing can be easily made. There are still some idiosyncrasies that you have to handle too, albeit is not as intricate as the one in imperative languages like Java or C/C++.
Mapping to AST itself does NOT yield the full usable extent of XML. XML itself is used to describe tuples of data. How you can flatten the AST tree out to records/structs/classes that is directly usable to the subsequent program? It's not that easy either in functional language. Moreover, the post product of records is highly suitable to imperative language rather than the functional language's.