Hi Pragya,

I think we can test normalize-space here like below:-

 let $in-xml :=
(<in-xml>
   <a></a>
   <b/>
   <c></c>
   <d><X></X></d>
   <e></e>
   <f></f>
   <g></g>
</in-xml>)

return (if ($in-xml*[normalize-space() = '']*) then ("Empty In-XML") else
("Not Empty"))

Regards,
Vishnu

On Mon, Apr 18, 2016 at 3:37 PM, Kapoor, Pragya <pkapo...@innodata.com>
wrote:

>
> 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
> "This e-mail and any attachments transmitted with it are for the sole use
> of the intended recipient(s) and may contain confidential , proprietary or
> privileged information. If you are not the intended recipient, please
> contact the sender by reply e-mail and destroy all copies of the original
> message. Any unauthorized review, use, disclosure, dissemination,
> forwarding, printing or copying of this e-mail or any action taken in
> reliance on this e-mail is strictly prohibited and may be unlawful."
>
> _______________________________________________
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>


-- 
Vishnu Singh | http://marklogicgd.blogspot.in/
_______________________________________________
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to