I have a XML file and an external XSLT file.
Currently, within my XML I refer to an external XSLT link using an href:
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="stylesheet.xsl" ?>
<mytag>
<t1> </t1>
<t2> </t2>
<t3> <t3>
<mytag>
How can I use inline XSLT instead? Is this possible? If yes, how?
Yes, it is possible to embed the XSLT inside of your XML.
XSLT is an XML file, so you would just need to make sure that you put it inside of the document element of your XML file, so that the XML file is still well-formed.
In fact, it is described in the XSLT specification:
Depending on how you plan to leverage it, embedded stylesheets may not be supported. For instance, in IE 6/7/8. There are some workarounds.
For testing across client-side processors, use a self-referencing stylesheet: