Real World XML (2nd Edition)

In Chapter 7, "Handling XML Documents with JavaScript," and Chapter 8, "XML and Data Binding," we saw how to work with XML and JavaScript in Internet Explorer. However, JavaScript is a relatively lightweight language, and most serious XML programming does not take place in browsers such as Internet Explorer. Today, the most common way of handling XML in code is to use Java. Working with XML by using Java has become a central XML topic, and no XML book can ignore this connection. This book is designed to assume no more knowledge than HTML, so this chapter provides a painless introduction to Java. Java itself is a huge topic, but the Java we'll use in the coming chapters is limited; it turns out that we can get all the Java knowledge we need in this chapter. If you already know Java, feel free to skip this chapter.

Java should not be confused with JavaScript; despite their names and similar syntax, the two are not truly related . Java is a creation of Sun Microsystems, and JavaScript is a Netscape creation. Java is far deeper and far more extensive than JavaScript.

On the other hand, now that we've used JavaScript, we've got a good leg up on Java because much of their basic syntax is similar (because both are based on the C++ model, not because JavaScript and Java are directly related). In the next two chapters, we'll see how to work with XML package using Java.

In this chapter, we'll come up to speed with Java, building on what we already know of JavaScript. We'll get the skills we need for the next two chapters in this chapter, including creating Java classes and windowed applications.

In general, creating serious applications with Java is more involved than working with JavaScript because Java is so much more extensive. As you can imagine, there's way more Java than we can cover in one chapterif you want to learn more, pick up a good book on the subject. On the other hand, this chapter introduces all the Java coding skills we'll use in the next two chapters. If you're already comfortable with Java, feel free to skip on to the next chapter, where I work with the XML DOM in Java, not JavaScript, as we did in Chapter 7.

Категории