xquery

Simple tool to learn XQuery? [closed]

ぃ、小莉子 提交于 2019-12-20 09:13:31
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I started playing around with XQuery . On [w3schools][1] its a good tutorial. I just have some problems: I cannot test the stuff on the site. I found an online XQuery ([this link][2]) and its nice to play with it, but if I would like to use the XQuery on an XML file thats not possible there. Any good and easy

Repeated data in a XML

匆匆过客 提交于 2019-12-20 07:42:31
问题 How can I get the () data which it's not repeated in a variable. I use this function: . . . let $person:= $hopital1/persona for $seq in (1 to count($derechohabiente)) return $person[$seq] [not(xf:is-node-secuence-equal(.,$person[position() < $seq])) ] declare function xf:is-node-secuence-equal ( $node as node()? , $seq as node()*) as xs:boolean { some $nodeInSeq in $seq satisfies fn:deep-equal($nodeInSeq/name, $node/ns0:name) }; . . . This is the XML example, I just want to get Joseph's

eXist - loading XSLT collection() - Exception thrown by URIResolver

非 Y 不嫁゛ 提交于 2019-12-20 06:15:54
问题 Environment: eXist-db 4.2.1 , XQuery 3.1, XSLT 2.0 In eXist-db I am loading an XSLT file which includes a reference to a collection in eXist (in order to perform a search on documents found there, using a key). This reference seems to throw an error from Saxon. Exception while transforming node: Exception thrown by URIResolver XML docs are located at /db/apps/deheresi/data/ XSLT docs are located at /db/apps/deheresi/data/styles In the transform function, I am passing a parameter from XQuery

SQL Server - XQuery for XML

风格不统一 提交于 2019-12-20 05:49:17
问题 Just similar other post, I need to retrieve any rows from table applying criteria on Xml column, for instance, supposing you have an xml column like this: <DynamicProfile xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/WinTest"> <AllData xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d2p1:KeyValueOfstringstring> <d2p1:Key>One</d2p1:Key> <d2p1:Value>1</d2p1:Value> </d2p1:KeyValueOfstringstring> <d2p1

Converting Every Child Tags in to a Single Column with multiple Delimiters -SQL Server (2)

泪湿孤枕 提交于 2019-12-20 05:31:48
问题 declare @xml xml='<plan> <prescriptions id="1"> <prescription> <name>ABC</name> <frequency>Daily</frequency> <dailyfrequency> <morning>2</morning> <afternoon></afternoon> <night>1</night> </dailyfrequency> <dayfrequency></dayfrequency> </prescription> <prescription> <name>EDF</name> <frequency>Daily</frequency> <dailyfrequency> <morning>5</morning> <afternoon>5</afternoon> <night>1</night> </dailyfrequency> <dayfrequency></dayfrequency> </prescription> <prescription> <name>YTER</name>

XQuery and Node Ids

拥有回忆 提交于 2019-12-20 05:27:51
问题 I have this variable: declare @xmlDoc XML it has the following xml stored in it: <?xml version="1.0" encoding="utf-8"?> <NewDataSet> <Table1> <Sharedparam>shared</Sharedparam> <Antoher>sahre</Antoher> <RandomParam2>Good stuff</RandomParam2> <MoreParam>and more</MoreParam> <ResultsParam>2</ResultsParam> </Table1> <Table1> <RandomParam2>do you</RandomParam2> <MoreParam>think</MoreParam> <ResultsParam>2</ResultsParam> </Table1> <Table1> <Sharedparam>Last</Sharedparam> <Antoher> Set </Antoher>

Tokenizing in Xquery

删除回忆录丶 提交于 2019-12-20 05:23:14
问题 How to tokenize special characters like "&" and "?" in xquery. As I'm trying to Tokenize these special characters, I'm unable to do this. Can u suggest me to clear this issue? 回答1: You have to escape the ampersand as you do it in XML. tokenize($string, "&amp;") Alternatively, you could also use its unicode codepoint: tokenize($string, codepoints-to-string(38)) 来源: https://stackoverflow.com/questions/10641546/tokenizing-in-xquery

How to return results together with update operations in BaseX?

血红的双手。 提交于 2019-12-20 03:52:07
问题 I recognized that ( insert / delete )-XQueries executed with the BaseX client always returning an empty string. I find this very confusing or unintuitive. Is there a way to find out if the query was "successful" without querying the database again (and using potentially buggy "transitive" logic like "if I deleted a node, there must be 'oldNodeCount-1' nodes in the XML")? 回答1: XQuery Update statements do not return anything -- that's how they are defined. But you're not the only one who does

Does eXist-db compression:zip function add XML declaration

ⅰ亾dé卋堺 提交于 2019-12-20 03:47:05
问题 I have an XQuery function to convert a group of XML files to HTML and Zip them. It runs a trasform on each file to create <entry> elements. Starting with that function: declare function xport:make-sources( $path as xs:string) as item()* { for $article in collection(xmldb:encode-uri($path)) let $docnum := $article/article/div[@class = 'content']/@doc/string() return <entry name="{concat($docnum,'.html')}" type='text' method='store'> {transform:transform($article, doc("/db/EIDO/data/edit/xsl

Semantics of = and !=

Deadly 提交于 2019-12-20 01:55:24
问题 In XQuery, ("foo", "bar") = ("foo", "bar") yields the value true . That seems obvious. But I noticed that ("foo", "bar") != ("foo", "bar") also yields true , which I found rather surprising. I know that I can negate = with not($x = $y) and I've noticed that = has some kind of set intersection semantics, but can anyone explains the semantics of != , and/or provide a reference for it? 回答1: This can be found in the documentation for XQuery under section "3.5.2 General Comparisons". The following