I'm trying to use the <xsl:attribute-set>
in my xsl document but I keep getting error messages:
- compilation error: line 47 element attribute-set
- element attribute-set only allowed as child of stylesheet
I've also checked the W3Schools website's explanation on XSLT attribute-sets and found out that:
Must be child of <xsl:stylesheet> or <xsl:transform>.
I don't understand what this means, can anyone explain?
If you need more information about my documents, WAMP server set up please comment below.
The first two lines of my XSL document is:
<?xml version="1.0" encoding="UTF-8"?>
<html xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml">
I have no idea what they do, just that without it, my XSL will not work.
I am basically transforming my XML into HTML using this XSL file. The whole process is done by PHP:
# START XSLT
$xslt = new XSLTProcessor();
$XSL = new DOMDocument();
$XSL->load('hello.xsl');
$xslt->importStylesheet($XSL);
# LOAD XML FILE
$XML = new DOMDocument();
$XML->load('hello.xml');
#PRINT
print $xslt->transformToXML($XML);