xquery

Less than, greater than, equal to not working as expected in XPath

旧城冷巷雨未停 提交于 2019-12-13 06:15:38
问题 this is my xml file:- <products> <product_id value="1"> <tab_id value="351"> <tab_name value="test1"/> <dist_map value="5"/> </tab_id> </product_id> <product_id value="2"> <tab_id value="352"> <tab_name value="test2"/> <dist_map value="3"/> </tab_id> </product_id> </products> this is my xpath:- var xPath = '//*[local-name() = "'+elName+'" and '+value+' and '+ value +' '+ls +' contains(concat(@value,","),"'+value+',")and '+ ' translate(@value," -:","")]'+'/../../@value'; i have three buttons

Xquery append text to tag values depending of the element type

早过忘川 提交于 2019-12-13 05:51:42
问题 I need to get the values of some elements and then some text needs to be added depending on the element, for example: <elementType>a</elementType> <otherElementType>b</otherElementType> <elementType>c</elementType> <elementType>d</elementType> $doc//*[self::elementType or self::otherElementType]/string() "a" "b" "c" "d" this returns the values but I don´t know how to get the values like this: "a is an elementType" "b is an otherElementType" "c is an elementType" "d is an elementType" 回答1: Use

How to search the given text into marklogic XHTML file, like clt+f

一个人想着一个人 提交于 2019-12-13 04:52:41
问题 I have below XHTML file saved in the marklogic with the URI(/54ab8c234f3c8ce1f5c30ddc). I need to search the Marklogic DB based on the string (if it is tag name or attribute name or text in the XHTML). I am able to search only text either attribute. But not able to search at a time all. Note: if I pass "SS_Default"(it is a attribute value) string it will return the URI of marklogic or if I pass the "META" (it is a tag name) it should return the corresponding URIs or if I pass "Narrowed by"(it

TSQL Replace value in XML String

妖精的绣舞 提交于 2019-12-13 04:48:03
问题 I have a field within my table that contains optional fields of data contained as XML. One of those fields is editable in my UI and I am trying to update that node / value within the block of XML. Here is what I have: UPDATE dbo.TFS_Feedback_New SET Details.modify('replace value of (/optional/educational/text())[1] with "@updatedEducation"') WHERE feedbackID = @FBID The issue is, I need to pass the replacement as a variable. When I have it as is, it puts in @updatedEducation as the field

Sending email using marklogic and xdmp

两盒软妹~` 提交于 2019-12-13 04:10:55
问题 I went through product library and found that there is a method called xdmp:email($node) which can send email only using a thing called smtp relay(?) which does NOT require any authentication. How can I send email using my email for example with following configuration: outgoing smtp server: smtp.gmail.com smtp port: 465 username: username@gmail.com password: **** Use secure connection: true. This set of parameters are common when we automate the ' send email ' process. Now, in marklogic, we

Querying Non-XML compliant structured data

强颜欢笑 提交于 2019-12-13 03:23:35
问题 As a data analyst, I am constantly running across files with structured data that are in some proprietary format and resist normal XML parsing. For example, I have an archive of about a hundred documents that all begin with this: <!DOCTYPE DOCUMENT PUBLIC "-//Gale Research//DTD Document V2.0//EN"> I have included an abridged example of the document below, don't read it if you're offended by cloning. At any rate, is there a way to query this without having DTD or namespace or URI or whatever

xquery count for expressions in a for expressions

不想你离开。 提交于 2019-12-13 03:18:17
问题 question is how could i count the for expressions in a for expressions with unknow parent. Code: let $act :=( <act time="1231"> <data value="2">hello</data> <data value="2">hello</data> <data value="2">hello</data> <data value="2">hello</data> <data value="2">hello</data> <data value="2">hello</data> </act>, <act time="51292"> <state> <data value="2">world</data> <data value="2">world</data> <data value="2">world</data> <data value="2">world</data> <data value="2">world</data> </state> </act>

How would you remove all literals from this xquery

给你一囗甜甜゛ 提交于 2019-12-13 03:16:57
问题 How can a remove the literals from the return in employee.../employee and manager.../manager so I can delete employee.../employee and manager.../manager. I want the result to display without the employee and manager in the resulting xml. <results> { for $depen in doc("../company/dependent.xml")//dependent where $depen/dependent_name=* return <row> <dependent name="{$depen/dependent_name}"/> { for $emp in doc("../company/employee.xml")//employee[ssn = $depen/essn ] return <employee> <emp fname

Get Element from another XML file, based on an element value from current XML

泪湿孤枕 提交于 2019-12-13 02:56:43
问题 I use the following XSLT code to extract a list of elements from another XML file: <xsl:variable name="titleCodes" select="document('other_XML.xml')/list"/> The other_XML.xml file looks like this: <?xml version="1.0" encoding="UTF-8"?> <list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="struktur_berufe.xsd"> <job id="15339" bkz="B 01104-101"> <type>t</type> <name> <name_nl>Job a</name_nl> </name> </job> <job> ... </job> ... </list> I now want to extract

Convert to html using xquery?

风格不统一 提交于 2019-12-13 02:38:32
问题 I have the following T-Sql for database email. -- create proc TableToHtml @table varchar(max) as declare @table varchar(max) = '(select 1 a, ''one'' b union all select 2, ''two'') t ' declare @sql varchar(max) = ' declare @xml xml = ( select * from ' + @table + ' for xml path(''tr''), root(''table'') ); select @xml' declare @tmp table (x xml) insert into @tmp exec(@sql) declare @x xml = (select x from @tmp) select @x and it returns <table> <tr> <a>1</a> <b>one</b> </tr> <tr> <a>2</a> <b>two<