xquery

Can I make XQuery evaluate { $expression } within variables bound with XQJ?

主宰稳场 提交于 2019-12-13 02:19:20
问题 To mimic an auto-increment value in XQuery Update, the following works fine, assuming <root count="0"/> when running this for the first time: let $count := /root/@count return ( insert node <node id='{ $count }'/> into /root, replace value of node $count with $count + 1 ) ...nicely yielding: <root count="1"> <node id="0"> </root> However, I'd like to define the node in my Java code, and then bind that as an org.w3c.dom.Node or Document , or even String . Like: String expr = " declare variable

Massive differences in speed with virtually identical XQuery (exist-db) interogations

感情迁移 提交于 2019-12-13 00:38:13
问题 I've been porting an SQL database over to exist over the last few weeks, and while I so far managed to get over all previous hindrances, I've now run into something for which neither the official documentation, searching online, nor common sense was able to help. In short, I have a pretty big collection (about 90k entries, spread over 20 files), with most individual entries looking something like this (this is a massive simplification so I can get the point across): <document> <document_id

sql server 2008 xml file to table

守給你的承諾、 提交于 2019-12-12 19:17:11
问题 I have an xml file that I'm trying to import into a table. My xml file looks like this: <?xml version="1.0" encoding="utf-8"?> <xml_objects xmlns="http://www.blank.info/ns/2002/ewobjects"> <item_id item_id="41-FE-001"> <class display="true"> <class_name>FEEDER</class_name> </class> <name display="true"> <name_value>41-FE-001</name_value> </name> <attributes> <attribute> <attributename>Type</attributename> <value>EQUIP</value> </attribute> <attribute> <attributename>Tag No</attributename>

Marklogic : Multiple XML files created on document on importing a csv. How to get root Document URI path?

Deadly 提交于 2019-12-12 19:15:15
问题 I am new to Marklogic, I tried to import my CSV files of 100k records to Marklogic and after import, I found it gets imported to Documents Database by default. Also, I found for each records, I see a XML file generated in the database with incremental number appended to the "documentUri" that I mentioned while importing. For Example: documentUri_1.xml. I understands multiple xml files are created inorder to read the data in a distributed manner. Question: 1. How to get the root document URI

How to get an element with varying namespace

ⅰ亾dé卋堺 提交于 2019-12-12 18:58:53
问题 I wish to get the element name of the below xml. My issue in my request is that I want to get the Payload element. For that I used this expression name(//env:Payload) So I am getting this result env:Payload <env:requeset xmlns:env="http://eai.ssss.xxx/Envelope" xmlns:ggg="http://fai.dgn.sss/ggg"> <env:clientbody> <env:Payload> <ggg:Service> <ggg:Request> <a>name</a> <b>age</b> <c>address</c> </ggg:Request> </ggg:Service> </env:Payload> </env:clientbody> </env:requeset> But some times my

Filter Values of Current Week with XQuery

二次信任 提交于 2019-12-12 18:09:29
问题 I am extracting data from Sharepoint using XQuery. The xquery code is: {for $ancestor0 in $queryresponse//*:row return<Row> <Title>{fn:data($ancestor0/@ows_Title)}</Title> <EventDate>{fn:data($ancestor0/@ows_EventDate)}</EventDate> The data returned is: <h1>Meeting Agenda Event Date</h1> New England APCD Work Group 6/26/2013 NY APD Workgroup 6/27/2013 MCDB 2012 Data Submission Bi-weekly 7/2/2013 MA APCD 7/3/2013 VA APCD Monthly Status 7/4/2013 Cross State Meeting 7/5/2013 NY APD Workgroup 7

MarkLogic: XQuery to Get Distinct Names from XML Document?

情到浓时终转凉″ 提交于 2019-12-12 17:07:26
问题 I am using the following file: <bookstore> <book category="COOKING"> <title lang="en">Everyday Italian</title> <author>Giada De Laurentiis</author> <year>2005</year> <price>30.00</price> </book> <book category="CHILDREN"> <title lang="en">Harry Potter</title> <author>J K. Rowling</author> <year>2005</year> <price>29.99</price> </book> <book category="WEB"> <title lang="en">XQuery Kick Start</title> <author>James McGovern</author> <author>Per Bothner</author> <author>Kurt Cagle</author>

MarkLogic - Extending the Search, return specific object node

拥有回忆 提交于 2019-12-12 15:12:05
问题 I am very new getting started with MarkLogic and XQuery. I am trying to create a Search Transform to return, the actual JSON from a specific level of the document Here is a sample Document. I would like to return the whole JSON based segment no matter where the search results are in the lower level (transcript, topics, banners etc.,) Splashing around in the Query Console... search:search('trump')/search:result/search:snippet//@path Successfully Returns the path of the object, wrapped in a fn

Select row data in addition to structured XML data

早过忘川 提交于 2019-12-12 12:38:25
问题 I know how to join an XML variable to other tables, but in this case, I am trying to select each row from a table plus the structure of the XML from each respective table row , alongside that row. I cannot find any examples online to help with this, as most examples deal with a single XML value (apologies if there are, I was unable to locate them in amongst the myriad of other XML examples). The table structure is this: CREATE TABLE tbl_QuizHistory ( HistoryId int PRIMARY KEY, QuizData xml

How to pass a variable into XPath of XQuery in an SQL statement

那年仲夏 提交于 2019-12-12 12:32:13
问题 Scenario: I have an xml column in MSSQL database which I have to parse the XML data of that cell using XQuery . Xml content : <AnchoredXml xmlns="urn:schema:Microsoft.Rtc.Management.ScopeFramework.2008" SchemaWriteVersion="2"> <Key ScopeClass="Global"> <SchemaId Namespace="urn:schema:Microsoft.Rtc.Management.Deploy.Topology.2008" ElementName="Topology" /> <AuthorityId Class="Host" InstanceId="00000000-0000-0000-0000-000000000000" /> </Key> <Dictionary Count="1"> <Item> <Key /> <Value