xquery

LPX-00607 for ora:contains in java but not sqlplus

Hi I am trying to doing some SQL queries out of Oracle 11g and am having issues using ora:contains. I am using Spring's JDBC implementation and my code generates the sql statement: select * from view_name where column_a = ? and column_b = ? and existsNode(xmltype(clob_column), 'record/name [ora:contains...

How does one iterate over a sequence in xquery by twos?

I want to iterate over a sequence in xquery and grab 2 elements at a time. What is the easiest way to do this? ...

Sum of XML duration elements in SQL2008

I have a XML column that holds information about my games. Here's a sample of the information looks like. <game xmlns="http://my.name.space" > <move> <player>PlayerA</player> <start movetype="Move">EE5</start> <end movetype="Move">DF6</end> <movetime>PT1S</movetime> </move> <move> <player>PlayerB</player> <start ...

Help installing Zorba (XQUERY) PHP Extension on windows

Hi, I'm trying to install zorba php extension on windows and I am having all sorts of problems. I have installed the zorba binaries on my computer, but when I try to install the PECL package (pecl install zorba-alpha) I get the following error "ERROR: the DSP zorba.dsp does not exist". I've tried searching for zorba_api.dll or zorba_ap...

Qt XQuery into a QStringList

Hi, I'm trying to use QtXmlQuery to extract some data from XML. I'd like to put this into a QStringList. I try the following: QByteArray in = "this is where my xml lives"; QBuffer received; received.setData(in); received.open(QIODevice::ReadOnly); QXmlQuery query; query.bindVariable("data", &received); query.setQuery(NAMESPACE //conta...

How to indicate 'missing' tags in XQuery?

I have an XML file: $xml := <xml> <element> <text>blahblah</text> </element> <element> </element> <element> <text>blahblah</text> </element> </xml> I can use the query for $x in $xml/xml/element/text return string($x) This gives me a list ...

Difficulty getting Saxon into XQuery mode instead of XSLT

I'm having difficulty getting XQuery to work. I downloaded Saxon-HE 9.2. It seems to only want to work with XSLT. When I type: java -jar saxon9he.jar I get back usage information for XSLT. When I use the command syntax for XQuery, it doesn't recognize the parameters (like -q), and gives XSLT usage information. Here are some command ...

XQuery: Create a new element with a given name?

I have data like: <td>USERID</td> <td>NAME</td> <td>RATING</td> I want to transform it into: <userid></userid> <name></name> <rating></rating> How can I do this? ...

XQuery to get a list of all attributes an element has

Hi! Is there a generic way of determining all attributes (and their values) from an XML node using XQuery/XPath? thx, Alex ...

Auto increment with XQuery Update?

Does XQuery Update support auto increment attributes just like auto increment fields in SQL? I'm using BaseX as my database. ...

svg data visualizations

I'd like to experiment with SVG as a way of displaying data-driven graphs, charts, etc. The data exists as xml, and I'll use XQuery to produce the xml. What options (eg, graphics libraries) should I consider for creating the SVG from the xml? Many thanks. ...

Anyone knows any Linq to XQuery implementation ?

Hi all, the question is basically in the title. Also if anyone has started some kind of implementation but never finished it and is willing to share it, I'm interested! :) Or if it is being used internally in an open-source project... greetings, Tim ...

how to COPY Attribute value in a new attribute

How to copy data of attribute to new attribute in the same column in sql original data <root> <child attr='hello'></child> </root> Result 1 <root> <child attr='hello' attr2='hello'></child> </root> Result 2(with a modification) <root> <child attr='hello' attr2='**H**ello **W**orld'></child> </root> I want to do this only throu...

How to unencode escaped XML with xQuery

I have a variable in xQuery of type xs:string with the value of an encoded HTML snippet (the content of a twitter tweet). It looks like this: Headlines-Today &#8226; AP sources: &lt;b&gt;Obama&lt;/b&gt; pick for Justice post withdraws : News - Rest Of World - &lt;a href=&quot;http://shar.es/mqMAG&amp;quot;&amp;gt;http://shar....

shred xml with variable number of nodes

Hi, I have an xml column which contain data like this: <AuthorList CompleteYN="Y"> <Author ValidYN="Y"> <LastName>Alió</LastName> <ForeName>J L</ForeName> <Initials>JL</Initials> </Author> <Author ValidYN="Y"> <LastName>Ortiz</LastName> <ForeName>D</ForeName> <Initials>D</Initials> </Author> <Author ValidYN="Y"> <LastName>Muftuoglu</L...

Search relevance from XML docs (XQuery?) vs MySQL

Hello there, I have a website where documents are saved in xml documents, all with the same structure. I need a search engine where I am able to choose documents with the highest relevance according to the key words given by a searching user. I thought it could (?) be a good idea to have one using XQuery rather than having the informa...

shreding xml column

Hi, I have a XML column which contains XML like this: <Set> <Element> <ID> 1 </ID> <List> <ListElement> <Part1> ListElement 1 </Part1> </ListElement> <ListElement> <Part1> ListElement2 </Part1> </ListElement> </List> </Element> ...

How to convert an 8-bit integer into a binary string in xquery?

At work today, we threw together this attempt: xquery version "1.0"; declare option saxon:output "omit-xml-declaration=yes"; declare variable $x := 99; string-join( for $b in (128,64,32,16,8,4,2,1) let $xm := $x mod ($b*2) return if ( $xm >= $b ) then "1" else "0" , "") Do you have a better way? Takin...

How do I use QXmlQuery properly? (Qt XQuery/XPath)

I'm using the following code to load in an XML file (actually an NZB): QXmlQuery query; query.bindVariable("path", QVariant(path)); query.setQuery("doc($path)/nzb/file/segments/segment/string()"); if(!query.isValid()) throw QString("Invalid query."); QStringList segments; if(!query.evaluateTo(&segments)) throw QString("Unable ...

XML XQUERY Problem with NTEXT data type

Hello I want to use XQuery on a column of data type NTEXT (I have no choice!). I have tried converting the column to XML using CONVERT but it gives the error: Incorrect syntax near the keyword 'CONVERT'. Here's the query SELECT y.item.value('@UserID', 'varchar(50)') AS UnitID, y.item.value('@ListingID', 'varchar(100)') A...