Currently I use:
<?xml-stylesheet type="text/xsl" href="XSL.xsl"?>
To link XSL to XML.
If my xml was here: www.externaldomain.com/rss.xml (Outside of my domain) how can i get the XSL linked to the XML?
Can i point the XSL to a File or Link?
You can create a local XML file that includes the XML content of the remote XML file through an entity reference.
The example below will give you the content of the remote XML file inside of a wrapper document element.
Then you can include a stylesheet processing instruction on your local XML file.
However, since the local file has a wrapper document element, you might need to point to a "wrapper XSLT" that uses xsl:import to import the original XSL.xsl and apply-templates starting with the content inside the wrapper element.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE wrapper [
<!ENTITY content SYSTEM "http://stackoverflow.com/feeds">
]>
<?xml-stylesheet type="text/xsl" href="XSL.xsl" ?>
<wrapper>
&content;
</wrapper>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With