O'Reilly logo

The Book of JavaScript, 2nd Edition by thau!

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Processing XML

XML is so popular that web browsers have built-in mechanisms for dealing with XML documents. In fact, all of the methods used to process the DOM (discussed in Chapter 13) can also be used to process XML documents.

The script in Figure 15-6 shows how to use some of the methods that we used to process the DOM to create an application that looks up a word in three dictionary files (German, Portuguese, and Italian), which I downloaded from the Internet Dictionary Project (http://www.ilovelanguages.com/IDP).

Reading an XML document

Figure 15-6. Reading an XML document

As you can see in Figure 15-7, entering aardvark into the text box and clicking the Translate! ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required