Re: [xml] xsltproc does not set error code when parsinf faulty xsl



On Wed, Jan 21, 2004 at 06:50:43PM +0100, Stefan Kost wrote:
hi Daniel,

is it intensional that xsltpro not returns an error incase of invalid xslt files.
I've inserted an mistyped elements (xsl:ooutput) and run xsltpro as below:

xsltproc typo.xsl && echo $?
Parsing stylesheet typo.xsl took 6 ms
compilation error: file typo.xsl line 19 element ooutput
xsltStylePreCompute: unknown xsl:ooutput
compilation error: file typo.xsl line 19 element ooutput
xsltParseStylesheetTop: ignoring unknown ooutput element
0

xsltStylePreCompute: only increments the warning-counter

xsltParseStylesheetTop: says it is an error, but increments the warning counter

          xsltTransformError(NULL, style, cur,
                      "xsltParseStylesheetTop: ignoring unknown %s element\n",
                      cur->name);
          if (style != NULL) style->warnings++;
      }

The rational I would like to treat such warnings as errors is, that I use
xsltpro as part of my 'make test' target to see if all stylesheets I package
compile.

  Hum, in that case the element is in the XSLT namespace, it then
need to be linked to version compatibility processing, see
   http://www.w3.org/TR/xslt#stylesheet-element

it depends on the version indicated, but it's probably right that this should
be labelled as an error.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



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