Slashdot Mirror


Inside XML

Years after the virtues of XML were first extolled (and plenty of uses both front-and-center and behind-the-scenes later), XML still isn't the do-all, be-all wonder we were led to believe. Book reviewing genius chromatic here dissects a book that sounds aimed at intermediate or advanced programmers (of other languages) who want extend their grasp with a greater understanding of the flexibility inherent to XML. How well it succeeds? Well, see what he's got to say about that.

Inside XML author Steven Holzner pages 1102 publisher New Riders rating 7 reviewer chromatic ISBN 0-7357-1020-1 summary A detailed but uneven treatment of XML and related topics.

The Scoop People love it, but XML won't save the world. If properly applied, it will improve the transfer of information between different individuals, platforms, and programs. A language that describes languages, XML in the real world has spawned hundreds of applications. In Inside XML, Steven Holzner attempts to make sense of the basic principles and more popular implementations as things stand right now. What's to Like? Holzner's caught platform independence fever, and he imparts a healthy sense of respect for W3C standards to his readers. While the current state of XML handling, especially in web browsers, is mediocre at best, he varies platforms when possible. Though most examples use IE on Windows, the author occasionally examines offerings from Mozilla and IBM.

The book's strength is describing a technology. The first five chapters explore XML's essential concepts, including DTDs and schemas, in as good an explanation as you'll find anywhere. Later chapters cover XSL (used to format and to transform documents), XHTML (the successor to HTML), CSS (governing the presentation of XML and XHTML documents) and RDF and CDF (to describe available resources) in sufficient detail. The explanations here are good, with accurate information and plenty of examples.

Java programmers will appreciate the extended descriptions of the DOM and SAX parsing styles. Though the examples themselves are in Java, most concepts translate fairly well to other languages. JavaScript also gets some attention, mostly in the confines of IE5.

What's to Consider? Though the cover blurb claims otherwise, most programming examples use Java. Perl earns a brief 13-page treatment, while ASP and Java Servlets share just eight pages in the same chapter. Exotic languages like C and C++ are conspicuously absent. A detailed description of the DOM and SAX approaches would benefit everyone, not just Java hackers.

This massive tome could have stood another round of editing. Many examples run up to a page and a half in length when only two to four lines have changed from the previous listing. Other material is arguably filler, such as four and a half pages of JavaScript events supported in IE, or fifteen pages detailing XML DOM objects and associated methods before giving a single example of DOM usage. The publisher could have cut between 100 and 200 pages, instead adding footnotes to authoritative sites.

Worse yet, the book's organization is questionable. After describing the basics of XML, it veers off into a 50-page JavaScript tutorial. Java soon suffers the same fate. These chapters break the flow of subjects, use no XML in their examples, and should be appendices. (They're decent, as far as tutorials go. They just don't belong in the middle of the book.) Readers will have difficulty finding useful reference material mixed in with tutorials.

English majors will also find Holzner's transitions awkward. Logical sections often conclude with a phrase such as "Now I will talk about the topic named in the heading immediately following this sentence." XML is not a serial radio cliffhanger, and most readers can find their way down the page by themselves. It occurs often enough to be distracting.

The Summary Besides the reservations above, most of the information is solid and usable. Inside XML is at its best when describing technologies instead of how to work with them. Uneven presentation hinders (not hobbles) the book, making it a better introduction than a definitive guide. Though falling short of its claims, cautious readers will learn plenty. Table of Contents
  1. Essential XML
  2. Creating Well-Formed XML Documents
  3. Valid XML Documents: Creating Document Type Definitions
  4. DTDs: Entities and Attributes
  5. Creating XML Schemas
  6. Understanding JavaScript
  7. Handling XML Documents with JavaScript
  8. XML and Data Binding
  9. Cascading Style Sheets
  10. Understanding Java
  11. Java and the XML DOM
  12. Java and SAX
  13. XSL Transformations
  14. XSL Formatting Objects
  15. XLinks and XPointers
  16. Essential XHTML
  17. XHTML at Work
  18. Resource Description Framework and Channel Definition Format
  19. Vector Markup Language
  20. WML, ASP, JSP, Servlets, and Perl
  1. The XML 1.0 Specification

You can purchase this book at FatBrain.

9 of 127 comments (clear)

  1. Re:xml by CaseyB · · Score: 3
    What happens when there's a " character in value1? What values are valid for KEY2, and how do you check them? How many platforms are you prepared to write code on that can parse your format?

    The idea is that XML spares you the trouble of defining your own file format and managing all the grunt work of data files. It lets you use common parsing, validation, and document manipulation tools.

  2. Re:XML will set you free by Anonymous+Commando · · Score: 3

    Hmmm.... let's try a little something here:

    s/XML/Java/
    Funny... it still sounds right. now let's try:
    s/Java/ActiveX/
    Spooky - sounds like a Microsoft press release. Now, for the grande finale:
    s/ActiveX/SlashDot/
    OK, well maybe that was pushing it just a little...
    ________________________
    --
    Corporate Jenga: You take a blockhead from the bottom and you put him on top...
  3. When XML is useful by geophile · · Score: 3
    XML is great if you have to specify something of moderate complexity and a GUI is not necessary. Instead of just hacking a parser of some little language invented for some specific purpose, or building the stupid GUI, you can just lay out your data in XML, and then use the SAX parser to deliver the data to your application.

    If you're using Java, then a properties file is a good alternative, but if your data gets too complex, (e.g. repeating fields), XML will be much simpler.

  4. Re:XML by orblee · · Score: 3
    The simplicity is an advantage. Yes, on its own XML is a bit pants, but because of its simplicity, many add-in facilities are available. XSLT allows you to turn an XML document into anything (a Postscript Document if you want) and certainly back to SGML if necessary. It is an object-oriented language which some people will hiss at, but it does settle really nicely when coding in most programming languages. Okay, XML isn't ideal for databases (because it is object oriented and most databases aren't - hence why OOP languages work on recordsets and pass SQL as strings to a connection object), however, there are ways around this.

    To me, the main advantage is the fact that it is both machine and human readable. An XML config file is normally instantly understandable and programming languages can manipulate it quite easily without having to worry about CR/LFs and the completely different formats in flat file databases.

    Also, the new XML Schemas allow a fully self-documenting, detailed explanation of what the content of an XML document should contain. You could use a stylesheet to turn the Schemas into DocBook documentation if you so desired. Certainly better than going over your application, taking notes, and writing up the documentation.

    To be honest, although all of here at Slashdot can think that XML hasn't had an effect. MS's .NET is going to be entirely XML based, which is a good thing as it will allow communication with their platform easily. Sun's released ONE, which is just a rebranding name against .NET for Java, but it works now and is being used now. GNOME uses XML heavily and why not? Anyone writing applications can easily read the config files and output of another application and know what to do with it.

    Okay, I've ranted a bit here, sorry, but it isn't just the future, it's the present. Of course, in the UNIX world we'll continue to use flat files and standard non-object oriented databases, but when we want to talk with the rest of the world, we will have a method of doing so now that doesn't involve reverse-engineering and so is a lot quicker to develop.

  5. Other XML synergies: Re:XML is very useful... by mesocyclone · · Score: 3
    I have been doing XML in Java for over a year, and friends have extensively used it for 3 or 4 years. XML is one of those rare things, like Java, that has synergistic value.

    Prior to XML, we had used our own text based markup language (surprisingly similar to XML except only two levels of hierarchy) since 1989. We (30 year OLTP designers and coders) found it *much easier* to design, develop, debug, comunicate about, and communicate with than prior fixed field non-text formats

    List of Synergies in case of XML (and mostly true with our old approach) include:

    • Use of off the shelf editors to create debug messages.
    • Messages (documents to an XML purist) easy to generate from auxiliary programs for data loading.
    • Logging using the same XML as the original messages, and adding other XML message/subtree types for internal actions, is very easy, and you can use all sorts of available tools to work on the logs.This true for data export logs and debug logs.
    • >b>Use of XML display programs (the best I have used so far includes the dreaded M-word - Microsoft explorer). With Explorer 5.0 and above (and I think 4.0 and above), if you click on a .xml file, it will bring it up "pretty printed". I suspect there are similar tools under Linux but I haven't used them in my Linux work.
    • Synergistic use in programs: if you create an application that uses XML for input and-or output, it is trivial to also use XML for configuration files for that application. Furthermore, you can take the hierarchical DOM data structures and use sub-trees (from the original input message) to pass data to lower levels of your architecture, without having to convert it into instance variables or some other protocol (e.g. RMI, COM or just method calls).
    • Multiple implentations of parser/generator API's. As another post mentioned, in the case of Java, the standardized two API's - DOM and SAX - allow one to pick and choose parsers from a widely available set, and not change any code. This is a powerful feature, letting you use, for example, a parser with strong error handling for test, and then changing it to a parser that is very fast for production. This can be done with a runtime command line argument if you want!

      I would also point out that I have used SAX in some cases and DOMs in another. I had no problem quickly using SAX for message-based uses. It may be harder when using all the features of XML, but not all are needed for most data interchange usages.

    --

    The only good weather is bad weather.

  6. XML is just a descriptive markup by graniteMonkey · · Score: 3

    Of course you can't think of XML as some sort of godsend. It won't make your children's teeth straighter and whiter. It won't solve world hunger, and it won't create a tax law that is equally fair and acceptable to all.

    It's just a markup language. It's only strengths lie in the fact that 1)it clearly and easily represents heirarchical data and 2)could become a standard way of representing data in many applications.

    If XML finds its way into wide acceptance under certain industries(if it hasn't already), then its strength as a descriptive markup is perfectly valid. It will make business easier if you can unambiguously exchange information, rather than sifting through proprietary annotations or trying to convert a flat ASCII file into [proprietary language of your choice].

    <rant>
    I am sorry to see from the looks of the review that New Riders has gone the way of Sybex and Que, though. As far as books in "pop tech" go, you can usually go by this rule of thumb: thickness is inversely proportional to quality.

    Take two examples: My O'Reilly XML(before the standard) pocketbook, and our Que "Mastering Javascript" Special edition. My O'Reilly book is a scant 107 (small) pages, yet has proven to be a completely invaluable reference. I wouldn't trade it for anything but the next edition of the same book. Back when I was trying to learn Javascript, that freaking Que book wasted more of my time than anything else I've ever read. By the time I needed to know about the syntax for multi-dimensional arrays you could just forget it.
    </rant>

    --

    This is a manual virus. Copy it to your sig and help me spread!
  7. XML will set you free by cluge · · Score: 3
    According to many knowledgeable source, XML is my savior. You see, my new coffee machine has an ip address, and because of XML I can now program it to start my coffee before I get up!! People scoff at XML, and say what can it do, well here are some examples for the naw sayers

    • XML will soon be in most household appliances. Imagine not having to update the vacum cleaner OS with hard commands. Now with XML all your appliances have the updates "pushed" to them with XML.
    • XML will be installed into new super sneakers by Nike. It's a proven fact that little Asian girls are the best XML coders in the world. Nike is using this great source of talent to bring us the most technically advanced pair of running shoes.
    • XML can toast your toast on one side!! Toaster manufacturers have for years had to design to different toasters, one for the people that want toast only toasted on one side (Sting's preference) and the rest of the world. Now with XML, set your preference and voilla, toast YOUR way.

      People that explain XML carefully should be revered. These scholars are pointing the way to the future. WHO CARES if the book uses strange English. It is after all a technical document and should be as obfuscated as possible!

      Quote from early car manual (Subaru 360) "if one wish to engage first gear, one is pleased to depress clutch." Who needs clarity in writing and loginc when gems such as this are produced. I'm awaiting my XML update to that great old car

    --
    "Science is about ego as much as it is about discovery and truth " - I said it, so sue me.
  8. Re:XSLT book by pr0nbot · · Score: 4

    Wrok wrote: Of course the key to XML is the Apache projects parser and transformer libs over at http://www.apache.org

    Funnily enough I have been trying to use the Apache code (Xerces-C & Xalan) for 2 weeks with marginal success. It's a huge, sprawling library, abstracted to the point where you can't hope to do more than copy and paste the sample code. Clearly they've been having a lot of fun with the patterns book. E.g. before you even think about performing an XSLT transformation there are around 10 factory/liaison/environment objects that need to be set up, and without a deep knowledge of what each is, you've little choice but to just copy-and-pray.

    Besides, there has to be something iffy about a library that has 3 implementations of a string class...

    *sigh* oh for the days when slim, well-defined libraries were the norm.

  9. Did Vince McMahon just buy the XML? by tenzig_112 · · Score: 5
    It's like the regular HTML, but we now have extra tags like:
    • <TAUNT>
    • <FLYING BUTTRICE>
    • <CHAIRWHIP>

    Some say that the XML isn't even a real language, that in spite of its proclaimed extensibility, it is "fixed." But I think they're cultural elitists.

    Applications for the XML