Skip to Content
Java and XML, Second Edition
book

Java and XML, Second Edition

by Brett McLaughlin
August 2001
Intermediate to advanced
528 pages
14h 35m
English
O'Reilly Media, Inc.
Content preview from Java and XML, Second Edition

DOM Level 3

Before closing the book on DOM and looking at common gotchas, I will spend a little time letting you know what’s coming in DOM Level 3, which is underway right now. In fact, I expect this specification to be finalized early in 2002, not long from the time you are probably reading this book. The items I point out here aren’t all of the changes and additions in DOM Level 3, but they are the ones that I think are of general interest to most DOM developers (that’s you now, if you were wondering). Many of these are things that DOM programmers have been requesting for several years, so now you can look forward to them as well.

The XML Declaration

The first change in the DOM that I want to point out seems pretty trivial at first glance: exposure of the XML declaration. Remember those? Here’s an example:

<?xml version="1.0" standalone="yes" encoding="UTF-8"?>

There are three important pieces of information here that are not currently available in DOM: the version, the state of the standalone attribute, and the specified encoding. Additionally, the DOM tree itself has an encoding; this may or may not match up to the XML encoding attribute. For example, the associated encoding for “UTF-8” in Java turns out to be “UTF8”, and there should be a way to distinguish between the two. All of these problems are solved in DOM Level 3 by the addition of four attributes to the Document interface. These are version (a String), standalone (a boolean), encoding (another String), and actualEncoding ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Java and XML, 3rd Edition

Java and XML, 3rd Edition

Brett McLaughlin, Justin Edelson
Java & XML Data Binding

Java & XML Data Binding

Brett McLaughlin
Java 11 Cookbook - Second Edition

Java 11 Cookbook - Second Edition

Nick Samoylov, Mohamed Sanaulla
Java EE 8 Design Patterns and Best Practices

Java EE 8 Design Patterns and Best Practices

Rhuan Rocha, Joao Carlos Purificação

Publisher Resources

ISBN: 0596001975Catalog PageErrata