xquery

Query generate 'XDMP-CHILDNODEKIND: $final — element nodes cannot have binary node children' error

Deadly 提交于 2021-02-10 13:55:15
问题 Below is my simple query, that reads all files from a directory and holds all files in $final Variable save in one single file. But when run this query, after taking some time, it prompt [1.0-ml] XDMP-CHILDNODEKIND: $final -- element nodes cannot have binary node children error. let $input-dir :=xdmp:filesystem-directory("d:\work\may\06-05-2019\all- feeds-input-output\clc\log\clc-true-ouput\")/dir:entry let $final := for $each at $i in $input-dir return xdmp:document-get($each/dir:pathname

Xquery function for Xslt key function

社会主义新天地 提交于 2021-02-10 04:42:46
问题 I want to convert the xslt key function to a Xquery function . Can anyone help me in this? 回答1: If we have an xsl:key instruction : <xsl:key name='someName' match="patExpr" use="Expr"/> and a call to the key() function : key('someName', someExpr, $someDocNode) this is equivalent to : ($someDocNode//patExpr)[Expr = someExpr] So, for any specific key, you need to declare a function (name it my:keySomeName() ) that returns a sequence of nodes and whose body is the above expression. Example : If

Combine two for loops and union results in XQuery

谁说我不能喝 提交于 2021-02-08 10:01:51
问题 Let's say we have this folders not_my_files collections collection1.xml collection2.xml collection3.xml etc... my_files my_documents mydoc1.xml mydoc2.xml mydoc3.xml etc... There are the structure of xml files collection1.xml (same structure for collection2.xml, collection3.xml, etc...) <collection xml:id="name_of_collection_1"> <ref id="id_of_ref_1"> <title>This is title 1 of first document in this collection</title> </ref> <ref id="id_of_ref_2"> <title>This is title 2 of second document in

New to Xquery trying to make function for library module

泄露秘密 提交于 2021-02-08 08:33:32
问题 i'm working on a xquery assignment and i'm confused as to whether and im doing it right i'm making a library module for later xqueries. the current step i'm stuck on is i need to create a function named GetAthleteMedals that return the medals won by a specifc athlete with a single parameter named aID that stores a althletes id then within that function i need to make a FLOWR query that interates through every medal from a medals document whose athID equals the value of the aID parameter.

How to query XML as used in .dtsx (SSIS)

◇◆丶佛笑我妖孽 提交于 2021-02-08 03:42:31
问题 I have made an SSIS 2014 package (Project Deployment). Here you see a (relevant) part of it's XML-content: <DTS:Executable DTS:refId="Package\Drop and Create statements voor tabellen\Drop and Create Classes_staging" DTS:CreationName="Microsoft.ExecuteSQLTask" DTS:Description="Execute SQL Task" DTS:DTSID="{60C174A8-D9C0-4F2A-B783-77753552BFCB}" DTS:ExecutableType="Microsoft.ExecuteSQLTask" DTS:LocaleID="-1" DTS:ObjectName="Drop and Create Classes_staging" DTS:TaskContact="Execute SQL Task;

Need help rewriting XQuery to avoid expanded tree cache full error in MarkLogic

人走茶凉 提交于 2021-02-08 03:32:39
问题 I am new to XQuery and MarkLogic. I am trying to update documents in MarkLogic and get the extended tree cache full error. Just to get the work done I have increased the expanded tree cache but that is not recommended. I would like to tune this query so that it does not need to simultaneously cache as much XML. Here is my query I have uploaded my query as an image because it was not so pretty when I pasted it on the editor. If any one knows a better way please suggest. Thanks in advance. 回答1:

Need help rewriting XQuery to avoid expanded tree cache full error in MarkLogic

天涯浪子 提交于 2021-02-08 03:32:31
问题 I am new to XQuery and MarkLogic. I am trying to update documents in MarkLogic and get the extended tree cache full error. Just to get the work done I have increased the expanded tree cache but that is not recommended. I would like to tune this query so that it does not need to simultaneously cache as much XML. Here is my query I have uploaded my query as an image because it was not so pretty when I pasted it on the editor. If any one knows a better way please suggest. Thanks in advance. 回答1:

Xquery FLWOR with group by

天大地大妈咪最大 提交于 2021-02-07 19:12:01
问题 I want to group all movies by genre and then list all movie titles in this genre. My XML movie database looks as following: <movies> <movie> <title>A History of Violence</title> <year>2005</year> <country>USA</country> <genre>Crime</genre> <summary>Tom Stall, a humble family man and owner of a popular neighborhood restaurant, lives a quiet but fulfilling existence in the Midwest. One night Tom foils a crime at his place of business and, to his chagrin, is plastered all over the news for his

Converting xml to csv from XQuery in BaseX

不想你离开。 提交于 2021-02-07 08:38:53
问题 The reason for which I'm writing is because I have a database of approx 1k of xmls in BaseX. I already cleaned it and got the info I wanted. Nevertheless, I want to be able to export that data in the CSV format. When I tried with the code given in the BaseX documentation it gave me this: Desc,Cantidad,Valor,Fecha,Lugar,UUID ,,,,, ,,,,, And it should show the data between the commas. What I am asking is how should I modify my code in order for the data to appear. My code is the following:

Converting xml to csv from XQuery in BaseX

非 Y 不嫁゛ 提交于 2021-02-07 08:37:41
问题 The reason for which I'm writing is because I have a database of approx 1k of xmls in BaseX. I already cleaned it and got the info I wanted. Nevertheless, I want to be able to export that data in the CSV format. When I tried with the code given in the BaseX documentation it gave me this: Desc,Cantidad,Valor,Fecha,Lugar,UUID ,,,,, ,,,,, And it should show the data between the commas. What I am asking is how should I modify my code in order for the data to appear. My code is the following: