Code Monkey home page Code Monkey logo

Comments (5)

daveliepmann avatar daveliepmann commented on August 18, 2024

Version 0.2.6, now available, handles document-node and element variables given as a String, hiccup-style vector, or clojure.data.xml.Element.

from uruk.

hanshuebner avatar hanshuebner commented on August 18, 2024

I had intended to request that XML elements passed as arguments from Clojure would be arriving in the Query as element, not xs:string. I know that it is possible to parse the string to an XML element in the query, and it may actually be faster, yet I find that to be an extra step it would also look better if XML arguments could be declared as having the type element(). Can you investigate whether that'd be easy to implement and discuss if in doubt?

from uruk.

daveliepmann avatar daveliepmann commented on August 18, 2024

We're currently using Request.setNewVariable with ValueType set to element(), which from my research appears to be the extent that a variable passed in can be declared to be element(). As you say, it appears to still be necessary to xdmp:unquote or otherwise parse such a variable.

I will investigate further.

from uruk.

daveliepmann avatar daveliepmann commented on August 18, 2024

See http://developer.marklogic.com/pipermail/general/2016-July/019265.html

from uruk.

daveliepmann avatar daveliepmann commented on August 18, 2024

At this point I'm confident that Uruk is doing everything in its power to send XML elements through as elements. The variable type is set on the MarkLogic side, and in XQuery the node-kind is coming through as "element" without any casting:

(with-open [session (create-session db)]
  (execute-xquery session "xquery version \"1.0-ml\";
                           declare variable $my-variable external;
                           xdmp:node-kind($my-variable)"
                  {:variables {"my-variable" {:value "<foo/>"
                                              :type :element}}
                   :shape :single!}))
=> "element"

...therefore I am closing this for the moment. If other scenarios with XML element type issues arise, we can reopen.

from uruk.

Related Issues (9)

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.