[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message]

Find count of a string in an xml file

Mudita Nain muditanain at hotmail.com
Wed Jun 4 10:20:48 PDT 2008

  Find count of a string in an xml file

Hi all, I am using SQL Server 2005. I have a table with xml column in which I have loaded an XML file. I want to write an xquery which finds the number of occurrences of a string in the document in some defined tags. The structure of the document is as follows: <subject><displaySubject = "Day"><alt> </alt><alt> </alt><alt> </alt><alt> </alt></displaySubject></subject><subject><displaySubject><alt> </alt><alt> </alt><alt> </alt><alt> </alt></displaySubject></subject>  So, I want to find how many time the string "Day" occurs whether in displaySubject or alt anywhere in the document.Also, the "Day" string is not known. I want to find all the strings that occur more than 50 times in the document. I hope I am clear.I would appreciate any help from you. ThanksMudita
Instantly invite friends from Facebook and other social networks to join you on Windows Live™ Messenger.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://x-query.com/pipermail/talk/attachments/20080604/6e1e36a9/attachment.htm


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.