Giter Site home page Giter Site logo

fn:has-attributes about qtspecs HOT 5 CLOSED

ChristianGruen avatar ChristianGruen commented on July 18, 2024
fn:has-attributes

from qtspecs.

Comments (5)

michaelhkay avatar michaelhkay commented on July 18, 2024 1

The has-children() function was introduced specifically to support XSLT streaming, as a way of testing (by a single-token lookahead) whether children exist, without actually swallowing them as the equivalent exists(child::node()) would do. It was then moved from XSLT into XPath (along with other streaming-oriented things such as innermost() and outermost()) on the basis of "no needless differences".

The functionality of has-attributes() can be readily achieved using exists(@*) and I really see no need for a special function to do that.

from qtspecs.

michaelhkay avatar michaelhkay commented on July 18, 2024 1

Wouldn’t that be a typical task for an optimizer (rewriting exists(node()) to an internal has-children() check)?

We made a decision (rightly or wrongly) that XSLT streamability shouldn't depend on optimization rewrites, in order to make the rules fully interoperable.

The statement that "the function has general utility as a convenience function" clearly indicates, to someone experienced in reading standards documents, that the WG knew the justification was weak; features don't attempt to justify themselves otherwise.

from qtspecs.

ChristianGruen avatar ChristianGruen commented on July 18, 2024

The has-children() function was introduced specifically to support XSLT streaming, as a way of testing (by a single-token lookahead) whether children exist, without actually swallowing them as the equivalent exists(child::node()) would do.

Wouldn’t that be a typical task for an optimizer (rewriting exists(node()) to an internal has-children() check)?

The specification states that the function has “general utility as a convenience function”. I think the argument would also be valid for an attribute function.

After all, it probably takes more time to talk about the function than just adding or ignoring it, so… I have no strong opinion.

from qtspecs.

michaelhkay avatar michaelhkay commented on July 18, 2024

I don't think this function adds much value and I propose we turn down the suggestion.

from qtspecs.

ndw avatar ndw commented on July 18, 2024

The CG agreed to close this issue without action at meeting 064

from qtspecs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.