xquery

what is jquery and xquery

what is the best place to learn these ...

DB2 and XMLQuery

I have written the following query SELECT Specie, XMLCAST( XMLQUERY('declare default element namespace\"http://zoo.org\"; count(/diary/entry[@kind_type="@serious"])' ) AS INTEGER ) FROM Species; The schema for a diary is <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:z="http://zo...

XQuary adding or replacing attribute in single SQL update command

I have a Table with an XML column, I want to update the xml to insert attribute or to change the attribute value if the attribute already exists. Let's say the starting xml is: < d /> Inserting: UPDATE Table set XmlCol.modify('insert attribute att {"1"} into /d[1]') Changing: UPDATE Table set XmlCol.modify('replace value of /d[1]/...

change value of element by xquery

Hi I have structure <category> <catid>1</catid> <cattext> sport </cattext> </category> I want change text of element <cattext> into another like "art" instead of sport by using xquery ...

Xquery finding duplciate IDs

I have an XML database which contains elements which have an id. These are all unique. They also have a secondary identifier which links them to a similar object in another database. These are not all unique. Is there an XQuery which would let me identify all the non-unique IDs? I can count how many there are using distinct-values(), bu...

How can I use xpath querying using R's XML library?

The xml file has this snippet: <?xml version="1.0"?> <PC-AssayContainer xmlns="http://www.ncbi.nlm.nih.gov" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:schemaLocation="http://www.ncbi.nlm.nih.gov ftp://ftp.ncbi.nlm.nih.gov/pubchem/specifications/pubchem.xsd" > .... <PC-AnnotatedXRef> <PC-AnnotatedXRef_x...

Parsing xml file using xpath and xquery

I have a xml file <category> <type name="SWEATERS"> <product id =1> <itemNumber>1</itemNumber> <name>ProductA2</name> <price>345</price> </product> <product id=2> <itemNumber>4</itemNumber> <name>Product Test </name> <price>456</price> ...

Comparison operations on xs:boolean in SQL Server 2005

Can anyone explain to me the results of this query: declare @xml xml; set @xml = '<node attribute="true">Val</node>'; select T.c.query('xs:boolean(@attribute[1])') Value, T.c.query('xs:boolean(@attribute[1]) = false') ValueEqualsFalse, T.c.query('xs:boolean(@attribute[1]) = true') ValueEqualsTrue, T.c.query('xs:boolean(...

Parsing xml file using xpath and xquery

I have a xml file <category> <type name="SWEATERS"> <product id =1> <itemNumber>1</itemNumber> <name>ProductA2</name> <price>345</price> </product> </type> <type name="PANTS"> <product id=2> <itemNumber>4</itemNumber> <name>Product Test </name>...

Use XQuery library modules dynamically with Java

With XQuery you can use library modules within your query. They can be imported via import module namespace mynamespace = 'com.mynamespace' at 'filename.xq'; The question is: is there a way to determine which file is associated with the module namespace so that the programmer can decide dynamically? For example, my dynamic configura...

Manipulating the xml column in sql server using Xquery.

Hi All, I am storing an xml file in the xml datatype in table of SQL Server. Now I want to fetch some fragments (using xquery) and then update the fragments with the modified fragments (using xquery). I need some suggestions. I have the code to delete a node and it is as below but while deleting I need to insert the modified node at th...

How do I choose parent node attribute and its child values using XML and Xquery?

I have this: <pss> <ps n="А parent node" m="654564654" t="435,8551" a="2857,2716"> <sc s="a1" a="25,4220"/> <sc s="a2" a="0"/> <sc s="a3" a="2395,9945"/> </ps> ... </pss> I need to select "А parent node m attribute and a1-a2 a values in one query. i tried this but it doesnt work: SELECT ps.value('@m', 'nvarchar(50)...

Using a variable in a SQL Server 2005 stored procedure with XQuery

I'm working with the following XML <AEDControl ControlGU="17fed98c-8128-4c6b-9b50-3dbe73889b9d" ControlLabel="Posting Status" TypeGU="6b4d08b1-6340-450c-beae-517b7d84e717" ControlDescription=""> <Elements> <Element ElementGU="2da346d1-2e05-4aa3-9bae-5aa9b3b75d5c" Label="Active" ...