Sign Up
Search
Options
search
Chat
Help
News
Log in
Not Logged in
Home
»
Boards
»
Stylus Studio Developer Network
»
XQuery Help and Discussion
»
xquery - question for count function
Topic
Prev Topic
Next Topic
next
Subject:
xquery - question for count function
Author:
Jimmy Wu
Date:
30 May 2007 12:25 AM
Hi can anyone tell me how to find out the number of text that apears in a xml document?
for example in this xml document
<project>
<row>
<id>P1</id>
<name>Project 1</name>
<members>Mary, Alan</members>
<fundings>Fund3, fund1</fundings>
</row>
<row>
<id>P2</id>
<name>Project 2</name>
<members>Mary</members>
<fundings>Fund2,Fund3</fundings>
</row>
<row>
<id>P3</id>
<name>Project 3</name>
<members>Mary</members>
<fundings>Fund2,Fund1</fundings>
</row>
</project>
i want to find out the number of Fund2 appears in this file
so the number i wanna get is 2
can anyone help me with it? please.....
next
Subject:
xquery - question for count function
Author:
Ivan Pedruzzi
Date:
30 May 2007 01:06 AM
declare variable $in :=
<project>
<row>
<id>P1</id>
<name>Project 1</name>
<members>Mary, Alan</members>
<fundings>Fund3, fund1</fundings>
</row>
<row>
<id>P2</id>
<name>Project 2</name>
<members>Mary</members>
<fundings>Fund2,Fund3</fundings>
</row>
<row>
<id>P3</id>
<name>Project 3</name>
<members>Mary</members>
<fundings>Fund2,Fund1</fundings>
</row>
</project>;
count($in//*[contains(text(), "Fund2")])
Ivan Pedruzzi
Stylus Studio Team
top
Subject:
xquery - question for count function
Author:
Jimmy Wu
Date:
31 May 2007 01:46 AM
thank you very much! :)
Prev Topic
Next Topic
Powered by
Stylus Studio
, the world's leading
XML IDE
for
XML
,
XSLT
,
XQuery
,
XML Schema
,
DTD
,
XPath
,
WSDL
,
XHTML
,
SQL/XML
, and
XML Mapping
!
Go to Conference:
Select Conference
Stylus Studio Feature Requests
Stylus Studio Technical Forum
Website Feedback
XSLT Help and Discussion
XQuery Help and Discussion
Stylus Studio FAQs
Stylus Studio Code Samples & Utilities
Stylus Studio Announcements
go
Log In Options
Username:
Password:
Site Map
|
Privacy Policy
|
Terms of Use
|
Trademarks
Stylus Scoop XML Newsletter:
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.