<?xml version="1.0" encoding="utf-8"?><article xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0-subset Balisage-1.5">
    <title>The XSLT/XPath/XQuery 4.0 Standards: a High-Level Perspective</title>
    <info>
    <confgroup>
      <conftitle>Balisage: The Markup Conference 2026</conftitle>
      <confdates>August 3-7, 2026</confdates>
   </confgroup>
        <abstract>
            <para>A W3C Community Group is in the process of developing proposals
            for 4.0 versions of XSLT, XPath, and XQuery (collectively, QT4). 
            This paper describes the original
            objectives of this project and the extent to which they have been achieved.
            It does this within the framework of some general observations about standards
            and the factors that make standards successful and unsuccessful.</para>
        </abstract>

        <author>
            <personname>
                <firstname>Michael</firstname>
                <surname>Kay</surname>
            </personname>
            <personblurb>
                <para>Michael Kay is the founder and Director of Innovation at Saxonica.
                    He was the original developer of the Saxon XSLT and XQuery processor,
                    and was the editor of the XSLT 2.0 and 3.0 specifications. He
                    was instrumental in establishing a W3C community group to create
                    4.0 versions of the XSLT, XQuery, and XPath languages. Since 2004 Saxonica
                    has been a leading participant in both the development of the language
                    specifications and in delivering high quality implementations of the standards.
                    Michael is based in Reading, UK.</para>
            </personblurb>
            <affiliation>
                <jobtitle>Founder and Director of Innovation</jobtitle>
                <orgname>Saxonica</orgname>
            </affiliation>
            <email>mike@saxonica.com</email>
        </author>
<legalnotice><para>Copyright Michael Kay</para></legalnotice>
    </info>

    <section>
        <title>About this Paper</title>
        <para>The sheer number of new features added to the 4.0 specifications<footnote><para>https://qt4cg.org/</para></footnote> makes it very
            difficult to provide a concise summary of what's new. Even in the release 
notes<footnote><para>https://www.saxonica.com/products/latest.xml#saxon13</para></footnote>
            for Saxon 13, which implements many of the new features, we resorted to
            the headline summary "More than 175 features from the draft 4.0 specifications
            are now available...." There are various ways of tracking the detailed changes:
            the specification itself contains a "changes" summary below the section heading
            of any section that contains substantive changes, and these link to the GitHub
            Pull Requests<footnote><para>https://github.com/qt4cg/qtspecs/pulls</para></footnote> that contain the detailed text of each change. Test cases in the
            extensive test suite<footnote><para>https://github.com/qt4cg/qt4tests</para></footnote><footnote><para>https://github.com/qt4cg/xslt40-test</para></footnote> (also available on GitHub) are also linked to pull requests,
            and pull requests that have been implemented in a released Saxon version include
            a GitHub label "In Saxon 12" or "In Saxon 13".</para>
        
        <para>As a taster, I published a list of <emphasis>101 Fun things to
            do with QT4</emphasis><footnote><para>https://blog.saxonica.com/mike/2026/05/101-things-in-QT4.html</para></footnote>: none of them
        described in any detail, but a list intended for easy reading where, if particular features
        whet your appetite, you can go to the specs and investigate further.</para>
        
        <para>So I won't make any attempt in this paper to provide a comprehensive list
            of new features. Instead, I will take a step back, and try to discern
            some overall themes.</para>
        
        <para>What is the status of the work? It's six years since I first proposed
            the QT4 initiative [<xref linkend="Kay2020"/>], and four years since the QT4 community group started
            work to flesh out a definition of the 4.0 versions of XSLT, XPath, and XQuery.
        The work is ongoing and subject to revision and change as the work proceeds.
        </para>
        
        <para>At a process level, there is still some work to do to decide under what auspices
        the work should be published. W3C no longer has a formal XML Activity, and there are
        no official working groups chartered to take the XML standards forward. QT4 is not
        alone in making technical progress through the informal mechanism of W3C Community Groups<footnote><para>https://www.w3.org/groups/cg/</para></footnote>,
        but these do not have the authority to publish official Recommendations.
        As the work nears completion, we can expect to see the politics get resolved,
        but meanwhile the work is presented to the world to accept or reject based
        on its technical merits.</para>
        
        <para>Process is important, but the significant parts of the process to date have
        been those that facilitated the technical collaboration to produce a high quality
        specification, rather than the process for getting an official stamp of approval
        on the final publication (including a formal consultation process). Because process 
        is important, I'll share my thoughts on the subject.</para>       
        
    </section>

    
    <section>
        <title>The current state of the QT4 standards</title>
        <para>We can divide this into three parts.</para>
        <itemizedlist>
            <listitem>
                <para>What new features are there in the spec that appear to be stable and complete and require no further work?</para>
            </listitem>
            <listitem>               
                <para>What features in the spec are known to be incomplete and should be considered work in progress?</para>
            </listitem>
            <listitem>
                <para>What requirements remain to be addressed?</para>
            </listitem>
        </itemizedlist>
        <para>I'll consider these three questions in the following subsections of the paper.</para>
        <section>
            <title>Completed work</title>
            <para>It's never over till the fat lady sings, as they say, so we can never say definitively that a feature already added to the spec
            is finished and stable and won't change before final publication. But there are some things we can be 95% confident about. Or at any
            rate, we can be confident that any further changes in these areas will be fairly superficial.</para>
            
            <para>In this category I would include the following:</para>
            
            <itemizedlist>
                <listitem>
                    <para>Most of the 92 new functions added to the core function library<footnote><para>https://qt4cg.org/specifications/xpath-functions-40/Overview.html</para>
</footnote>, and the 154 extensions to
                    the behavior of existing functions.</para>
                    <para>Many of the new functions are very simple, but hopefully also very practical.</para>
                    <para>Some are pure convenience
                    functions, like <code>fn:characters</code> which splits a string into single characters, or <code>fn:is-NaN</code>
                    which tests whether a value is the special floating-point value <code>NaN</code>, or <code>fn:foot</code> 
                    which returns the last item in a sequence.</para> 
                    <para>Many of the new functions are higher-order, producing effects
                    that would otherwise have required custom syntax: some of my favorites are <code>fn:highest</code> and <code>fn:lowest</code>
                    which return the items in a sequence that have the highest or lowest values for some computed property; <code>fn:take-while</code>
                    which returns all the items in a sequence up until the first that satisfies some condition; and 
                    <code>fn:all-equal</code> and <code>fn:all-different</code> which test respectively whether all items in a sequence
                    are equal, or whether they are all distinct. Also <code>fn:transitive-closure</code> which does what the name suggests.</para>
                    <para>Other new functions incorporate powerful new capabilities to process external data formats. In this category we have <code>fn:parse-html</code>
                    and <code>fn:parse-csv</code> to process HTML5 and CSV input data respectively, and <code>fn:invisible-xml</code> to process
                    arbitrary input conforming to a user-supplied grammar. Another big one is <code>fn:element-to-map</code> which does
                        XML-to-JSON conversion according to the design outlined in [<xref linkend="Kay2023"/>].
                        More modestly, <code>fn:parse-uri</code> splits a URI into its parts,
                    and <code>fn:build-uri</code> puts them back together again.</para>
                    <para>Many existing functions have acquired new options. <code>fn:deep-equal</code>, for example, has options to control
                    exactly how comparisons are performed, such as whether whitespace and namespace prefixes
                    are to be considered significant. The <code>fn:doc</code> and <code>fn:document</code> function have options to enable
                    DTD and XSD validation and XInclude processing. The <code>fn:round</code> function has options to control rounding mode.</para>
                </listitem>
                <listitem>
                    
                <para>One of the benefits of higher-order functions is that many powerful capabilities can be added to the language
                    without new syntax. But I think some of the XPath syntax 
extensions<footnote><para>https://qt4cg.org/specifications/xquery-40/xpath-40.html</para></footnote> will also prove popular. How did we
                    ever manage without the <code>otherwise</code>
                    operator? - the expression <code>@discount otherwise 0</code> 
                    return the value of <code>@discount</code> if the attribute exists, or zero otherwise. Extensions to <code>for</code>
                    expressions in XPath (or the <code>for</code> clause of FLWOR expressions in XQuery) to process maps and arrays
                    will probably find ready acceptance. And I think the abbreviated syntax for simple inline functions will also
                    have a big impact: writing a callback as <code>fn{@name}</code> rather than <code>function($e as element(*)) { $e/@name }</code>
                    doesn't just save keystrokes, it makes a substantive difference to the aesthetics and therefore the usability of higher order functions.</para>
                </listitem>
                <listitem>
                   
                <para>On the XSLT front<footnote><para>https://qt4cg.org/specifications/xslt-40/Overview.html</para></footnote>, there are also a few simple features that look finished and stable. The <code>xsl:if</code> instruction
                    now has <code>then</code> and <code>else</code> attributes, while <code>xsl:when</code> and <code>xsl:otherwise</code>
                    have a <code>select</code> attribute, and there is a new <code>xsl:switch</code> instruction for a multiway conditional.
                    The ability to write all the template rules for a mode as children of the <code>xsl:mode</code> element provides
                    a way to make code more readable and therefore easier to debug.</para>
                </listitem>
                <listitem>
                  
                <para>Generally we have tried to do as much as possible without significant changes to the data 
model<footnote><para>https://qt4cg.org/specifications/xpath-datamodel-40/Overview.html</para></footnote> or type system,
                    because such changes are always more disruptive. But a few changes in that area stand out as being particularly
                    successful:</para>
                    <itemizedlist>
                        <listitem><para>Choice types, for example, <code>(xs:date | xs:time | xs:dateTime)</code>, or
                        <code>(element(E) | document(element(E)))</code>.</para></listitem>
                        <listitem><para>Enumeration types, for example, <code>enum("red", "green", "blue")</code>.</para></listitem>
                        <listitem><para>Changes to the function conversion rules, now renamed coercion rules, which allow downcasting:
                        you can specify the required type of a function parameter as, say <code>xs:positiveInteger</code>, and the
                        caller can supply the value <code>42</code> without explicitly casting it to that type: the cast will
                            happen automatically. This makes the use of derived types such as <code>xs:positiveInteger</code> much
                        more attractive.</para></listitem>
                        <listitem>
                            <para>Maps now retain order. The immediate benefit is that when you perform a transformation
                            on JSON input, and serialize the result, the output is now readable rather than being garbled.</para>
                        </listitem>
                        
                    </itemizedlist>
                </listitem>
            </itemizedlist>
    
        </section>
        <section>
            <title>Work in Progress</title>
            
            <para>There are a number of areas in the specifications where a great deal of progress has been made, but a number
            of issues remain open. These tend to be related and intertwined, so progress in one area can involve changes
            in another.</para>
            
            <para>At Balisage 2025 I reported on the introduction of JNodes [<xref linkend="Kay2025"/>], and most of the ideas presented in that paper
            found their way into the draft specification, and have proved robust. But:</para>
            
            <itemizedlist>
                <listitem>
                    <para>There are some loose ends regarding the handling of arrays whose members are XDM sequences rather than
                    single items; and similarly, maps whose entries are general XDM sequences. These constructs never arise from parsing JSON,
                    but they can arise in the general case of a constructed tree, and we need to work out the detail of what to do with them.</para>
                </listitem>
                <listitem>
                    <para>The proposed syntax <code>$a/get("date of birth")</code> (also available with other axes, for example, 
                        as <code>$a/descendant::get("date of birth")</code>) met with some resistance. The current proposal, which
                        still needs a little work to finalize, is to substitute the syntax <code>$a/"date of birth"</code> or
                        <code>$a/descendant::{"date of birth")</code>. In both cases, in principle, the string literal
                        <code>"date of birth"</code> can be replaced with an expression, but this potentially leads to
                    conflicts with the semantics of expressions such as <code>$a/name()</code> or <code>$a/jvalue()</code>.</para>
                </listitem>
                <listitem>
                    <para>While the use of JNodes in path expressions for selection within JSON-derived trees is now quite well
                    defined, there are still open questions<footnote><para>https://github.com/qt4cg/qtspecs/issues</para></footnote> 
                        about transformation of such trees using the XSLT recursive-descent
                    processing model with template rules. What should the syntax be for match patterns that match JNodes? What should
                    their default priority be? What should the built-in template rules do when there is no explicit match? These
                    areas are all still being explored.</para>
                </listitem>
            </itemizedlist>
            
            <para>Record types were introduced in the very first proposal for 4.0: the idea is that the type <code>record(partNr as xs:string, price as xs:decimal)</code>
            should be descriptive of a map containing two entries, an entry with key <code>"partNr"</code> whose value is a string, and an entry with key <code>"price"</code>
            whose value is a decimal number. This correlates well with a common way that maps are used, and many of the new functions and operators have found
            record types convenient to use in defining their argument types and result types. But as with JNodes, record types have been subject to some changes
            as the spec has progressed, and we're probably not done yet. Some of the areas of change have been:</para>
            
            <itemizedlist>
                <listitem>
                    <para>We have abandoned the flag that defined a record type as being extensible (allowing it to contain fields other than those listed). This
                    went against the aim of strict typing for record types, allowing an expression such as <code>$product?part-nr</code> (with a misspelled
                    field name) to be flagged as a static error.</para>
                </listitem>
                <listitem>
                    <para>We've also dropped the ability to define some of the fields as being optional. We found there was too much scope for confusion in that
                    absent data could be represented either by a field that was absent, or by a field that was present but empty. In the current design, absent
                    data in a record is always indicated by a field whose value is an empty sequence.</para>
                </listitem>
                <listitem>
                    <para>As originally defined, a record type was simply a predicate applied to a map. We have now introduced the idea that a map should have
                    a type annotation identifying it explicitly as an instance of a specific map type. But I don't think we have yet worked through all the
                    implications of this change, for example, the precise rules as to whether two record types are "the same type".</para>
                </listitem>
                <listitem>
                    <para>As a replacement for the ability to define record types as extensible, there's a suggestion that we might define one record
                        type to be an extension of another.</para>
                </listitem>
                <listitem>
                    <para>We have syntax in both XQuery and XSLT to declare named record types. One of the advantages of making them named is that record types
                    can become recursive: for example, a LISP enthusiast might define the record type <code>my:list</code> as 
                        <code>record(car as item()*, cdr as my:list?)</code>: a two-entry map containing an arbitrary data value called <code>cdr</code>, and
                    an optional [pointer to a] <code>my:list</code> called <code>cdr</code>. I don't think we've yet tested the implementability and usability
                    of recursive record types in anger, and there might be changes once we do.</para>
                </listitem>
                <listitem>
                    <para>We've defined that named record types should have an associated constructor function to create instances of the named record type.
                    But we've also found use cases where no constructor function is wanted (in particular, where the record type is designed explicitly to
                    be the result type of a function such as <code>fn:parse-uri</code>) and we've also found cases where a customized constructor function
                    (or set of constructor functions) is preferred over one that is system-generated.</para>
                </listitem>             
            </itemizedlist>
            
            <para>Records have proved their worth and will no doubt feature in the final spec, but there are still rough edges to be smoothed out.</para>
            
        </section>
        <section>
            <title>Outstanding requirements</title>
            
            <para>As well as features that appear to be done and dusted, and other features that are done but still need some dusting, we have
            a wish-list of bright ideas<footnote><para>https://github.com/qt4cg/qtspecs/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22Nice%20to%20have%22</para></footnote> that someone would like included in the spec. In some cases there is consensus that these features 
            would be nice to have; in other cases their value is disputed. What characterizes them all, however, is that the spec could be published
            without them: they are not essential to declaring victory.</para>
            
            <para>Some of these ideas come from within the Community Group, some come from outside. Some of them are well formulated proposals, others
            are sketchy ideas. The problem is, they are opened faster than we can close them.</para>
            
            <para>Every working group hits the problem that at some stage it wants to declare itself finished, but it still has this pool of good ideas
            for making the spec better. Essentially there's a social process within the working group when the consensus starts to form that we're in the
            end game and must politely decline to do any further work. Of course, there's still a tendency to accept ideas if someone steps up and does
            all the detailed work to define the precise syntax and semantics and to write test cases. But even then, working groups eventually lose 
            patience and declare that the proposal is out of time.</para>
            
            <para>But until then, there are still some intriguing ideas on the table. There's a big proposal on 
generators<footnote><para>https://github.com/qt4cg/qtspecs/pull/2247</para></footnote>: functions whose repeated
            application produces an infinite sequence. Dimitre Novatchev is planning to present that proposal at this conference.
            Other proposals are more limited in scope: a proposal to allow comment lines in CSV files, for example, or to
            add named capture groups in regular expressions, or to add a function that converts maps to element nodes, or to do "deep update"
            of a tree derived from JSON processing. The Community Group will only be able to declare itself finished when it has made
            a decision (one way or the other) on all these good ideas.</para>
        </section>
            
    </section>
    <section>
        <title>Standardization in the XML community</title>
        <para>The XML community's attitude to standards is driven by the nature 
            of XML itself. As a standard for transmission of data between heterogenous 
            systems, and even more so as a standard for long-term storage of information 
            of lasting value, XML instrinsically needs to be very rigorously standardised, 
            and moreover, changes to the standard over time are generally unwelcome, 
            as proven by the failure of the 1.1 version: the cost to the community of 
            adopting a change exceeds the benefit. The same observations can be made 
            for JSON, and it is notable that for both XML and JSON, only very small 
            changes have been attempted once they had become established in widespread use.
            Even fixing widely-acknowledged bugs (such as the fact that JSON allows unpaired
            Unicode surrogates, or the fact that XML fails to say exactly what constitutes
            a valid namespace URI) has proved remarkably difficult.
        </para>
        <para>This community attitude to standardisation naturally extends to closely 
            associated standards such as XML Schema. The need for standards in areas 
            such as transformation and query languages is perhaps not as strong; 
            there is no intrinsic reason why multiple programming languages and 
            APIs (and successive versions thereof), should not thrive just as happens 
            in the field of general-purpose programming languages. What's different 
            here is the architecture of the web: if stylesheets are to be executed 
            in the browser, then the stylesheet language needs to be supported by 
            every browser, and until recently, the browser environment has been a 
            barrier to innovation because the platform is tightly controlled by a 
            cabal of browser vendors. The standardisation culture for the XSLT 
            environment is thus conditioned partly by the original motivation of 
            client-side transformation, which demands rigid standards, and partly 
            by the area where it has seen most success, as a server-side domain-specific 
            transformation language, where there is more room for variety and innovation:
            a culture that has enabled newer versions to thrive in a way that newer 
            versions of XML and JSON could not.
        </para>
    </section>
    <section>       
        <title>Lessons from history</title>
        <para>QT 4.0 is, as the number suggests, the fourth phase of standardisation 
            in this area. The 1.0 standards were produced very quickly, and proved 
            highly successful, though they had many technical flaws. Each subsequent 
            phase has taken longer: seven years to version 2.0, a decade to version 3.0, 
            perhaps even longer (who knows) to version 4.0. On many measures the standards 
            have improved in quality: they are more precise, less ambiguous, better 
            supported by test suites, there are certainly fewer gaps in functionality,
            and fewer usability quirks. But some of the new features that were introduced 
            have not achieved widespread adoption<footnote><para>"Citation needed", as they say on Wikipedia®. 
                It is an unfortunate fact that we have no reliable data on how many people are using these 
                technologies and what features they are using; we have to rely on anecdotal evidence.</para></footnote>. Can we look at the features that were 
            successful, and those that weren't, and spot any trends?
        </para>
        <para>My personal attitude is that the success of a standard, and of new features 
            in a standard, is more related to the cost of adoption than to the benefit 
            of adoption. The most significant innovation in XSLT 2.0 was schema awareness, 
            and twenty years later it seems that only a small minority of the user 
            community is using the feature. This is not because there is no benefit: 
            our experience suggests that when developing complex XSLT-based applications, 
            schema awareness gives many productivity benefits through easier debugging. 
            But there is a significant up-front adoption cost. Writing the first version of your code takes longer, 
            even if you get to a complete debugged application more quickly. Similar observations apply to some of 
            the big ideas in 3.0, such as streaming and packages, both of which deliver 
            significant benefits that only a small number of enlightened users are taking advantage of.
        </para>
        <para>By contrast, the things that have been most successful have been those that 
            could be adopted incrementally without any major change. In XSLT and XPath 2.0, 
            grouping, regular expressions, XSLT functions, date and time manipulation, 
            conditional expressions. In 3.0, maps, <code>xsl:iterate</code>, accumulators. Higher-order 
            functions occupy a middle ground: the cost of adoption here is primarily the 
            challenge of learning a new concept in computer science and software engineering, 
            and adoption has steadily increased as the same basic idea has become familiar in other 
            languages such as Java, C#, and Javascript.
        </para>
        <para>I think that the vast majority of changes in QT4 are incremental in this
        sense: once users discover that the feature exists and is available in their
        chosen products, they will be quick to take advantage of it.</para>
    </section>
    <section>
        <title>The standardization process</title>
        <para>Who are the stakeholders in the standards process?</para>
        <para>I will identify four: the users, the implementors, the funders, and the standards organizations themselves.
        What we end up delivering depends on how these four groups of stakeholders play the game, and that in turn
        depends on what they are trying to achieve.</para>
        <para>What I'm going to say here draws not just on experience with QT4, but on other experience within W3C
        and before that with other standardization projects: Codasyl, ANSI, BSI, ISO, ECMA, in some of which
        I was a direct participant and in others merely an interested observer. And this over a timespan of
        fifty years.</para>
        <para>The mechanics of the standardization process have of course changed immeasurably over that timeframe.
        In the Codasyl days I would type a proposal on a typewriter, make 40 copies, and address 40 envelopes,
        making sure they arrived three weeks before the next meeting, which was always somewhere in the US and lasted
        a week. Compare that to the process of creating a pull request on GitHub, and getting feedback an hour later. 
        But although the mechanism may have
        changed, the factors that make some proposals successful and others unsuccessful have not.</para>
        <para>On most of the groups I have worked with, users have acted primarily as reviewers rather than
        initiators. A genuine user (by which I mean someone who actually does hands-on development and
        knows the specs well) is a great asset, even if review and verification is the only contribution they make. 
        Unfortunately some user organisations instead send a supernumerary,
        someone who is no longer actively engaged and whose technical knowledge is rusty; these people can be time-wasters.
        The QT4 activity has been mercifully free of time-wasters, though we do of course get the occasional
        contribution from someone outside the core group who is unaware that the feature they
        want is already available.</para>
        <para>By "implementors", I mean those participants who are actively involved in creating implementations. I don't mean
            representatives of the companies who market products, I mean the designers and developers who actually cut the code.
        Very often there are only two or three genuine developers taking part. That's not necessarily a bad thing:
        the original XQuery 1.0 work was hampered by having perhaps eight or nine people in this role, many of 
        whom could have done a good job as chief designer of the language, but all of them having different perspectives
        on what kind of language they wanted to create. It tends to be the developers on the group who come up with most
        of the ideas. Ideally they not only develop implementations of the standard they are working on, but
        also have projects in which they develop applications using the technology, so they can put themselves
        in the mindset of users. They typically also have their own source of feedback from their own 
        user community.</para>
        <para>In my experience the developers on the group, although they work for companies that are competing with each
        other, often get on very well with each other: they love sharing ideas and often build on each others' ideas
        to create something that none of them would have come up with individually. This collaborative competition
        is highly beneficial to improving the state of the technology for everyone. There can be tensions, however,
        if very capable people share different visions of the end product.</para>
        <para>All groups can suffer from having participants who are poor team players. These people may be very
        able technically, but they can get so passionate about their good ideas that they lose any ability to
        see other points of view and make compromises. They can also lose sight of the fact that selling their ideas
        is essentially a human process that depends on understanding where other people are coming from. The chair of one standards group, who
        in his day job was an industrial psychologist, once took me aside and told me that a colleague of mine had (in my absence) presented
        a proposal in such an antagonistic manner that the group rejected it out of hand, even though the proposal
        actually had considerable technical merit.</para>
        <para>The funders — the people who pay the salaries and hotel bills of the participants — have their own agenda, but
        in my experience, they are often rather vague about what they actually want to achieve. It's hard to convince
        them that they are in a joint venture with their competitors from which everyone gains an advantage. They may well be under the
        misapprehension that by taking part, they will be able to get features into the spec that benefit them and harm
        their competitors: an argument which, in my view, is nearly always deluded. The real business case is that the activity grows
        the size of the market and they get their fair share of that growth.</para>
        <para>Too much input from the funders can have detrimental effects. When vendors start pushing the standard in a particular
        direction, the pressure is often unrelated to any genuine understanding of user requirements. Whether the pressure is from managers in the
        vendor organization, or their marketing people, or the IT directors investing good money in the vendor's products,
        the chances are that the real needs of hands-on developers using the technology have got lost somewhere along the way.
        This can easily lead to complex features being added that no-one ends up using, while simple
        practical improvements are overlooked.</para>
        <para>There's a contradiction I've observed in all the groups I've worked with. The fine detail of a new feature
        gets an enormous amount of detailed attention, and ends up being very well specified and documented (far better, in my experience,
        than the specification of any proprietary software product). Meanwhile,
        the requirement behind the feature often receives little scrutiny. If someone claims that their users need the feature,
        it's very hard to challenge that statement; standards groups gather their requirements from a small and self-selecting
        sample of users. Certainly, I've never seen any serious attempt to quantify the cost benefit
        of a feature, or to apply any rational process to prioritization of different features.</para>
        <para>Finally, the standards organizations: W3C, ECMA, ITU, IETF, WhatWG, or whatever. What is their role and motivation?
        Almost invariably, these groups start as a collaboration between vendors, often vendors whose common interest is
        to reduce the dominance of an existing monopoly supplier. If they are successful at all, the dominant supplier
        later senses which way the wind is blowing and joins the group. Very often the group is formed because established
        venues for doing the work have become fossilized: they have built up sufficiently heavyweight decision-making
        processes that the active parties decide they are better off starting something new. Whether the rest of the community
        likes it or not, it is implementors who drive the technology forward. User input is useful,
        but the real costs are borne by implementors, and they are only going to keep implementing a standard if it's in their
        interests to do so. There was a stage in the 1980s when official "de jure" standards bodies became totally
        disconnected from implementation activities, and it led to the creation of numerous standards that weren't worth
        the paper they were written on. As the internet sprang to life, it became clear that implementors had the upper hand,
        and that standards were often written as a post-hoc exercise once the defining products had already become established.
        That's true regardless whether the products in question were open source (like the early email software, or like browsers)
        or whether they were proprietary (like Microsoft Office).</para>
        
        <para>What does all this mean for QT4? We've been fortunate. There have been no misguided inputs from funders disconnected
        from hands-on users, there's a general feeling that everyone is pulling in the right direction, and we benefit from the reviews and comments
        of a wider user community that understands the technology well and knows its limitations. We have developed our own very
        effective and economical tooling based on GitHub, XML, XSLT, Gradle, and the proprietary DeltaXignia product (formerly DeltaXml).
        The absence of a sponsoring standards organisation (unless you count the very hands-off W3C, which makes no attempt to control
        the direction) hasn't hampered us so far, though it might be useful to re-establish a branding relationship in order to
        build credibility as we come to publication stage. But we might find that at that stage, politics creeps in.</para>
        
        <para>We do have a problem knowing when to stop. We're all perfectionists who want to get it right, and we tend to prioritize quality
            over completion dates.</para>
        
        <para>One of the obstacles W3C put in our way during the development of the 3.0/3.1 versions of the standards was
        the requirement to demonstrate the existence of three independent implementations. We scraped through that requirement on XSLT 3.0: we had
        two implementations actively developed by working group members (Saxon and Exselt, the latter having since
        been withdrawn from the market), and there was a third implementation, Altova Raptor, which followed the standard
        closely even though the vendor played no part in the W3C process (which in a sense is actually good evidence that
        the spec is solid). Unless there's a mystery implementor shadowing every move we make, we're not going 
        to be able to satisfy that requirement for XSLT 4.0: does this matter?
        My view is that a specification created using this community process is going to be of much higher quality than
        if a vendor like Saxonica had tried to go it alone, and that's what matters to the user community.</para>
        
    
        <para>I'm confident
        that there will be other implementations in the future even it there aren't today: at this stage of the game,
        people want to see a standard set in stone before they start the expensive process of 
implementation<footnote><para>There 
            are several projects currently striving to implement XSLT 3.0, 
                although they are all still some way from that goal.</para></footnote>. There are even signs that
        AI technology is getting close to the point where given a good enough specification and test suite, the process
        of constructing an implementation can be largely automated. We're not there yet, but progress has been dramatic.</para>
        
        <para>Meanwhile it remains 
            very much the case that continuous implementation during development of the 
            standard is necessary both to verify that features are practically implementable, 
            and to provide early feedback on their usability.</para>
        
        <para>And of course, the continuous and collaborative development of a comprehensive
        test suite is another key ingredient - but one which probably merits a separate paper.</para>
    </section>
    
    <!--<section>
        <title>XSLT 4.0 standardisation progress</title>
        <para>So where does this leave the 4.0 initiative? When the project was launched 
            at XML Prague 2020 (a live conference held a couple of weeks before the world 
            went into lockdown), the motivation was strongly driven by direct experience 
            from user feedback, including the author's own experience developing a couple 
            of fairly substantial applications [<xref linkend="Kay2016"/>] [<xref linkend="Kay2018"/>], 
            as well as experience in responding to 
            <link linkend="https://stackoverflow.com/search?q=user%3A415448+%5B+xslt+%5D">
            thousands of questions</link> from XSLT users on forums such as StackOverflow. 
            Whereas schema-awareness, streaming, and packages were perceived as strategic 
            features designed to enable new kinds of application and attract new kinds of 
            user, the enhancements proposed for 4.0 were tactical in nature: they were 
            designed to make the life of existing users easier, while writing the same 
            kind of application. Inevitably, ambitions have grown as the project progressed, 
            but the modus operandi has throughout favoured small incremental features over 
            grand ideas. One self-imposed constraint to achieve this has been to strongly 
            resist changes to the data model and type system; though in the end, we cracked 
            the problem of managing JSON trees through the introduction of JNodes [<xref linkend="Kay2025"/>].
        </para>
        <para>Most of the enhancements described in the original 2020 proposal 
            [<xref linkend="Kay2020"/>] are now solidly 
            established with concrete and stable syntax, implemented in two products (BaseX and Saxon), 
            and they have proved their worth, and attracted feedback, from users prepared to work 
            at the bleeding edge. Two exceptions are XSLT template rules for recursive descent 
            transformations of JSON trees, where more work remains to be done (but see 
            [<xref linkend="Kay2022"/>], and functions for node 
            construction, where the proposal met some resistance because it duplicated 
            existing functionality in both XSLT and XQuery. At the same time, many smaller 
            enhancements that weren't envisaged in the original proposal have also found 
            their way into the spec. Many of these build on the foundation of higher-order 
            functions established, but not fully exploited, in XPath 3.1. Higher order 
            functions have proved a powerful platform for building new functionality 
            without extensions to language syntax. Another idea that was present in 
            XPath 3.1 but not fully exploited was the use of an options parameter to 
            define optional processing by standard functions. This has proved an effective 
            way to increase the capability of existing functions (<code>deep-equal</code> and <code>doc</code> are 
            two good examples) without increasing complexity for users who don't need to 
            change the defaults.
        </para>
        <para>Writing a successful standard is not just a technical exercise, it is a 
            social project. It depends on harnessing the efforts of volunteers and on 
            providing benefits to implementors as well as users. It requires contributions 
            of the right skills from individuals, and it requires team working. This is not 
            easy to achieve when there can be no top-down management that constrains 
            individual contributors, most of whom are technically knowledgeable and creative, 
            but who may be highly variable in their working methods and aspirations. 
            In all my experience of standards work, I have felt that the detailed technical 
            decisions depend far more on the skills and aptitudes of individuals than on 
            the business interests of corporations; this can be both a positive and a negative, 
            since all participants have a tendency to exercise their creativity without always 
            asking hard questions about how many users will actually benefit. (I am certainly 
            no exception to that rule.) In the end though, a standard without conformant 
            implementations is a failure, so a precondition for success is that implementors 
            are motivated to invest in turning the specifications into product. 
        </para>
        <para>I should also mention the importance of the test suite.
        </para>    
    </section>-->
    
    <bibliography>
        <title>References</title>
        
        
        <bibliomixed xml:id="Kay2020" xreflabel="Kay 2020">
            Michael Kay.
            "A Proposal for XSLT 4.0". 
            XML Prague, 2020.
            <link xlink:type="simple" xlink:show="new" xlink:actuate="onRequest">http://archive.xmlprague.cz/2020/files/xmlprague-2020-proceedings.pdf</link>.            
        </bibliomixed>
        
      
        
        <bibliomixed xml:id="Kay2023" xreflabel="Kay 2023">
            Michael Kay.
            "Schema-Aware Conversion of XML to JSON". 
            Presented at Balisage: The Markup Conference 2022, Washington, DC, July 31 - August 4, 2023. 
            In <emphasis>Proceedings of Balisage: The Markup Conference 2023</emphasis>. 
            Balisage Series on Markup Technologies, vol. 28 (2023). 
            doi:<biblioid class="doi">10.4242/BalisageVol28.Kay01</biblioid>.
        </bibliomixed>
        
      
        <bibliomixed xml:id="Kay2025" xreflabel="Kay 2025">
            Michael Kay.
            Kay, Michael. "JNodes: a New Model for Navigating JSON Trees". 
            Presented at Balisage: The Markup Conference 2025, Washington, 
            DC, August 4 - 8, 2025. In <emphasis>Proceedings of Balisage: The Markup 
            Conference 2025</emphasis>. Balisage Series on Markup Technologies, vol. 30 (2025). 
            doi:<biblioid class="doi">10.4242/BalisageVol30.Kay01</biblioid>.
        </bibliomixed>
        
        
        
          </bibliography>

    

</article>