[xquery-talk] Division in xQuery

Todd Ditchendorf itod at apple.com
Fri Jun 2 15:54:47 PDT 2006


/ is reserved for path expressions in XPath and XQuery.

For division, you want div or idiv

> return $blankCount div $totalCount

http://www.w3schools.com/xpath/xpath_operators.asp



Todd Ditchendorf
Software Engineer
itod at apple.com



On Jun 2, 2006, at 2:50 PM, Kusunam, Srinivas wrote:

> I have this xQuery
>
>
>
> let $totalCount :=  count($dffileid)
>
> let $blankCount   := count($refid)
>
>
>
> return $blankCount/$totalCount
>
>
>
> As you have noticed I can't use the return statement like above  
> because I get this error "It is a type error if the result of a  
> step (other than the last step) in a path expression contains an  
> atomic value". It does make sense then how can I achieve this  
> division?
>
>
>
> Also if I try using one of the Function Operator
>
>
>
>             numeric-divide($blankCount,$totalCount) I get ‘Unknown  
> function name "numeric-divide"’ in eclipse with <oXygen> plug-in.
>
>
>
>
>
> Thanks,
>
> Srinivas Kusunam
>
> 248-991-1044
>
>
>
> *****************************************************************
> This message has originated from RLPTechnologies,
> 26955 Northwestern Highway, Southfield, MI 48034.
>
> RLPTechnologies sends various types of email
> communications.  If this email message concerns the
> potential licensing of an RLPT product or service, and
> you do not wish to receive further emails regarding Polk
> products, forward this email to Do_Not_Send at rlpt.com
> with the word "remove" in the subject line.
>
> The email and any files transmitted with it are confidential
> and intended solely for the individual or entity to whom they
> are addressed.
>
> If you have received this email in error, please delete this
> message and notify the Polk System Administrator at
> postmaster at rlpt.com.
> *****************************************************************
> _______________________________________________
> talk at xquery.com
> http://xquery.com/mailman/listinfo/talk

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://xquery.com/pipermail/talk/attachments/20060602/605e648e/attachment.htm


More information about the talk mailing list