xquery

XQuery - output series of HTML elements with separator

泪湿孤枕 提交于 2019-12-24 05:57:09
问题 In XQuery 3.1 I am constructing an HTML table. In one <td> element I'm outputting a series of <a ref=""> . So, currently this simple for : <td> { for $b in collection($globalvar:URIdata)/tei:TEI/tei:text//tei:seg[@type="dep_event" and @corresp = $a/data(@corresp) and @xml:id != $a/data(@xml:id)] order by $b/data(@xml:id) return <a href="{concat($globalvar:URLdoc,$b/ancestor::tei:TEI/tei:text/@xml:id)}">{$b/data(@xml:id)}</a> } </td> Outputs this: <td> <a href="http://localhost:8081/exist/apps

xQuery update question

大憨熊 提交于 2019-12-24 05:42:13
问题 Here is my xml <book asin="0201100886" created="128135928" lastLookupTime="128135928"> <price>102.00</price> <purchaseDate>2005-01-22</purchaseDate> </book> <book asin="0122513363" created="128135600" lastLookupTime="128136224"> <price>50.95</price> <purchaseDate>2005-01-22</purchaseDate> </book> <book asin="0201441241" created="128136896" lastLookupTime="128136896"> <price>108.20</price> <purchaseDate>2005-01-22</purchaseDate> </book> <book asin="0471250600" created="128136896"

How to get certain expected values using SOAP UI Xquery Matches

六月ゝ 毕业季﹏ 提交于 2019-12-24 05:31:25
问题 I have a webService that returns certain values. I know what those values will be. I want to pick them out of the XML and if those values are true I want the assertion to pass. Imagine that my test passes if I get this result... How can I assert that that is the case? <BasicPersons> <id>4</id> <firstName>Patricia</firstName> <middleName>A</middleName> <lastName>Cluss</lastName> </BasicPersons> <BasicPersons> <id>5</id> <firstName>Benjamin</firstName> <middleName>L</middleName> <lastName

How to use XQuery/T-SQL to parse customer xml that contains nested default namesapces

萝らか妹 提交于 2019-12-24 04:21:58
问题 I have a customer using a platform we have developed that allows customer webservice return data to be parsed by a stored procedure in MSSQL. We have a customer sending xml back that contains nested xmlns="xxxxxx" declarations that are to different URI locations. First off is this valid? And secondly is it possible to parse using XQuery? I have tried using both .value and .query capabilities of the t-sql xml datatype to try to work through the issue but the point where the "second default

SQL server xquery

一曲冷凌霜 提交于 2019-12-24 00:52:09
问题 I have a xml data <Education> <School ID="1"> <Degree>test</Degree> <Description>desc1</Description> <Institution>kec</Institution> </School> <School ID="2"> <Degree>test2</Degree> <Description>desc2</Description> <Institution>kec2</Institution> </School> </Education> now I need to extract the School detail into some temp table like ---------------------------------- schoolid degree desc instituion ---------------------------------- 1 test desc1 kec 2 test2 desc2 kec2 can anyone please help

Matching one attribute to another using XPath/XQuery in SQL Server 2008

北城余情 提交于 2019-12-23 23:47:11
问题 Consider the XML and SQL: declare @xml xml = ' <root> <person id="11272"> <notes for="107">Some notes!</notes> <item id="107" selected="1" /> </person> <person id="77812"> <notes for="107"></notes> <notes for="119">Hello</notes> <item id="107" selected="0" /> <item id="119" selected="1" /> </person> </root>' select Row.Person.value('data(../@id)', 'int') as person_id, Row.Person.value('data(@id)', 'int') as item_id, Row.Person.value('data(../notes[@for=data(@id)][1])', 'varchar(max)') as

xquery for loop questions

喜夏-厌秋 提交于 2019-12-23 23:26:07
问题 I have a xml containing books at a library. I want to list all the books that arent checked out. So m approach is to get all the books and if the book id matches a checked out book id do not list it, otherwise list it. In java or another language I would do a double for loop and loop over the elements is there something similar with xQuery? <book asin="0201100886" created="128135928" lastLookupTime="128135928"> <uuid>BA57A934-6CDC-11D9-830B-000393D3DE16</uuid> <title>Compilers</title>

how to perform a case-insensitive attribute selector in xquery

梦想的初衷 提交于 2019-12-23 20:06:57
问题 I'm trying to query an XML column in SQL server, and I want to select records where an attribute value matches a case-insensitive string. For instance, consider the following value for the XML column: <items> <item k="Description" v="hello" /> </items> Right now, my select looks like this: SELECT MyXmlColumn.value('(/items/item[@k="Description"]/@v)[1]', 'nvarchar(max)') as v FROM Table The problem is that the value of the "k" attribute could be 'Description', 'description', or 'DESCRIPTION'.

Modify XML node value- UpdateXML equivalent for Oracle 12c

China☆狼群 提交于 2019-12-23 18:36:13
问题 I have some sample code as follows: WITH xtbl AS (SELECT 1 AS xtbl_id, xmltype ('<node_root> <node_1>12</node_1> <node_2>233</node_2> <node_3>223</node_3> <node_4>234</node_4> </node_root>') AS x FROM Dual UNION ALL SELECT 2, xmltype ('<node_root> <node_1></node_1> <node_2>233</node_2> <node_3>223</node_3> <node_4>234</node_4> </node_root>') FROM Dual) SELECT xtbl_id, x, Updatexml (x, '/node_root/node_2', NULL, '/node_root/node_3', NULL, '/node_root/node_4', NULL) AS xcol FROM xtbl WHERE

Separating XML values with the same tags into different rows SQL Server

牧云@^-^@ 提交于 2019-12-23 17:43:42
问题 I have an XML File which I am trying to parse. The XML was created through Excel using Save as XML Because the XML file was created from Microsoft Excel, it has this header: <?xml version="1.0"?> <?mso-application progid="Excel.Sheet"?> <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC