Re: [xslt] xsltproc return code under some conditions

On Sat, Jul 31, 2004 at 02:56:04PM +0900, Mike Hommey wrote:
> Hi,
> I'm trying to deal with a bug reported to Debian quite some time ago[1],
> and I'm not quite sure if there is actually a bug or not.
> To summarize, the problem reported is that if the xml file parsed by
> xsltproc contains entity references that can't be resolved (the bug
> submitter gives the exemple using the --nonet option), he gets a parse
> error, but the status code from xsltproc is still 0 (he's expecting 6).
> In fact, I'd say that the entity parsing error is not fatal and doesn't
> prevent xsltproc to process the stylesheet with the provided xml file,
> thus xsltproc returning 0, but on the other hand, the result might not
> exactly what is expected.

  Well the XPath data model asks to substitute entities references before
processing the resource. But is you ask for --nonet, implicitely you ask
to override that rule somewhat. Hard to tell how it should be handled
from a conformance POV, it's not a well-formedness error, and XSLT doesn't
care about validity errors. Since XML-1.0 doesn't define any other kind
of conformance level it's a grey area IMHO.

> I guess one of the spec document says something about such cases and
> what the parser/processor should do, so that we could say if yes or no
> there is a bug, but I can't put an hand on such an information.
> Could some member of the list confirm or contradict my opinion that this
> is not a bug ?

  I don't think it's a bug. Using --nonet is to some extend a violation of
the XPath data model asking for entities substitution. We are outside of the
boundaries defined by the specs.


Daniel Veillard      | Red Hat Desktop team
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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