Code Monkey home page Code Monkey logo

Comments (7)

lazize avatar lazize commented on June 12, 2024 1

Maybe it worth to put the return value of each function in README.md, like:

* starts-with( string, string ) string
* ends-with( string, string ) string
* normalize-space( string ) string
* substring( string , start : int [, length : int] ) string
* string-length( [string] ) string
* contains( string, string ) boolean
* sum( node-set ) int64

from xpath.

zhengchun avatar zhengchun commented on June 12, 2024

its a bug,substring should return an empty string, not a false.

from xpath.

zhengchun avatar zhengchun commented on June 12, 2024

Very good.

the sum() return value type is float64.

from xpath.

lazize avatar lazize commented on June 12, 2024

Should it has float64 or just int or number?
Because the precision here doe not matter so much as we use it inside xpath string.

What do you think?

from xpath.

lazize avatar lazize commented on June 12, 2024

Like this:

    * position() number
    * last() number
    * count( node-set ) number
    * name() string
    * starts-with( string, string ) boolean
    * ends-with( string, string ) boolean
    * normalize-space( string ) string
    * substring( string , start : number [, length : number] ) string
    * not( expression ) boolean
    * string-length( [string] ) number
    * contains( string, string ) boolean
    * sum( node-set ) number
    * concat( string1 , string2 [, stringn]* ) string

from xpath.

zhengchun avatar zhengchun commented on June 12, 2024

consider a sum(1+1.2), it return a float number, or sum(count(//a)+2.0) etc.

Another reason is Golang no number type and can not perform an expression like this : int + float, float64 can compatibility int, So for simplify, float64 as default type, even position() or count() function.

from xpath.

lazize avatar lazize commented on June 12, 2024

Goo, so lets use the go types.

from xpath.

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.