[MarkLogic Dev General] Is there a problem with xdmp:unpath

2012-05-04 Thread Darin McBeath
If my  'unpath'  that contains a predicate, I get an error.

For example, 


This will work,

xdmp:unpath($x/doc/item/itemid)

but this will not:


xdmp:unpath($x/doc/item/itemid[@idtype='VAL'])

I looked at the bug history (and fixed bugs) and didn't notice anything related 
to unpath.

Curious if anyone else has noticed this, whether I'm doing something wrong, is 
there a workaround, etc.

Thanks.

Darin.
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Is there a problem with xdmp:unpath

2012-05-04 Thread Ryan Dew
The second example doesn't provide a proper input. xdmp:unpath only handles
predicates dealing with position, for example  xdmp:unpath($x/doc/item/
itemid[2]).  In order to do something like what you want to you would need
to use xdmp:value, but be careful as that could open holes for XQuery
injection if user input is being used for the string you are passing to
xdmp:value.

-Ryan Dew

On Fri, May 4, 2012 at 12:13 PM, Darin McBeath ddmcbe...@yahoo.com wrote:

 If my  'unpath'  that contains a predicate, I get an error.

 For example,

 This will work,

 xdmp:unpath($x/doc/item/itemid)

 but this will not:

 xdmp:unpath($x/doc/item/itemid[@idtype='VAL'])

 I looked at the bug history (and fixed bugs) and didn't notice anything
 related to unpath.

 Curious if anyone else has noticed this, whether I'm doing something
 wrong, is there a workaround, etc.

 Thanks.

 Darin.

 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general