using Count function

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ambika_se
    New Member
    • Jun 2006
    • 2

    using Count function

    hi all
    I need a help to use count function. I want to make a query in which i want to search for some keyword
    so the query i made was
    Code:
    for $x in doc("file:///C:/Package1.xml")//Package
    where $x//node()[contains(.,"Science"))]
    return $x
    It works fine. But now i want to know how much times the word Science apperared in the XML.
    can i use funtion count here
    I changed the query to
    Code:
    for $x in doc("file:///C:/Package1.xml")//Package
    where $x//Count(node()[contains(.,"Science"))])
    return $x

    But it does not work . Can u please help me to solve this problem.
    Thanks
    regards
    Last edited by Dormilich; Jan 21 '09, 11:56 AM. Reason: added [code] tags
Working...