|
Are you looking for this?
if(string-join($in-xml//*/string())="") then 'all empty' else 'not empty‘
Maybe you can trim the string, if you say a space is empty too.
Von: <[email protected]> im Auftrag von "Kapoor, Pragya" <[email protected]>
Antworten an: MarkLogic Developer Discussion <[email protected]> Datum: Montag, 18. April 2016 um 12:07 An: MarkLogic Developer Discussion <[email protected]> Betreff: [MarkLogic Dev General] Xquery : Empty Content
Hi,
I have an xml :
let $in-xml :=
<in-xml>
<a></a>
<b/>
<c></c>
<d><X></X></d>
<e></e>
<f></f>
<g></g>
</in-xml>
Now, how can I check if the content of all the elements and there child elements in $in-xml are empty(no content)?
if(content is empty) then "do this" else "do this"
Thanks Pragya
|
_______________________________________________ General mailing list [email protected] Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general
