xquery

insert/replace XML tag in XmlDocument

I have a XmlDocument in java, created with the Weblogic XmlDocument parser. I want to replace the content of a tag in this xmldocument with my own data, or insert the tag if it isnt there. <customdata> <tag1 /> <tag2>mfkdslmlfkm</tag2> <location /> <tag3 /> </customdata> I for example want to insert some url in the locati...

Querying XML columns in SQLServer 2005

There is a field in my company's "Contacts" table. In that table, there is an XML type column. The column holds misc data about a particular contact. EG. <contact> <refno>123456</refno> <special>a piece of custom data</special> </contact> The tags below contact can be different for each contact, and I must query these fragments along...

Best way to search data stored as XML in Sql Server?

Say I have data structures stored as XML (XML data type) within Sql Server. A user wishes to pull out a record if, within the data, a certain string is found. What are my options for implementing this, and which is the best way to do it? Note that each record can have different XML data structures ...

How can i search a non case sensitive word with Sql Server XQuery?

I'm using an Xml field in my Sql Server database table. I'm trying to search a word using the XQuery contains method but it seems to search only in case sensitive mode. The lower method isn't implemented on Sql Server XQuery implementation also. ¿Is there a simple solution to this problem? ...

Which is the best book to learn and understand XQuery?

Which is the best book to learn and understand XQuery for a beginner like me? Please note, I understand other XML technologies. It would be really good if the book gives reasoning behind decisions. Strengths and weaknesses of XQuery. When to use and when not to use XQuery? ...

how XQUERY is actually used?

I have been reading lot of XQUERY tutorial on the web site. Almost all of them are teaching me the XQUERY syntax. Let's say i have understood the XQUERY syntax, how am i going to actually implement XQUERY on my web site? For example, i have book.xml: <?xml version="1.0" encoding="iso-8859-1" ?> <books> <book> <title>Doraemon</title...

How do you switch on a string in XQuery?

I have an external variable coming in as a string and I would like to do a switch/case on it. How do I do that in xquery? ...

Using SQL Server 2005's XQuery select all nodes with a specific attribute value, or with that attribute missing.

Update: giving a much more thorough example. The first two solutions offered were right along the lines of what I was trying to say not to do. I can't know location, it needs to be able to look at the whole document tree. So a solution along these lines, with /Books/ specified as the context will not work: SELECT x.query('.') FROM @x...

Is there an XML XQuery interface to existing XML files?

My company is in education industry and we use XML to store course content. We also store some course related information (mostly metainfo) in relational database. Right now we are in the process of switching from our proprietary XML Schema to DocBook 5. Along with the switch we want to move course related information from database to XM...

How do you convert a string to a node in XQuery?

I would like to convert a string into a node. I have a method that is defined to take a node, but the value I have is a string (it is hard coded). How do I turn that string into a node? So, given an XQuery method: define function foo($bar as node()*) as node() { (: unimportant details :) } I have a string that I want to pass to the...

looking for Java GUI components / ideas for syntax highlighting

I'm not committed to any particular GUI tookit or anything - just needs to be Java based. I want to do simple syntax highlighting ( XML and XQuery ) inside editable text areas. My only candidate so far is Swing's JTextPane, as it supports seems to support the styling of text, but I have no idea how to implement it in this context. If a...

In SQL Server can I insert multiple nodes into XML from a table?

I want to generate some XML in a stored procedure based on data in a table. The following insert allows me to add many nodes but they have to be hard-coded or use variables (sql:variable): SET @MyXml.modify(' insert <myNode> {sql:variable("@MyVariable")} </myNode> into (/root[1]) ') So I coul...

java date format incompatible with xquery xs:date format, how to fix?

In java, when using SimpleDateFormat with the pattern: yyyy-MM-dd'T'HH:mm:ss.SSSZ the date is outputted as: "2002-02-01T18:18:42.703-0700" In xquery, when using the xs:dateTime function, it gives the error: "Invalid lexical value [err:FORG0001]" with the above date. In order for xquery to parse properly, the date needs to look like...

Using XQuery in Linq To SQL?

Let's say I have a table that has a column of XML type data. Within SQL, I can execute the following statement: select top 10 *, Content.value('(/root/item/value)[1]', 'float') as Value from xmltabletest where Content.value('(/root/item/MessageType)[1]', 'int') = 1 The result set contains only the records matching ...

Using XQUERY/Modify to replace a piece of my XML with value from varchar field

I have a table: MyTable config as XML title as varchar(255) In MyTable.config I have XML in the following structure: <configuration pagetitle="myConfig"> <column> <row> <component id="1" type="MyPiece" title="My Title" text="junk" /> </row> </column> </configuration> I need a script to inject the value of MyTa...

DOM like API for working with XQuery in Java

Hi, is there some open source Java API (ideally not GPL) for creating an object model from an XQuery string? thanks ...

Does XQuery (or XPath) have equivalents to Update, Insert, and Delete as well as Select?

I know how to find what I need from XML using XPath. The syntax takes a little getting used to, but it is quite powerful. I'm interested in learning XQuery also, but the SQL like syntax seems awkward. Even so, if it can provide not just a select equivalent, but also update, insert, and delete as SQL does, I will forgive all awkwardnes...

SQL Server 2000, "FOR XML AUTO" Query via http, Need "Content Length = 12345" in return XML Header

SQL Server 2000 Guru's, I've setup SQL 2000 to accept HTTP Queries i.e. http://74.22.98.66/MYDATABASE?sql={CALL+sp_XMLDATA}+&amp;root=root (ficticious url) It works great and returns the following XML via I.E.7 url - <?xml version="1.0" encoding="utf-8" ?> <root> <g c="15" /> <g c="8" /> <g c="19" /> </root> However I a...

XQuery to get list of attributes

If I have several Section elements in an XML document, what XQuery do I use to get a list of all the name values? <Section name="New Clients" filePath="XNEWCUST.TXT" skipSection="False"> ...

Zorba versus XQilla for XQuery

Hello, We're currently using the XQilla library to for XQuery support on a Windows platform, but we've had some issues with it (primarily memory manager conflicts between XQilla and Xerces). We're considering switching over to Zorba at some point. Has anyone here made this transition? I'd like to hear about any difficulties or improveme...