How to delete data from xml file which is older than 24 hours in node js?

I want to delete a specific data which is older than 24 hours from this xml sheet. How to do it from node js. This is my xml sheet

<?xml version='1.0' encoding="UTF-8"?> <urlset     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"     xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"      xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd http://www.google.com/schemas/sitemap-image/1.1 http://www.google.com/schemas/sitemap-image/1.1/sitemap-image.xsd"     xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">   <url>     <loc>https://localhost:5000/westbengal/a1</loc>     <lastmod>2020-14-07T15:07</lastmod>     <image:image>         <image:loc>https://bengali.nenow.in/node/uploads/2020/06/A2.jpg</image:loc>         <image:caption>a1</image:caption>     </image:image> </url>  <url>     <loc>https://localhost:5000/westbengal/a2</loc>     <lastmod>2020-05-07T15:07</lastmod>     <image:image>         <image:loc>https://bengali.nenow.in/node/uploads/2020/06/A3.jpg</image:loc>         <image:caption>a2</image:caption>     </image:image> </url> </urlset> 

Here want to remove a node where lastmode=2020-05-07T15:07

Asked on July 16, 2020 in Mongodb,   XML.
Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.