in reply to Re^2: XML::XSLT problem
in thread XML::XSLT problem

Ok, now the only thing remained to be done is to have a look at your actual blog.xsl and posts.xml files. A useful way to tackle these kinds of problems is if you try to find the minimal working and non-working examples, which then can be posted here. My guess is that either your XSL or XML is invalid, since the problem seems to rise right at the first line. You might not have the usual <xsl:stylesheet version="1.0" blablabla at the first line? Try to find some very basic XML and XSL files that do not work and try to find, what makes your specific version to fail.

I myself have often found the solution for various problems just to try to create a basic test case, which can be posted to PerlMonks...

Replies are listed 'Best First'.
Re^4: XML::XSLT problem
by bosshoff (Novice) on Apr 24, 2005 at 18:27 UTC
    I will prepare these test cases, but I've alread mentioned that these files work flawlessly with Xalan, which is a C-based validating XSLT processor. I assume that XML::XSLT is keeping with the same standard. Also, if it were simply a problem with the xsl/xml, wouldn't you think there would be a more descriptive error, such as: "element illegal" or "element {some element} not found" as opposed to a generic "element not found," as if there was no input at all?

    If anyone else has had success with XML::XSLT, please post your code; I'm certain I am just doing something wrong when calling it, but I don't know what. Thanks.

    Oh, and here are the links for my current .xsl and .xml files:
      For me it appears that XML::XSLT croaks when it tries to open an external XML file. Line 62 of blog.xsl confirms it:
      <xsl:for-each select="document('menu.xml')/menu/item">
      Have you provided the file menu.xml for the XSLT processor? I guess you have not...:-)

      What really makes me wonder here is that XML::LibXSLT gives fairly sane output, even without the menu.xml file. Now this is really strange! Though, I admit that I am not really an expert of XSLT....

      Update: after setting the debug_callback for XML::LibXSLT it seems that the parser just silently ignores the missing file here (only noing that the for-each did not produce a node list). XML::XSLT appears to be much more picky here...

        So, once again I am proven wrong, and I am actually happy! I totally forgot that I included a template to import another xml document. I now have two concerns:

        1) Why was there not a more descriptive error; I didn't even see anything indicative of an error during import when I turned the debug switch on.

        2) How do I include multiple sources into the transformation process? If I am unable to do that, things are going to get very complicated, so much so that I'm going to have to seriously rethink going back to good 'ol perl interposed with html.

        Thanks for all the help rg0now, I probably would've thrown in the towel without your analysis.