Tag: Flwor

Update duplicate xml attribute values to unique value
By Art on June 23, 2016

I was going through some really old blogging ideas and I stumbled over this one and seeing as I love finding creative solutions in XQuery, I’m not sure why I hadn’t got this down into a blog post earlier! Imagine the following contrived xml snippet which is essentially just a set of key/value pairs. At the moment the key names […]

Read More
XQuery – Accessing the Attributes Axis
By Art on December 19, 2014

Working with a sequence of attributes in XQuery is fairly straight forward with the ‘attribute’ axis even if you don’t know or need to know the attribute names. By using this axis you can access all of the attributes within the given context node. The specific scenario I had was to find a particular duplicated node within the xml that […]

Read More
Removing HTML formatting tag – BR – from XML using XQuery
By Art on October 31, 2013

This is a personal pet hate of mine.. Mixing HTML formatting tags directly with XML that aren’t escaped or contained within a CDATA section. Sure it is all perfectly valid XML at the end of the day, but it makes working with it a bit harder as each section of text between each <BR/> tag is treated as a separate […]

Read More
Retrieving the next or previous element node value in an Xml blob using XQuery
By Art on March 13, 2013

It’s been a little while since I wrote a blog post on my favourite subject but this is from a thread on the SSC Xml forum that I was helping out on a couple of weeks ago. I’ve been a bit busy lately with a big project at work, revising/taking exam 70-461 and getting ready for the birth of my […]

Read More
Using XQuery to remove duplicate values or duplicate nodes from an xml instance
By Art on December 31, 2012

Sometimes we need to retrieve a list distinct values from within an xml instance or even distinct nodes and this is relatively straight forward using XQuery. It gets a bit more complicated if you have attributes in the xml, but it is still possible to retrieve unique xml nodes. On the flip side, it is also possible to only return […]

Read More
Using XQuery to transform multiple xml nodes to a single xml node with comma separated string value
By Art on July 13, 2012

Not another comma separated string blog post I hear you say! I know that this topic has probably been done to death but I hope that this is a little different as it is about creating a single xml node containing a comma separated string from the values of multiple other xml nodes all within an XQuery expression. Recently I’ve […]

Read More