Link the XSL Style Sheet to the XML Document

Build 1501 on 14/Nov/2017  This topic last edited on: 21/Feb/2014, at 09:13

Add the XSL style sheet reference to your XML document ("cdcatalog.xml"):

<?xml version="1.0" encoding="ISO-8859-1"?>

<?xml-stylesheet type="text/xsl" href="cdcatalog.xsl"?>

<catalog>

  <cd>

    <title>Empire Burlesque</title>

    <artist>Bob Dylan</artist>

    <country>USA</country>

    <company>Columbia</company>

    <price>10.90</price>

    <year>1985</year>

  </cd>

.

.

</catalog>

If you have an XSLT compliant browser it will nicely transform your XML into XHTML.

xslt1

The details of the example above will be explained in the next chapters.

Click to toggle expandCdCatalog.xml with XSL linked