Comments (5)
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.
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.
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 equivalentexists(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.
I don't think this function adds much value and I propose we turn down the suggestion.
from qtspecs.
The CG agreed to close this issue without action at meeting 064
from qtspecs.
Related Issues (20)
- XQFO Code in the Rules sections HOT 7
- fn:subsequence-where: equivalent `fn:slice` expression HOT 2
- Reinstate subsequence-before HOT 1
- regular expressions - whitespace HOT 6
- regular expression addition - word boundaries HOT 1
- How to invert a predicate function HOT 16
- QT4CG-064-03, QT4CG-064-04: Examples, Return type of `fallback`
- XQFO: Context item → value
- fn:parse-json, fn:json-to-xml: `number-parser`, `fallback`
- Rules for context-dependent function references in XSLT (e.g. regex-group#1) HOT 1
- Identify optional arguments in callback functions HOT 41
- Add position argument to scan-left and scan-right HOT 3
- fn:reduce (or fn:fold without initial value) HOT 5
- Numeric Comparisons HOT 5
- character sequence constructor 'a' to 'z' HOT 21
- Transitive closure on non-nodes HOT 2
- Invisible-xml - missing details HOT 1
- Invoking maps & arrays: allow sequences? HOT 5
- regular expression addition - lookbehind assertions and lookahead assertions HOT 2
- regular expression addition - comments HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qtspecs.