O'Reilly logo

XML and Java™ from scratch by Nicholas Chase

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

Looping and Sorting

Until now, we've mostly gone along with the order of the XML document, although that might be difficult to see because we've been so selective about what we've output.

At this point, we're going to take a little more control over how things are done. Using the templates all by themselves, we can output the vendor_name only once (without jumping through some rather intricate hoops), but we want to have a list of vendor names at the top of the page with links to that vendor's offerings.

To do this, we need to keep in mind two things: how the document is actually processed and where we are in the source tree at all times.

We need to remember that the processor will do absolutely nothing until we tell it to start processing the ...

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