RE: [xslt] stylesheet.errors



> > In the meantime, I looked at xsltproc.c and found out
> > that it checked the errors field in addition to checking
> > that xsltParseStylesheetDoc did not return null 
> > (around line 770), so I supposed I needed access to
> > that field to detect compilation errors.
>
> Well, no, that should not be necessary

Well, well, I'm sorry to insist, 
but I've here a small test case...

test.py:

import libxml2, libxslt
ctxt = libxml2.createFileParserCtxt("bad.xslt")
ctxt.parseDocument()
stylesheet = libxslt.parseStylesheetDoc(ctxt.doc())
#print "===>",stylesheet.errors()
assert stylesheet is None

bad.xslt:

<?xml version="1.0"?>
<xsl:transform
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
  version="1.0">
<xsl:template match="x("/>
</xsl:transform>

-sbi



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]