xquery

Using XPath, How do I select a node based on its text content and value of an attribute?

Given this XML: <DocText> <WithQuads> <Page pageNumber="3"> <Word> July <Quad> <P1 X="84" Y="711.25" /> <P2 X="102.062" Y="711.25" /> <P3 X="102.062" Y="723.658" /> <P4 X="84.0" Y="723.658" /> </Quad> </Word> <...

How to train programmers in Oracle XML technology

Hi. I'm part of a team of clinical data programmers. We're taking on new responsibilities for loading and manipulating XML data in Oracle (specifically clinical and electronic medical record data). We don't have a lot of history with XML, XQuery, or Oracle XML services. What specific suggestions would you have for training our team? Our...

Why does OPENXML seem to perform better than XQuery in this case?

I wrote the script below in order to test the performance difference between OPENXML and the newer functions available for the XML datatype in SQL Server 2005. When I run the script (with the option to include the actual execution plan), the results were strange. The execution plan said that the cost of the first query (using OPENXML) ...

Hints on implementing XQuery full-text search using Lucene

I've used Lucene on a previous project, so I am somewhat familiar with the API. However, I've never had to do anything "fancy" (where "fancy" means things like using filters, different analyzers, boosting, payloads, etc). I'm about to embark on implementing the full-text search feature of XQuery: http://www.w3.org/TR/xpath-full-text-10...

How to transpose a XML table with T-SQL XQuery?

Let's say we have the following XML: <root> <row> <column>row 1 col 1</column> <column>row 1 col 2</column> <column>row 1 col 3</column> </row> <row> <column>row 2 col 1</column> <column>row 2 col 2</column> <column>row 2 col 3</column> </row> <row> <column>row 3 col 1</column> <column>row 3 col...

Xquery support in IntelliJ Idea?

Has anyone had any success developing XQuery in IntelliJ? Specifically, does anyone know of any code completion or code syntax highlighting abilities that exist already or that you've built? ...

XQuery - remove nodes based on its sub element being in the "ban" list

I am a total noob with XQuery, but before at start digging deep into it, i'd like to ask some experts advice about whether i am looking at the correct direction. The problem: A huge xml file which contains a whole lot of users and their access information (password access rights and so on) example below: <user> <name>JC1234</name> ...

No results with QXmlQuery

I'm getting really fustrated with this... With this simple xml: <?xml version='1.0'?> <root> <data>hello</data> </root> And this code QXmlQuery xquery; xquery.setQuery( "doc('config.xml')//data" ); if( xquery.isValid() ) { QXmlResultItems itemResult; xquery.evaluateTo( &itemResult ); QXmlItem item( itemResult.next() ); wh...

XQuery library under Python.

Hey Is there any existing way to run XQuery under python? (not starting to build a parser yourself in other words). I got a ton of legacy XQuery that I want to port to our new system, or rather I want to port the framework and not XQuery. Therefore: Is there any library that allows me to run XQuery under python? ...

How to group elements by attribute values using XQuery on SQL Server?

Let's say I have a table in SQL Server which contains the results of a query with an inner join. The following XQuery: select @code.query ( 'for $s in /root/row return <Foo Language="{data($s/@lang)}" Method="{data($s/@method)}" Returns="{data($s/@returnType)}"> <Bar ReferencedBy="{data($s/@callers)}" Static="{data($s/@static)}" /> </...

Using XQuery/XPath to get the attribute value of an element's parent node

Given this xml document: <?xml version="1.0" encoding="UTF-8"?> <mydoc> <foo f="fooattr"> <bar r="barattr1"> <baz z="bazattr1">this is the first baz</baz> </bar> <bar r="barattr2"> <baz z="bazattr2">this is the second baz</baz> </bar> </f...

Bind a chunk of preformatted XML to an external variable in xquery in QtXmlPattern.

I use QT xmlpatterns in XQuery mode to implement templates. The template is an QXmlQuery object and the variables are filled-in using bindVariable(). So far the variables were strings and everything worked fine. Now, I want to inser preformated chunks of XML into the template. I would like to create a piece of xml in C++ using QXmlStr...

Execute a XQuery with PHP

Hi, How to execute a XQuery in PHP? Can you give me an example? Thank you. ...

what's wrong in this code (xquery)

xquery version "1.0"; declare function con($s1 as xs:anyAtomicType, $s2 as xs:anyAtomicType) as xs:string { return concat($s1, $s2 ) }; declare variable $str1 as xs:string:="samah"; declare variable $str2 as xs:string:="sama"; declare variable $comstring:=con($str1 ,$str2 ); {$comstring } ...

XSL: Assigning the result of position() to a variable

I am trying to assign the position of an element like this: <xsl:variable name="offset" select="ancestor::myparent/position() * 8"/> I am trying to show the result of the calculation in the output, so using a selector is not enough. xsltproc generates the following error: XPath error : Invalid expression ancestor::myparent/position()...

XQuery regexp error

Why next code returns true (Saxon-EE 9.2 for .NET)? matches('some text>', '^[\w ]{3,200}$') There is no > symbol in the pattern. Thanks. XQuery: <regexp-test> <!-- why true? --> <test1>{matches('some text>', '^[\w ]{3,200}$')}</test1> <test2>{matches('some text>', '^[\w ]+$')}</test2> <test3>{matches('&lt; < >', '^[\...

Using XQuery in SQL Server 2008 to search for content

Hi, Take the following 4 example XML documents: <Example> <Colour>orange</Colour> </Example> <Example> <Car colour="orange">Ford Focus</Car> </Example> <Example> <County>Orange County</County> </Example> <Example> <Orange>555</Orange> </Example> These are all stored in a SQL Server database in a table...

Bind a Java Collection to xQuery sequence from xQuery

declare function Error:toString($this as javaObject) as xs:string external; the previous binds a return String() to xs:string. is it possible to return a collection and bind it to an xQuery Sequence, say the following declare function Error:toList($this as javaObject) as squenceType external; so that it can be run through a flwr? ...

Is it possible to add a parameter to the request header in xquery?

xdmp:get-request-field() allows fields to be retrieved from the request, but is there a way to add a field ala add-request-field() or the like? ...

XQuery formatting tool

I need a tool for reformatting (indenting, long line split) of xquery scripts. My script started very small but now is almost 4000 lines long and quite messy and needs refactoring. Can someone help? ...