Re: [xsl] XSLT 3.0 processor accepting non well-formed XML inputs

Subject: Re: [xsl] XSLT 3.0 processor accepting non well-formed XML inputs
From: "Michael Kay mike@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 1 Mar 2019 11:43:52 -0000
Ethics to me is about building systems that don't harm people. It's not about
conforming to rules and regulations.

In practice it is often useful to be able to extract information from the
start of an XML document (e.g. an attribute of the root element) without
reading gigabytes of data that follow. Most XML parsers therefore provide an
option for the application to terminate parsing as soon as they have obtained
the information they need. We can debate whether a conformant XML parser is
permitted to provide such an option; in practice it really doesn't matter:
parsers will provide such an option because it is needed.

This rule in the XSLT spec for streaming is just warning you that if your
stylesheet does something like

<xsl:source-document href="big.xml">
  <xsl:sequence select="string(/*/@version)"/>
</xsl:source-document>

then it may succeed even though big.xml contains errors after the first start
tag. Is it "ethical" to provide such an option? Absolutely. In some cases,
extracting the data in microseconds rather than seconds might save lives.

It's the responsibility of the application designer to decide the right
trade-offs between performance, security, reliability, and other system
qualities.

Michael Kay
Saxonica

> On 1 Mar 2019, at 11:23, Mukul Gandhi gandhi.mukul@xxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> Hi all,
>    I've got some chance to try XSLT 3.0's streaming features, and have found
them useful. I've a slight question as below,
>
> The XSLT 3.0 spec, in the section "2.12 Streamed Validation" says
following,
>
> <quote>
> A streamed transformation that only accesses part of the input document (for
example, a header at the start of a document) is not required to continue
reading once the data it needs has been read. This means that XML
well-formedness or validity errors occurring in the unread part of the input
stream may go undetected.
> </quote>
>
> As per above quoted text, is it ethical for an XSLT (3.0) processor to
provide a functionality that's based on a non well-formed input XML document?
>
>
>
>
> --
> Regards,
> Mukul Gandhi
>
> alt email : mukulgandhi@xxxxxxx
>
> XSL-List info and archive
> EasyUnsubscribe (by email)

Current Thread