|
Sini – I use string-join() and concat() in these situations:
string-join(($address, $postcode/concat('-', .), $city/concat(' ', .)), '')
-Will
From: sini narayanan <[email protected]>
Reply-To: MarkLogic Discussion <[email protected]> Date: Monday, May 6, 2013 5:50 AM To: MarkLogic Discussion <[email protected]> Subject: [MarkLogic Dev General] Appropriate method to check multiple conditions in Marklogic 6 Hi All,
I have few documents in my database and each document have the following three tags,
address, postCode and city.
All the three tags will not have values in all the documents. Certain might have only address and some others only postCode and city.
In total it would result in 9 conditions(with all the permutation and combinations).
(All node have values, none have values, only city node has value, only address and postCode have value, etc...)
After all these condition checks, the final output I need is
concat(address,"-",postcode," ",city)
Here I need to pass by the seperating characters (- and space), if a field is empty. I.e: If address is absent then the output should start with the postCode and not "-". Similarly for all other cases.
Please tell me an appropriate method to use this other than if() else().
Thanks,
Sini
|
_______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
