PDA

View Full Version : import XSL from within XSL


ellisd5
12-08-2004, 03:27 PM
Im having big troubles getting this working. I have looked at quite a few examples on the web and can't make out why this isn't working

This is the file im importing
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xforms="http://localhost/xsl/xforms">

<xsl:template match="CHECKLIST">

<B>Template Loaded</B>

</xsl:template>
</xsl:stylesheet>

and this this is what calls it

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xforms="http://localhost/xsl/xforms">

<xsl:include href="completePlanningCheckList.xsl" />

<xsl:template match="/">

Template should be below:<BR/>
<xsl:apply-templates select="CHECKLIST"/>

</xsl:template>
</xsl:stylesheet>

What is wrong with this?
TIA
Dale

mpjbrennan
12-12-2004, 09:30 AM
1. Instead of <xsl:apply-templates select="CHECKLIST"/> run it with <xsl:apply-templates select="*"/>, or give the full path to the element in the select statement - you can't just use the element name.
2. Strictly speaking you should have <html><body>.....</body></html> surrounding your root template - you may not need this if you are using IE.
3. Also strictly speaking you should give your xsl files a .xml extension - there is no xsl mimetype but IE treats the .xsl suffix as though it were correct.

patrick