Ian's books | CPU Magazine

XSLT Part 9: XSLT and Namespaces

As described in the September 2003 issue of CPU - Computer Power User magazine.

Examples and Bonus Materials

A) Downloadable ZIP File

B) The Raw Data

C) The XSLT Stylesheets

D) Martin Honnen's Mozilla/Netscape Serialization Viewer

The file show-serialization.txt contains a single-line JavaScript listing that opens a second browser window and pastes into that window a serialized listing of the results produced by the XSLT transform (basically it produces a listing of the underlying markup behind whatever is displayed in the browser window). This is invoked from a browser bookmark. To add this functionality to your browser, simply do the following. Starting from the browser window:

  1. Select Bookmarks --> Manage Bookmarks
  2. From the Bookmark manager, select File --> New --> Bookmark. This produces a "File Bookmark" tool.
  3. Enter a useful name for the bookmark (e.g. "Show Serialized Results") into the Name field
  4. Enter the JavaScript function into the Location window - go to show-serialization.txt, select and copy the text, return to the "File Bookmark" tool, and paste the string into the Location field.
  5. Select OK. The bookmark is now added to the bottom of the bookmark list.

To use this bookmark, simply load the desired XML data file into the browser. Then select the "Show Serialized Results" bookmark. The browser will pop open another window (pushed behind the main window), and will display the results inside it.

Tutorials, Books, References, and Tools