Paul Clapham wrote:Do you have an HTML file which is going to be transformed by that XSLT? If so, yes, it has to be well-formed XML, but that isn't the usual process. Usually people just start with XML which doesn't have to be HTML in any way, and transform that into HTML.
Yes, exactly. I have a nice HTML/CSS template and I need XSLT to insert some text from an XML file into it. I did the following to remedy the problem:
1. Used tidyhtml to clean up the file, available at
http://tidy.sourceforge.net/ but I downloaded it via macports.
2. Removed the remaining errors until it validated here:
http://validator.w3.org/check
3. Got rid of the following line:
which caused a
Transformation failed: org.xml.sax.SAXException: Scanner State 24 not Recognized error and drove me nuts.
Of course the HTML file was changed to .xsl and appropriate headers were added.
...and it worked!
Now I need to learn more XSLT and figure out how to use conditional statements, but I'm one step ahead.
Thanks again.