xquery

What's the difference between XDM and DOM models?

故事扮演 提交于 2019-12-13 18:19:55
问题 I must describe differences between those models. I know there is difference in types and purpose anything else? 回答1: Michael Kay has already given a pretty good summary of the data-level differences; I'll try to give you some of the design-level differences in my answer. At the most fundamental level, XDM models a "sequence of items", whereas DOM models a "hierarchy of nodes." This distinction affects every other aspect of their design, from what data can be represented, to how it is

xpath navigating documents in a collection with sibling

夙愿已清 提交于 2019-12-13 17:45:04
问题 I have a collection of 1000s of TEI documents in the variable $data (note: the top-most node in each document is tei:TEI ). Within Xpath (under Xquery) I can output all the @type="example" documents with: let $coll := $data/tei:TEI[@type="example"] return $coll I can then further extract one document from the above result with: let $coll := $data/tei:TEI[@type="example"] return $coll[@xml:id="TC0005"] The above work fine. Now, I would like to get the documents before and after a certain

Concat XML nodes using XQuery

痞子三分冷 提交于 2019-12-13 16:08:48
问题 I required the following output <name>Thomas Mapother</name> <name>Tom Cruise</name> using the below XML using XQuery FLOWR Expressions. INSERT INTO XMLO1 VALUES ('<Contact> <Names> <Name Type = "Legal"> <First>Thomas</First> <Middle>T</Middle> <Last>Mapother</Last> </Name> <Name Type = "Stage"> <First>Tom</First> <Middle>C</Middle> <Last>Cruise</Last> </Name> </Names> </Contact>') I tried the below query. But it returns a different output. SELECT xDoc.query('let $names := Contact/Names/Name

XQuery and Zorba: Setting the serialization parameters from inside the XQuery document

落花浮王杯 提交于 2019-12-13 15:27:13
问题 According to this: http://www.xmlplease.com/xquery-xhtml "XQuery does not have a standard way of setting the serialization parameters if available. In XQuery we must look up the proper documentation for the XQuery processor to find out what serialization parameters are implemented if any, and how exactly to use them. If available they can normally be set at the command line. Often they can also be used from inside the XQuery document." In Saxon you can write something like declare option

OSB fn-bea functions using Xquery processor in Java

家住魔仙堡 提交于 2019-12-13 14:29:07
问题 Hi i am trying to unit test xqueries that are used in OSB ,using oracle's Xquery processor for java . refer link below http://docs.oracle.com/database/121/ADXDK/adx_j_xqj.htm#ADXDK187 The Xquery is using some fn-bea functions (http://docs.oracle.com/cd/E13167_01/aldsp/docs25/xquery/extensions.html) The functions are not recognized by the Xquery Processor . We are thing of desclaring these functions as external Functions and use them . However we need to know the exact class and method name

Querying XML columns in SQLServer 2005

你离开我真会死。 提交于 2019-12-13 14:28:01
问题 There is a field in my company's "Contacts" table. In that table, there is an XML type column. The column holds misc data about a particular contact. EG. <contact> <refno>123456</refno> <special>a piece of custom data</special> </contact> The tags below contact can be different for each contact, and I must query these fragments alongside the relational data columns in the same table. I have used constructions like: SELECT c.id AS ContactID,c.ContactName as ForeName, c.xmlvaluesn.value('

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

Can this preg_replace_callback method be done in xPath or XQuery?

家住魔仙堡 提交于 2019-12-13 06:55:19
问题 The script below takes the $myContent block and does the doReplace() function on the $myKeyword value. The problem I have is that it does not know if the replacement text is already inside a tag or not. I need to modify the doReplace() function so that it does not touch any text inside of or as attributes of the named tags (h1, h2, h3, i, u, b, strong, em, img). I think it would be better to convert this over to an xPath method and looking for suggestions on how it might be done with xPath.