marklogic

MarkLogic XML to JSON conversion

本小妞迷上赌 提交于 2019-12-13 14:24:38
问题 I am trying to convert this XML file into JSON but unable to get any success. I have two child element in my XML but it is returning only last one. How to get both the records in JSON format? XML <Carousel> <Video> <Title>1</Title> <Abstract>3</Abstract> <FileName type="custom" mediatype="image">D</FileName> <HasAccess>4</HasAccess> </Video> <Video> <Title>1</Title> <Abstract>2</Abstract> <FileName type="custom" mediatype="image">D</FileName> <HasAccess>3</HasAccess> </Video> </Carousel>

MarkLogic: XQuery to Get Values from XML Documents?

↘锁芯ラ 提交于 2019-12-13 14:18:02
问题 I have the following XML document loaded in MarkLogic database: <x:books xmlns:x="urn:books"> <book id="bk001"> <author>Writer</author> <title>The First Book</title> <genre>Fiction</genre> <price>44.95</price> <pub_date>2000-10-01</pub_date> <review>An amazing story of nothing.</review> </book> <book id="bk002"> <author>Poet</author> <title>The Poet's First Poem</title> <genre>Poem</genre> <price>24.95</price> <review>Least poetic poems.</review> </book> </x:books> I am new to XQuery. How

Marklogic: How to know the number of records returned by an xquery?

北城以北 提交于 2019-12-13 10:23:49
问题 I'm performing an xquery over a set of xml documents. Then I'm reading it from another workspace using a web service. The result that I'm getting is half of the number of records stored in Marklogic. I have 764 xml records and I'm getting the results of 382 records. I want to make sure that Marklogic is not skipping any record by knowing the number of the number of records returned by an xquery? And If it is possible I want to know if I can force Marklogi to perform the xquery on all of the

How to deploy files into MarkLogic server

给你一囗甜甜゛ 提交于 2019-12-13 07:49:48
问题 I am new to Marklogic database. I try to retrieve data through CTS queries. I have created an html and an xqy file in Eclipse. How do I deploy my files into MarkLogic server? 回答1: I strongly encourage you to take some of MarkLogic University's classes -- they are free and available online. Also, take a look at the available guides and tutorials. For your specific question, I suggest you begin by reading Getting Started With MarkLogic XQuery Applications. 来源: https://stackoverflow.com

MarkLogic 7 - database-backup with rest-api

巧了我就是萌 提交于 2019-12-13 05:55:27
问题 I'm looking to automate backups in ML7 using rest-api. Since that's not available out of the box, I figured that I can just add new extension and setup script with curl command on desired schedule. Sounds easy but for some reason when I try installing my extensions it spits out 'invalid content' and log is showing: • RESTAPI-INVALIDCONTENT: (err:FOER0000) Invalid content: invalid backupdb extension: could not parse XQuery extension backupdb; please see the server error log for detail XDMP

MarkLogic Cluster & Forest replica - XDMP-BAD: No label found

你。 提交于 2019-12-13 05:47:24
问题 We are setting up MarkLogic Cluster in Azure using data directory as Azure Blob container. Following steps has been followed Setup 1st MarkLogic server Added 2nd server in cluster by providing host name of 1st server Added 3rd server in cluster by providing host name of 1st server Add 3 forests, data directory is "azure://" as mentioned in page number 32 here In 1st Forest, added 2 as a replicas As soon as i add replica in Forest01, Label of Forest01 becomes empty with 0 size, before it is

How to search the given text into marklogic XHTML file, like clt+f

一个人想着一个人 提交于 2019-12-13 04:52:41
问题 I have below XHTML file saved in the marklogic with the URI(/54ab8c234f3c8ce1f5c30ddc). I need to search the Marklogic DB based on the string (if it is tag name or attribute name or text in the XHTML). I am able to search only text either attribute. But not able to search at a time all. Note: if I pass "SS_Default"(it is a attribute value) string it will return the URI of marklogic or if I pass the "META" (it is a tag name) it should return the corresponding URIs or if I pass "Narrowed by"(it

Sending email using marklogic and xdmp

两盒软妹~` 提交于 2019-12-13 04:10:55
问题 I went through product library and found that there is a method called xdmp:email($node) which can send email only using a thing called smtp relay(?) which does NOT require any authentication. How can I send email using my email for example with following configuration: outgoing smtp server: smtp.gmail.com smtp port: 465 username: username@gmail.com password: **** Use secure connection: true. This set of parameters are common when we automate the ' send email ' process. Now, in marklogic, we

Writing Efficient SPARQL Queries (MarkLogic)

橙三吉。 提交于 2019-12-13 03:45:08
问题 I am currently running various queries and the query below takes about 4 minutes to complete. It is also running through a fairly large number of data rows(~200 Mill). However, I would like to know if there are any possible ways of improving this query? I believe I tried to optimize the query by interweaving the necessary filters before doing the next hop. Query Used xquery version "1.0-ml"; import module namespace sem = "http://marklogic.com/semantics" at "/MarkLogic/semantics.xqy"; import

NODEJS Marklogic - Write document list cannot process response with 404 status when using documents.write()

蓝咒 提交于 2019-12-13 02:56:14
问题 I'm new to nodejs and marklogic, and I'm following a tutorial for a simple app, I have setup and configured my marklogin login credentials, when I run this sample code by running node sample.js the output is write document list cannot process response with 404 status I wonder why I'm encountering this error, here is the code from the tutorial, my-connection.js module.exports = { connInfo: { host: '127.0.0.1', port: 8001, user: 'user', password: 'password' } }; sample.js const marklogic =