Yes, that is the current workaround I have. I was wondering if there was a 
"cleaner" way to put it all in a single sequence-type matching expression. 

Thanks, though!

-i


On Sep 10, 2013, at 4:33 PM, Danny Sokolsky <[email protected]> 
wrote:

> How about something like:
> 
> typeswitch ($x)
>  case element (foo) return if ($x/@bar) then do-something() else ()  
> ....
> 
> -Danny
> 
> 
> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of Ignacio Tripodi
> Sent: Tuesday, September 10, 2013 3:29 PM
> To: [email protected]
> Subject: [MarkLogic Dev General] Sequence-type matching on element AND 
> attribute
> 
> Hi team,
> 
> Is it possible to match, on a typeswitch expression, a particular element and 
> attribute name simultaneously? I know it's possible to match on either case:
> 
> typeswitch ($some_node)
>   case element(foo) return
>      (: do something :)
>   case attribute(bar) return
>      (: do something else :)
>   default return
>      (: fallback :)
> 
> ... but is there a way to match a case on specifically the node <foo 
> bar="test1">test2</foo>?
> 
> Thanks for any ideas you may provide!
> 
> -i
> 
> _______________________________________________
> General mailing list
> [email protected]
> http://developer.marklogic.com/mailman/listinfo/general
> _______________________________________________
> General mailing list
> [email protected]
> http://developer.marklogic.com/mailman/listinfo/general

_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to