Yeah, thanks to all of you, colleagues, the problem has resolved. It was the 
weird special character within XML file that stopped the query from getting the 
right results. Almost what you've been speaking about, David, thanks for 
showing the right direction!

Van

-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of David Sewell
Sent: Friday, December 04, 2009 9:13 PM
To: General Mark Logic Developer Discussion
Subject: Re: [MarkLogic Dev General] Matching ampersand in 4.1

I also checked this earlier today and couldn't reproduce the problem.

I always suspect possible whitespace issues when a string equality test doesn't 
produce expected results. If 'Radiology & Ultrasound'
contains any newlines in the data file, or if an apparent ASCII space is 
something else (nonbreaking space for example), the equality test will return 
false.

On Fri, 4 Dec 2009, Michael Blakeley wrote:

> I tried to reproduce this with 4.1-3 (linux x86-64) and didn't see a problem.
> Here's my test case:
>
> xquery version "1.0-ml";
> xdmp:document-insert(
>   '/data/store/items/test',
> <root>
>   <item type="title">Radiology &amp; Ultrasound</item> </root>
> )
> => ()
>
> xquery version "1.0-ml";
> xdmp:directory('/data/store/items/', 'infinity')
>   //it...@type='title'][. = 'Radiology &amp; Ultrasound'] => <item 
> type="title">Radiology &amp; Ultrasound</item>
>
> That's exactly what I'd expect to see. So I don't think the problem is 
> due to ampersand handling in the broadest sense, but there might be 
> something narrower going on. Perhaps you can try this test case 
> yourself, and narrow down on the difference between it and what you have 
> observed?
>
> -- Mike
>
> On 2009-12-04 00:41, Baranov, Ivan - Moscow wrote:
> > Hi All,
> >
> > I’ve encountered a problem while moving from 3.2 to 4.1. It seems 
> > like XQuery dialect 1.0-ml is handling ampersand slightly different from 
> > 0.9-ml.
> >
> > Suppose I have the file:
> >
> > <root>
> >                  <item type=”title”>Radiology&amp; Ultrasound</item> 
> > </root>
> >
> > Located in /data/store/items/
> >
> > I am writing a simple query just to illustrate the problem:
> >
> > xdmp:directory(“/data/store/items/”, 
> > “infinity”)//it...@type=’title’][. = ‘Radiology&amp; Ultrasound’]
> >
> > Under 3.2 it returns me the<item>  node. Great! But under 4.1 I just 
> > get the empty sequence (replacing&amp; with&#38; gives no effect). 
> > So could anyone please suggest another idea of matching 
> > ampersand-containing strings in 4.1 environment?
> >
> > Thanks in advance,
> > Van
> >
>
>
> _______________________________________________
> General mailing list
> [email protected]
> http://xqzone.com/mailman/listinfo/general
>

--
David Sewell, Editorial and Technical Manager ROTUNDA, The University of 
Virginia Press PO Box 801079, Charlottesville, VA 22904-4318 USA
Courier: 310 Old Ivy Way, Suite 302, Charlottesville VA 22903
Email: [email protected]   Tel: +1 434 924 9973
Web: http://rotunda.upress.virginia.edu/
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to