Ian's books | CPU Magazine | Ian's CPU Articles -->

XSLT Part 10: XSLT Output and Namespace Control

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

Examples and Bonus Materials

A) Downloadable ZIP File

B) The Examples

  1. Simple XML Output
    Data: data.xml (Plain text: data.txt)
    XSLT: transform.xsl (Plain text: transform.txt)
    Note that data.xml contains a processing instruction referencing the external stylesheet transform.xsl. Mozilla and/or Netscape 7 load this stylesheet and displays the results of the transformation.
  2. Reducing Unneeded Namespace Declaration
    Data: data-1.xml (Plain text: data-1.txt)
    XSLT: transform-1.xsl (Plain text: transform-1.txt)
    Note that data-1.xml contains a processing instruction referencing the external stylesheet transform-1.xsl. Mozilla and/or Netscape 7 load this stylesheet and displays the results of the transformation.
  3. Setting an XSLT Document Default Namespace
    Data: data-2.xml (Plain text: data-2.txt)
    XSLT: transform-2.xsl (Plain text: transform-2.txt)
    Note that data-2.xml contains a processing instruction referencing the external stylesheet transform-2.xsl. Mozilla and/or Netscape 7 load this stylesheet and displays the results of the transformation.
  4. Multiple Namespaces in the XSLT Listing
    Data: data-3.xml (Plain text: data-3.txt)
    XSLT: transform-3.xsl (Plain text: transform-3.txt)
    Note that data-3.xml contains a processing instruction referencing the external stylesheet transform-3.xsl. Mozilla and/or Netscape 7 load this stylesheet and displays the results of the transformation.
  5. Multiple Namespaces in the Source Data
    Data: data-4.xml (Plain text: data-4.txt)
    XSLT: transform-4.xsl (Plain text: transform-4.txt)
    Note that data-4.xml contains a processing instruction referencing the external stylesheet transform-4.xsl. Mozilla and/or Netscape 7 load this stylesheet and displays the results of the transformation.
  6. Aliasing Namespaces: XSLT creating XSLT
    Data: data-5.xml (Plain text: data-5.txt)
    XSLT: transform-5.xsl (Plain text: transform-5.txt)
    Note that data-5.xml contains a processing instruction referencing the external stylesheet transform-5.xsl. Mozilla and/or Netscape 7 load this stylesheet and displays the results of the transformation.

C) Martin Honnen's Mozilla/Netscape Serialization Viewer

See last month's article: http://www.iangraham.org/writing/cpu-articles/sep03/index.html

D) Other XSLT Engines

Tutorials, Books, References, and Tools