RE: [xslt] Non-existent variable => error?



> Eh? May the Lord strike me down if I understod what you mean :-) I thought
> the documentation pretty clear. If an error occurs during its execution,
the
> function will return NULL.

Grumpy today Igor?  Running this stylesheet returns output (see his original
message).  

> > and the handler set by xsltSetGenericErrorFunc
> > (unfortunately a global....) is the only way to know
> > if an error actually occurred?

> No, precisely the fact that the function returned NULL is telling you that
> an error has occured.

It did not return NULL, it returned the result document up to the point of
the error occurring, i.e.

C:\>xsltproc --verbose test.xsl test.xml
Added namespace: xsl mapped to http://www.w3.org/1999/XSL/Transform
xsltPrecomputeStylesheet: removing ignorable blank node
xsltParseStylesheetProcess : found stylesheet
xsltCompilePattern : parsing '/'
xsltCompilePattern : parsed /, default priority 0.500000
added pattern : '/' priority 0.500000
parsed 1 templates
Resolving attribute sets references
Initializing keys on test.xml
Registered 0 modules
Registering global variables
Registering global variables from test.xsl
xsltProcessOneNode: applying template '/' for /
xsltApplyOneTemplate: copy text
foo
xsltCopyText: copy text
foo
xsltApplyOneTemplate: copy node B
Lookup variable foo
global variable not found foo
runtime error: file test.xsl line 5 element B
unregistered variable foo
xmlXPathCompiledEval: evaluation failed
xsltEvalXPathString: returns (null)
<?xml version="1.0"?>

foo<B span=""/>

C:\>




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