There are two way to link an XSLT style sheet to an XML source document:
<?xml-stylesheet type="text/xsl" href="myxsl.xsl"?>
processing instruction.transformNode
method to apply the transformation.From a performance standpoint, it does not matter whether you link using a style sheet processing instruction or using the DOM. The difference between these two methods focuses on the underlying data, as outlined in the following table.
Link Using... | If... |
---|---|
A style sheet processing instruction |
|
The DOM |
|
Note For ease in learning XSLT, many of the samples in this section use a style sheet processing instruction to link to the XSLT file. These samples would work just as well if you linked them using the DOM instead.
Linking Using a Processing Instruction | Linking Using the DOM | Displaying Transformation Results | The XSLT Processor