xquery

IMPORTXML XPath_Query for Google Sheets

瘦欲@ 提交于 2020-01-13 17:07:41
问题 I'm using GoogleSheet's IMPORTXML function to retrieve data for each calendar date one year earlier or the closest year-ago date where data are available. This is a sample of the data (full data source is here): <entry> <id>http://data.treasury.gov/Feed.svc/DailyTreasuryYieldCurveRateData(6794)</id> <title type="text"></title> <updated>2018-02-06T22:05:38Z</updated> <author> <name /> </author> <link rel="edit" title="DailyTreasuryYieldCurveRateDatum" href="DailyTreasuryYieldCurveRateData(6794

IMPORTXML XPath_Query for Google Sheets

不羁岁月 提交于 2020-01-13 17:05:30
问题 I'm using GoogleSheet's IMPORTXML function to retrieve data for each calendar date one year earlier or the closest year-ago date where data are available. This is a sample of the data (full data source is here): <entry> <id>http://data.treasury.gov/Feed.svc/DailyTreasuryYieldCurveRateData(6794)</id> <title type="text"></title> <updated>2018-02-06T22:05:38Z</updated> <author> <name /> </author> <link rel="edit" title="DailyTreasuryYieldCurveRateDatum" href="DailyTreasuryYieldCurveRateData(6794

Deserialize XML object in T-SQL

自作多情 提交于 2020-01-10 02:05:50
问题 I've got an XML object. And I want to deserialize it into a table using T-SQL. <Params> <type = 1> <value> 10 </value> </type> <type = 2> <value> abc </value> </type> </Params> How can I store this data into a table like this: Thanks! 回答1: Your XML is not valid - but if you had something like this: <Params> <type ID="1"> <value> 10 </value> </type> <type ID="2"> <value> abc </value> </type> </Params> then you could use this XQuery / SQL statement to get what you're looking for: DECLARE @XML

XQuery unable to select attribute

本小妞迷上赌 提交于 2020-01-07 08:54:10
问题 For analyzing some data, I am currently trying to select an attribute in XQuery. Unfortunately, for some reason I can't select it. Considering the example document <myroot> <betweennode> <asd name="test"> <asdasd/> </asd> </betweennode> </myroot> the XPath /myroot/betweennode/asd/@name regulary returns test , the XQuery for $x in /myroot/betweennode/asd return $x returns <asd name="test"> <asdasd/> </asd> but the XQuery for $x in /myroot/betweennode/asd return $x/@name does not work (it

MarkLogic - XQuery - cts:element-range-query using variable length sequence or map

血红的双手。 提交于 2020-01-07 04:14:31
问题 I have a collection of 100,000 records structured like this: <record> <pk>1</pk> <id>1234</id> </record> <record> <pk>2</pk> <id>1234</id> </record> <record> <pk>3</pk> <id>5678</id> </record> <record> <pk>4</pk> <id>5678</id> </record> I have setup a range index on id. I want to write a query in XQuery that will allow me to pass in a variable length sequence or map of id's and get back out all the records with those id's. It needs to be such that I can pass in any number of id's. Also, it

how to extract an XPATH from an html page with Saxon-PE commandline

随声附和 提交于 2020-01-06 08:14:33
问题 I would like to extract the XPATH //DIV[@id="ps-content"] out from this web page: http://www.amazon.com/dp/1449319432 (saved as a local file) I would like to do it with a single line of command-line with one of the best parsers, like Saxon-PE or BaseX. So far the shortest solution that I (seemed to have) found is with these two lines: java -jar tagsoup-1.2.1.jar <page.html >page.xhtml" java -cp saxon9pe.jar net.sf.saxon.Query -s:"page.xhtml" -qs:"//DIV[@id='ps-content']" but all what it

how to extract an XPATH from an html page with Saxon-PE commandline

依然范特西╮ 提交于 2020-01-06 08:14:12
问题 I would like to extract the XPATH //DIV[@id="ps-content"] out from this web page: http://www.amazon.com/dp/1449319432 (saved as a local file) I would like to do it with a single line of command-line with one of the best parsers, like Saxon-PE or BaseX. So far the shortest solution that I (seemed to have) found is with these two lines: java -jar tagsoup-1.2.1.jar <page.html >page.xhtml" java -cp saxon9pe.jar net.sf.saxon.Query -s:"page.xhtml" -qs:"//DIV[@id='ps-content']" but all what it

eXist-db / XSLT / Saxon collection() slow as molasses (or errors out with memory limit)

泪湿孤枕 提交于 2020-01-06 05:36:08
问题 Coming from this question, I managed one entirely unsatisfactory solution for accessing an eXist-DB collection() from an XSLT 2.0 document loaded from within an eXist-db/Xquery transformation function: The XSLT file declares a variable : <xsl:variable name="coll" select="collection('xmldb:exist:///db/apps/deheresi/data/collection_ms609.xml')"/> This points to a catalog xml file I created (per Saxon documentation) that looks like this, in order to load the actual collection: <collection stable

Delete xml node from SQL Server 2008 r2 table column based on attribute value

自作多情 提交于 2020-01-06 04:00:26
问题 I have an xml structure as follows <DifficultyRule xmlns="urn:gjensidige:processguide:201201"> <Id>fc39f423-05c0-4de9-ae46-12fe3c0c279b</Id> <Code>5595e558-7d10-4767-86dc-5d16f24b8151_Code</Code> <Author /> <Updated>9/5/2012</Updated> <Sequence>0</Sequence> <FromControls> <Control> <Code>oiuyui</Code> <Id>70579cbe-c0b5-4b49-a7b8-6201af388f59</Id> <FilterValues> <FilterValue xmlns:p5="urn:gjensidige:processguide:201201" p5:Id="b897f3ac-b40f-4b96-b438-eb156a26457e" p5:Code="e" p5:LookupId=

BaseX get line-breaks return between node-data

ぃ、小莉子 提交于 2020-01-06 03:23:50
问题 I'm using BaseX as my XML based DB. I make a simple query like xquery for $Book in /Libraray/Literaturelist/Literature/Title return fn:data($Book) I get all titles, just as a String that has got no line breaks. Is there a way to add line-breaks with XQuery after each node found by the query to separate the data? This is not really dependant on my XML file because I do not add line-breaks hardcoded within the tags. ;) 回答1: it depends on how you retrieve the query results. The most elegant way