Hi Paul,

 

I don't see any real problem with relatively large if/then/else
expressions, if your logic requires it.  They usually perform quite well
(I'm not sure how big "rather large" is).  I suppose you could encode
the logic into an XML structure and use XPath to get to perform your
tests, as you stated.  Or some other method.  Depending on what you are
doing, however, I am not sure that will help or hinder.   Unless you are
running into some problems, it is mainly a matter of style.  

 

-Danny  

 

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Paul M
Sent: Thursday, December 13, 2007 8:32 AM
To: [email protected]
Subject: [MarkLogic Dev General] if then else

 

    if ($action = "update")
    then       dis:update($params)
    else if ($action = "delete")
        then dis:delete($params)

I have basically a "controller" in xqy that "loads" specific page to
display depending on the action.
It is a rather large if-then-else stmt.  Any ideas on  altering this
structure. Could I put it in a element node()?

This could allow:
let $content := ??? $actions/[EMAIL PROTECTED] = "update]/[EMAIL PROTECTED]

Or replace with typeswitch somehow - not sure since every type is a
string?

 

________________________________

Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try
it now.
<http://us.rd.yahoo.com/evt=51733/*http:/mobile.yahoo.com/;_ylt=Ahu06i62
sR8HDtDypao8Wcj9tAcJ%20> 

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

Reply via email to