GithubHelp home page GithubHelp logo

saxon's People

Contributors

pjt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

saxon's Issues

Concurrent posible problem in function get-proc

I think I am having a memory leak an testing the usage of get-proc I think it should use "locking" like so:

(defn get-proc
  "Returns the Saxon Processor object, the thread-safe generator class for documents, 
  stylesheets, & XPaths. Creates & defs the Processor if not already created."
  {:tag Processor}
  []
  (locking get-proc
    (defonce ^:private p 
      (Processor. false)) 
    p))

This is because in a very heavy threading environment this can happen (example):

(defn f1 [m]
  (locking f1
    (println "Entrando a " m)
    (Thread/sleep 5000)
    (println "saliendo de " m)
    m))

(defn getx [] ; similar to get-proc
  (defonce ^:private c
    (f1 (rand-int 100)))
  c)

(doseq [n (range 0 3)]
  (future (getx)))

; you will see that f1 is invoked 3 times!

Best regards and thank you for this very helpful library.

Saludos

compile-xquery incompatible with Clojure 1.3

If you load up the saxon library in 1.3 and evaluate
(saxon/compile-xquery "distinct-values(//element()/local-name())")
the result is:
NoSuchMethodError clojure.lang.Numbers.lt(II)Z saxon/compile-xquery/fn--67 (saxon.clj:149)

This seems to be the case for all queries I've tried, and they work when I load the library in 1.2.

I've been looking for the source of incompatibility but so far I haven't found it. Any idea on what causes this to fail in 1.3?

Thanks,
Rob

NoSuchMethodError clojure.lang.Numbers.lt(II)Z saxon/compile-xquery/fn--67 (saxon.clj:149)

user=> (require '[saxon :as xml])
nil
user=> (let [xmldoc "<html><body><span>Hello world</span></body></html>"] (xml/query "distinct-values(//element()/local-name())" xmldoc))
NoSuchMethodError clojure.lang.Numbers.lt(II)Z  saxon/compile-xquery/fn--67 (saxon.clj:149)
$ cat project.clj 
  ...
  :dependencies [
        [org.clojure/clojure "1.4.0"]
        [clojure-saxon "0.9.2"]
    ]

xpath.clj arguments contains the script name

Hi,

The variable command-line-args contains the name of the program at first position. So we have to take the rest of the sequence to get the right argument list.

(let [args command-line-args

->

(let [args (rest command-line-args)

Ludovic Kuty

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.