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

If Statements within an If Statement?

Wei, Alice J. ajwei at indiana.edu
Thu Apr 3 06:33:05 PST 2008


  If Statements within an If Statement?
> That is exactly how I wanted it to read, although I am not sure how "white spaces" get in this picture.
>  The_tag,_maybe?

I'll show that string again but with space shown as _ and newline shown
as / so they are visible:


"/Send_10c_for_mailing_TODAY!/________________________________/Kenmore,_Mitford,_CR-272_N.H._03055//"


> I might have to try using declare boundary-space strip; Would this
> help?

It would make no difference in this case

You probably want to use

 distinct-values(normalize-space($seq))

and

$seq[normalize-space(.)=$d]

in which case the strings being compared would look like

"Send 10c for mailing TODAY! Kenmore, Mitford, CR-272 N.H. 03055"


I tried using this by changing the $sorted_result declaration to let

$sorted_result:=
for $doc in distinct-values(normalize-space($seq))
order by $doc

and do the similar thing like you suggested to the other lines

let $head := $seq[normalize-space(.)=$d][1]/ancestor::ad/descendant::head[1]
let $head2 := $seq[normalize-space(.)=$d][1]/ancestor::ad/descendant::head[2]
let $head3 := $seq[normalize-space(.)=$d][1]/ancestor::ad/descendant::head[3]
let $para := $seq[normalize-space(.)=$d][1]/ancestor::ad/descendant::p

This is what I got

The actual cardinality for parameter 1 does not match the cardinality declared in the function's signature: normalize-space($a as xs:string?) xs:string. Expected cardinality: zero or one, got 163.

Have I done something wrong?

Alice



Purchase Stylus Studio Online Today!

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.
Email
First Name
Last Name
Company
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-2007 All Rights Reserved.