The Advantages of Using Separate Files

As I've mentioned many times throughout this book, separating functionality into different files is an efficient way to allow for code reuse. The example in this hour demonstrates four possibilities. First, if you want to apply the XSL template to a different XML file of the same structure, the only change is to the method in the HTML file that loads the XML file. Second, the HTML file is extremely generic and will work with any project containing an XSL and XML file, where only one data target is needed. Third, when more or less of the data is to be read from the XML file, it's only necessary to make changes to the XSL file. Finally, if additional data is to be added to the XML file, no changes need to ...

Get Sams Teach Yourself XML in 24 Hours now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.