XML in a Nutshell (In a Nutshell (O'Reilly)) and over 1.5 million other books are available for Amazon Kindle . Learn more


or
Sign in to turn on 1-Click ordering.
Trade in Yours
For a £0.40 Gift Card
Trade in
More Buying Choices
Have one to sell? Sell yours here
Sorry, this item is not available in
Image not available for
Colour:
Image not available

 
Start reading XML in a Nutshell (In a Nutshell (O'Reilly)) on your Kindle in under a minute.

Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.

XML in a Nutshell: A Desktop Quick Reference (In a Nutshell (O'Reilly)) [Paperback]

Elliotte Rusty Harold , W. Scott Means
5.0 out of 5 stars  See all reviews (2 customer reviews)
RRP: £34.50
Price: £22.08 & this item Delivered FREE in the UK with Super Saver Delivery. See details and conditions
You Save: £12.42 (36%)
o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o
Only 3 left in stock (more on the way).
Dispatched from and sold by Amazon. Gift-wrap available.
Want delivery by Friday, 24 May? Choose Express delivery at checkout. See Details

Formats

Amazon Price New from Used from
Kindle Edition £18.77  
Paperback £22.08  
Amazon.co.uk Trade-In Store
Did you know you can trade in your old books for an Amazon.co.uk Gift Card to spend on the things you want? Visit the Books Trade-In Store for more details. Learn more.

Book Description

30 Sep 2004 0596007647 978-0596007645 3

If you're a developer working with XML, you know there's a lot to know about XML, and the XML space is evolving almost moment by moment. But you don't need to commit every XML syntax, API, or XSLT transformation to memory; you only need to know where to find it. And if it's a detail that has to do with XML or its companion standards, you'll find it--clear, concise, useful, and well-organized--in the updated third edition of XML in a Nutshell.

With XML in a Nutshell beside your keyboard, you'll be able to:

  • Quick-reference syntax rules and usage examples for the core XML technologies, including XML, DTDs, Xpath, XSLT, SAX, and DOM
  • Develop an understanding of well-formed XML, DTDs, namespaces, Unicode, and W3C XML Schema
  • Gain a working knowledge of key technologies used for narrative XML documents such as web pages, books, and articles technologies like XSLT, Xpath, Xlink, Xpointer, CSS, and XSL-FO
  • Build data-intensive XML applications
  • Understand the tools and APIs necessary to build data-intensive XML applications and process XML documents, including the event-based Simple API for XML (SAX2) and the tree-oriented Document Object Model (DOM)
This powerful new edition is the comprehensive XML reference. Serious users of XML will find coverage on just about everything they need, from fundamental syntax rules, to details of DTD and XML Schema creation, to XSLT transformations, to APIs used for processing XML documents. XML in a Nutshell also covers XML 1.1, as well as updates to SAX2 and DOM Level 3 coverage. If you need explanation of how a technology works, or just need to quickly find the precise syntax for a particular piece, XML in a Nutshell puts the information at your fingertips.

Simply put, XML in a Nutshell is the critical, must-have reference for any XML developer.


Frequently Bought Together

XML in a Nutshell: A Desktop Quick Reference (In a Nutshell (O'Reilly)) + Sams Teach Yourself XML in 24 Hours: Complete Starter Kit
Price For Both: £38.71

Buy the selected items together


Product details

  • Paperback: 714 pages
  • Publisher: O'Reilly Media; 3 edition (30 Sep 2004)
  • Language: English
  • ISBN-10: 0596007647
  • ISBN-13: 978-0596007645
  • Product Dimensions: 15.5 x 3.8 x 23 cm
  • Average Customer Review: 5.0 out of 5 stars  See all reviews (2 customer reviews)
  • Amazon Bestsellers Rank: 106,195 in Books (See Top 100 in Books)
  • See Complete Table of Contents

More About the Authors

Discover books, learn about writers, and more.

Product Description

About the Author

Elliotte Rusty Harold is originally from New Orleans to which he returns periodically in search of a decent bowl of gumbo. However, he currently resides in the Prospect Heights neighborhood of Brooklyn with his wife Beth, dog Shayna, and cat Marjorie (named after his mother-in-law). He's a frequent speaker at industry conferences including Software Development, Dr. Dobb's Architecure & Design World, SD Best Practices, Extreme Markup Languages, and too many user groups to count. His open source projects include the XOM Library for processing XML with Java and the Amateur media player.

W. Scott Means has been a professional software developer since 1988, when he joined Microsoft Corporation at the age of 17. He was one of the original developers of OS/2 1.1 and Windows NT, and did some of the early work on the Microsoft Network for the Microsoft Advanced Technology and Business Development group. Since then he has written software for everything from multiplayer casino games to railroad geometry measurement equipment. For Scott's latest projects and musings on software development, visit his blog at smeans.com.

Excerpt. © Reprinted by permission. All rights reserved.

Chapter 9 Xpath

XPath is a non-XML language for identifying particular parts of XML documents. XPath lets you write expressions that refer to, for example, the first person element in a document, the seventh child element of the third person element, theID attribute of the first person element whose contents are the string "Fred Jones", all xml-stylesheet processing instructions in the document’s prolog, and so forth. XPath indicates nodes by position, relative position, type, content, and several other criteria. XSLT uses XPath expressions to match and select particular elements in the input document for copying into the output document or further processing. XPointer uses XPath expressions to identify the particular point in or part of an XML document to which an XLink links. The W3C XML Schema Language uses XPath expressions to define uniqueness and identity constraints. XForms relies on XPath to bind form controls to instance data, express constraints on user-entered values, and calculate values that depend on other values.

XPath expressions can also represent numbers, strings, or Booleans. This lets XSLT stylesheets carry out simple arithmetic for purposes such as numbering and cross-referencing figures, tables, and equations. String manipulation in XPath lets XSLT perform tasks such as making the title of a chapter uppercase in a headline or extracting the last two digits from a year.

The Tree Structure of an XML Document
An XML document is a tree made up of nodes. Some nodes contain one or more other nodes. There is exactly one root node, which ultimately contains all other nodes. XPath is a language for picking nodes and sets of nodes out of this tree. From the perspective of XPath, there are seven kinds of nodes:

• The root node
• Element nodesText nodes
• Attribute nodes
• Comment nodes
• Processing-instruction nodes
• Namespace nodes

One thing to note are the constructs not included in this list: CDATA sections, entity references, and document type declarations. XPath operates on an XML document after all these items have been merged into the document. For instance, XPath cannot identify the first CDATA section in a document or tell whether a particular attribute value was directly included in the source element start-tag or merely defaulted from the declaration of the element in a DTD.

Consider the document in Example 9-1. This exhibits all seven kinds of nodes. Figure 9-1 is a diagram of the tree structure of this document.

Example 9-1. The example XML document used in this chapter

Richard
P
Feynman

physicist
Playing the bongoes

The XPath data model has several nonobvious features. First of all, the root node of the tree is not the same as the root element. The root node of the tree contains the entire document including the root element, as well as any comments and processing instructions that occur before the root element start-tag or after the root element end-tag. In Example 9-1, this means the root node contains the xmlstylesheet processing instruction, as well as the root element people.

However, the XPath data model does not include everything in the document. In particular, the XML declaration, the DOCTYPE declaration, and the various parts of the DTD are not addressable via XPath, although if the DTD provides default values for any attributes, then those attributes are noted by XPath. The homepage element has an xlink:type attribute that was supplied by the DTD. Similarly, any references to parsed entities are resolved. Entity references, character references, and CDATA sections are not individually identifiable, although any data they contain is addressable. For example, XSLT cannot make all the text in CDATA sections bold because XPath doesn’t know which text is and isn’t part of a CDATA section.

Finally, xmlns and xmlns:prefix attributes are not considered attribute nodes. However, namespace nodes are attached to every element node for which a declaration
is in scope. They are not attached to just the single element where the
namespace is declared.

Location Paths
The most useful XPath expression is a location path. A location path identifies a set of nodes in a document. This set may be empty, may contain a single node, or may contain several nodes. These can be element nodes, attribute nodes, nmespace nodes, text nodes, comment nodes, processing-instruction nodes, root nodes, or any combination of these. A location path is built out of successive location steps. Each location step is evaluated relative to a particular node in the document called the context node.

The Root Location Path
The simplest location path is the one that selects the root node of the document. This is simply the forward slash /. (You’ll notice that a lot of XPath syntax is deliberately similar to the syntax used by the Unix shell. Here / is the root node of a Unix filesystem, and / is the root node of an XML document.) For example, this XSLT template rule uses the XPath pattern / to match the entire input document tree and wrap it in an html element:

/ is an absolute location path because no matter what the context node is—that is, no matter where the processor was in the input document when this template rule was applied—it always means the same thing: the root node of the document. It is relative to which document you’re processing, but not to anything within that document.


Inside This Book (Learn More)
Browse Sample Pages
Front Cover | Copyright | Table of Contents | Excerpt | Index | Back Cover
Search inside this book:

What Other Items Do Customers Buy After Viewing This Item?


Customer Reviews

4 star
0
3 star
0
2 star
0
1 star
0
5.0 out of 5 stars
5.0 out of 5 stars
Most Helpful Customer Reviews
5 of 5 people found the following review helpful
5.0 out of 5 stars A great place to start for techie types 13 Feb 2007
By Steve Q
Format:Paperback|Amazon Verified Purchase
True to form for the Nutshell guides, its brief, to the point and explains most XML related concepts XSL, XPATH, XML Schema etc in a really readble format.

If you've every written an kind of programming language then this is an excellent guide to take you through XML.

I wouldn't say the coverage is 100%, it simply wouldn't fit in a concise guide like this if it were, it will cover the vast majority - theres always google for that one case of something really odd.
Comment | 
Was this review helpful to you?
2 of 3 people found the following review helpful
5.0 out of 5 stars Bible for the XML klutz 5 Aug 2009
By C. A. Austin VINE™ VOICE
Format:Paperback|Amazon Verified Purchase
I sold this book. I wish I hadn't.

I write 'correct' XHTML: all the online tutorials tell me that, hey, I've got it down already. They're wrong; I hadn't even skimmed the surface!

This hefty tome takes you all the way from first XML principles to tantalising challenges, where you see just how powerful a universally-understood protocol can be. I read those parts, but wasn't ready to put them into practice ... I want the book back!!

I'd advise getting it, using it until the pages have turned to mulch, and keeping up with the related websites. Don't let its weight & volume put you off, like I did!
Comment | 
Was this review helpful to you?
Most Helpful Customer Reviews on Amazon.com (beta)
Amazon.com: 4.3 out of 5 stars  19 reviews
33 of 33 people found the following review helpful
3.0 out of 5 stars A reference useful for a limited audience among those who already know XML basics 31 July 2006
By Christopher Culver - Published on Amazon.com
Format:Paperback
O'Reilly's XML IN A NUTSHELL is, like all entries in the Nutshell series, a desktop quick reference. It provides concise information about nearly all matters of XML, and is split into roughly four parts. The first introduces XML, the concept of tags, well-formedness, Unicode, DTD's and schemas, namespaces, and so forth. The second provides an overview for the many formats that are built upon XML, such as XHTML, XSL:FO, Docbook, etc., and technologies that plug-in into XML, namely XSLT, XPath, XLinks, XPointers, XInclude, and CSS. The fourth covers DOM and SAX, the APIs for dealing with XML. Finally, the book ends with a "Reference section" for various technologies covered earlier in the book, structured much like O'Reilly's pocket guides. I found the Reference section somewhat inconvenient, it causes flipping back and forth when each section could have been simply integrated with the previous discussion of the relevant technology earlier in the book. Furthermore, the book ends with a long series of Unicode character tables, which are of limited utility, as they cover only a portion of Unicode, which has already expanded in the time since, and these tables simply bloat the book a little.

This third edition is especially admirable for its advocation of schemas, whereas many other XHTML publications would mention only DTDs.

XML IN A NUTSHELL is emphatically not a tutorial for XML, in spite of the friendly introduction to the markup language that opens the book. For each of the technologies mentioned herein, you'll want a separate book. For XPath especially, O'Reilly's XPATH AND XPOINTER is worth getting. XML IN A NUTSHELL instead provides only a quick reference for matters the reader is already acquainted with. Now, much of this quick reference information can be freely had on the Web. I'd recommend the book only to those who are fortunate enough to have someone else cover their book expenses, or can get it from their library, or those who simply adore print documentation.
30 of 32 people found the following review helpful
5.0 out of 5 stars Covers almost every major XML standard 7 Nov 2004
By Jack D. Herrington - Published on Amazon.com
Format:Paperback
This is a combination field guide and terse standards reference for XML. It covers an amazing variety of XML standards. From the fundamentals of XML, through the document standards, and into transformation technologies like XSLT. Standards include; XML, XPath, XLink, XSLT, XSL-FO, XML Schema, DTDs, among others. The book also cover some standards that use XML, like SAX and DOM.

The book is fairly high level. It assumes that you know the basics and need a complete reference for the technologies. This is that case with all of the Nutshell books, but given the amount of technologies this books cover, the coverage is fairly terse.

The organization of the book is great. There are only a few illustrations and they are used effectively. A solid reference for anyone who works with XML technologies on a daily basis. Highly recommended.
20 of 22 people found the following review helpful
4.0 out of 5 stars Loaded with info but needs better editing/organization 4 Mar 2005
By Aramaki - Published on Amazon.com
Format:Paperback|Amazon Verified Purchase
They might as well take out the first half of the book at trying to teach beginners XML. The reason being that the writing style is confusing, full of long run-on sentences, with few to no examples for demonstration. As a reference book, this is probably a flawless companion. And it does say that it's intended for experienced developers. The tutorial chapters serve well as reviews and tips if the person already knows some XML. Also, make sure you check the book's web site, it has a long errata list, so get ready to correct those errors. If you're a beginner to XML, this isn't the book to start out with. I recommend "Beginning XML - 3rd Edition" by Wrox Press as your first XML book.
Were these reviews helpful?   Let us know
Search Customer Reviews
Only search this product's reviews

Customer Discussions

This product's forum
Discussion Replies Latest Post
No discussions yet

Ask questions, Share opinions, Gain insight
Start a new discussion
Topic:
First post:
Prompts for sign-in
 

Search Customer Discussions
Search all Amazon discussions
   
Related forums


Listmania!


Look for similar items by category


Feedback


Amazon.co.uk Privacy Statement Amazon.co.uk Delivery Information Amazon.co.uk Returns & Exchanges