I'd noticed that the MarkLogic XCC drivers don't appear (at first glance) to allow you to pass an Object as a node() into a query. From a bit of research and some testing, I'd found that it would allow you to pass a String (as an xs:string) as an external variable - and from there - this can be converted into a document-node() using xdmp:unquote()
So if you're using XCC/J with MarkLogic and you want to pass a node() into a Query, here's a brief example of how you could achieve such a thing:
Some example XML:
Some example XQuery:
And putting it all together, one Java class containing everything:
In your MarkLogic ErrorLog.txt, you should something like this:
Subscribe to:
Post Comments (Atom)
Blog Archive
-
►
2011
(35)
-
►
June
(6)
- MarkLogic/XCC: Copying a Module with User Content ...
- MarkLogic: clearing a forest in a database program...
- MarkLogic: Enabling debug options when using the S...
- Linux: SCP syntax and structure note
- MarkLogic/XCC: Installing Modules Programatically
- Eclipse: Installing XQDT (and DLTK) on Eclipse Ind...
-
►
June
(6)
-
▼
2010
(43)
-
►
September
(7)
- MarkLogic: Creating Multiple Range Element Indexes...
- MarkLogic: Listing all Collections in a Database
- MarkLogic: Basic Database Cloning Script
- MarkLogic: Estimating the number of documents cont...
- MarkLogic: Search: Compound OR Queries
- MarkLogic: XQuery: Check for the presence of an el...
- MarkLogic: XQuery: Type Validation using xsi:type
-
▼
June
(8)
- XQDT: Notes for installing the current Milestone o...
- MarkLogic: XQuery: performance with Maps
- Java: Using Jersey with JAXB to output XML or JSON...
- MarkLogic: XQuery: hacking the position() - a basi...
- MarkLogic: XQuery: and / and-not query examples
- MarkLogic: XQuery: UNIX Timestamp to xs:dateTime C...
- MarkLogic: XCC/J: Passing a node() into a Query as...
- MarkLogic: XQuery: Typeswitching based on input "t...
-
►
September
(7)
0 comments:
Post a Comment