[Home] [By Thread] [By Date] [Recent Entries]
That does look promising and stirs curiosity. But while you are at it, could you not - at least, in principle - do it exactly the other way around - rather than define representations of flatMap() as /, etc., define a translation of / into flatMap(), etc - in short, a compilation of XPath into your low-level, streaming API expressions? Per mainstream, Java people are using a JAXB compilation step in their build processes anyway, adding an XPath compilation step would not hurt at all, and safety is at its maximum, as is expressiveness.
Michael Kay <mike@s...> schrieb am 15:33 Donnerstag, 22.Juni 2017:
Excellent point. However, dropping into another language does have all sorts of disadvantages: apart from the learning issues, there's the lack of compile-time syntax checking and type checking, the cost of dynamic compilation/interpretation, etc. One thing to look at, perhaps, is how it translates into Scala, where you can define your own operators: A.flatMap(B) --> A/B A.attribute(B) --> A @ B etc; and then we start to have something very XPath-like, but with a syntax that's compiled and validated by the host language. Michael Kay Saxonica
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] |

Cart



