I have the following XML file:
<?xml version="1.0" encoding="UTF-8"?>
<contentSet>
<inlineXML contenttype="application/xhtml+xml" xml:lang="en">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title/>
</head>
<body>
<p>EDITORS PLEASE NOTE, RESENDING TO CHANGE CERTAIN LOCATIONS FROM MOGADISHU, SOMALIA TO NAIROBI, KENYA.</p>
<p>Years of conflict, and the threat of al Qaeda-linked Islamists battling to overthrow the government, leave many Somalis dependent on aid. But an application called e-Shop has changed that dynamic says the World Food Programme.</p>
<p>SHOWS: MOGADISHU, SOMALIA (RECENT) (REUTERS - ACCESS ALL)</p>
<p>1. VARIOUS OF STOREKEEPER DISPATCHING ORDERS</p>
<p>2. MAN CARRYING ORDER TO A WAITING DELIVERY TRUCK</p>
<p>3. DELIVERY TRUCK ARRIVING AT AN IDP (INTERNALLY DISPLACED PERSONS) CAMP</p>
<p>4. MAN OFFLOADING DELIVERIES AS WORLD FOOD PROGRAMME (WFP) SUPERVISORS LOOK ON</p>
<p>5. VARIOUS OF MUSLIMA ABDIRAHMAN AND HER CHILDREN AT THEIR HOME</p>
<p>6. (SOUNDBITE) (Somali) MUSLIMA ABDIRAHMAN, E-SHOP USER, SAYING:</p>
<p>"It has become dangerous to go to the shops because we are afraid of catching the coronavirus. We were lucky to get this application. We enjoy online shopping; it also saves time and we get the food we want"</p>
<p>7. VARIOUS OF WFP TECHNICIAN HELPING A WOMAN MANAGE HER ACCOUNT ON THE "E-SHOP" APPLICATION</p>
<p>8. VARIOUS OF ILHAN MOHAMED GIVING BREAKFAST TO HER CHILDREN AT HOME</p>
<p>9. ILHAN PLAYING WITH HER BABY</p>
<p>10. (SOUNDBITE) (Somali) ILHAN MOHAMED, E-SHOP USER, SAYING:</p>
<p>"I order food that I need on the day such as rice or spaghetti. The delivery team brings the food to my home and the shop owner withdraws the money from my card."</p>
<p>NAIROBI, KENYA (RECENT) (REUTERS - ACCESS ALL)</p>
<p>11. VARIOUS OF CESAR ARROYO, COUNTRY DIRECTOR, WFP SOMALIA</p>
<p>12. (SOUNDBITE) (English) CESAR ARROYO, COUNTRY DIRECTOR, WFP SOMALIA:</p>
<p>“The e-Shop is a system that if it works in Somalia, it can work anywhere else. Somalia offers all the challenges that can actually be the testing ground for a system like this.”</p>
<p>MOGADISHU, SOMALIA (RECENT) (REUTERS - ACCESS ALL)</p>
<p>13. VARIOUS OF MUSLIMA AND ILHAN SITTING WITH THEIR CHILDREN UNDER A TREE</p>
<p>NAIROBI, KENYA (RECENT) (REUTERS - ACCESS ALL)</p>
<p>14. (SOUNDBITE) (English) CESAR ARROYO, COUNTRY DIRECTOR, WFP SOMALIA:</p>
<p>“Many years ago when we were handing food, the people accept the food but you could see in their body language how the dignity wasn’t there because when you are receiving food you are without the opportunity of discussing or challenge, you don’t have that strength and you can see the body language of these beneficiaries have changed now tremendously because now with the cash base assistance that we provide, they are the ones deciding where and what to buy.”</p>
<p>MOGADISHU, SOMALIA (RECENT) (REUTERS - ACCESS ALL)</p>
<p>15. E-SHOP REPRESENTATIVE SHOWING IDP HOW TO USE THE APP</p>
<p>16. VARIOUS OF PEOPLE AT IDP CAMP</p>
<p>17. CHILDREN AT THE CAMP</p>
<p>STORY: Muslima Abdirahman, a Somali mother of nine, escaped death twice in the past two years while shopping for groceries in the city of Mogadishu, where Islamist insurgents regularly carry out suicide bombings on busy streets and markets.</p>
<p>She traded the dangerous errand for online shopping earlier this year, thanks to the World Food Programme's "humanitarian e-commerce" system in Somalia -- part of its global shift from giving out food to cash.</p>
<p>Originally conceived as a way to protect women in Somalia from security threats -- be it bombings in the capital or harassment in a camp -- it is also helping avoid large crowds at aid distribution sites during the COVID-19 pandemic.</p>
<p>Abdirahman compares the prices of products like cooking oil and salt offered by retailers on an app called e-Shop created by WFP, spending the $60 stipend she receives from the agency as she sees fit. This frees time for working as a cleaner and childcare, she said.</p>
<p>"It has become dangerous to go to the shops because we are afraid of catching the coronavirus. We were lucky to have this application. We enjoy online shopping; it also saves time and we get the food we want."</p>
<p>Her neighbour Ilhan Adow, who also uses the WFP app, says she uses the hours she saves to breastfeed her children, do chores and rest.</p>
<p>"I order food that I need on the day such as rice or spaghetti. The delivery team brings the food to my home and the shop owner withdraws the money from my card," Adow said.</p>
<p>Though WFP launched e-Shop in 2018, it introduced home delivery in April, the month after COVID-19 hit Somalia.</p>
<p>Years of conflict, and the threat of al Qaeda-linked Islamists battling to overthrow the government, leave many Somalis dependent on aid.</p>
<p>But e-Shop has changed the dynamic, said Cesar Arroyo, head of WFP in the country.</p>
<p>“Years ago, when we were handing out food, people accepted it but you could see in their body language how the dignity wasn’t there,” he said. “Now…they are the ones deciding where and what to buy.”</p>
<p>Hundreds of retailers sell on the app. Transactions are recorded to comply with the government tax system. Purchases are verified on delivery using biometrics.</p>
<p>Six million dollars in transactions, and more than 51,000 deliveries, have gone through the system.</p>
<p>It operates in Mogadishu, including in camps for people forced from their homes by violence, and in all Somalia’s main towns.</p>
<p>WFP has long used electronic vouchers for distributing cash aid for Syrian refugees, but Somalia is the first place where it has used an app and home delivery system.</p>
<p>The U.N. agency, which won the Nobel Peace Prize this year, hopes to roll out online shopping elsewhere, said Arroyo. “If it works in Somalia it can work anywhere else.”</p>
<p>Nearly 100,000 out of the 500,000 people receiving cash aid monthly from the U.N. in Somalia are using e-Shop. The number of app users recently shot up, from 47,000 at the end of March, before home delivery launched, to 94,000 at the end of October.</p>
</body>
</html>
</inlineXML>
</contentSet>
I would like to retrieve everything in between <body>
and </body>
. I need to preserve the <p>
and </p>
.
Here's my XSL file:
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://iptc.org/std/nar/2006-10-01/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" exclude-result-prefixes="ns0 xs fn">
<xsl:output method="xml" encoding="UTF-8" byte-order-mark="no"/>
<xsl:template match="/">
<xsl:variable name="var1_map_of_newsMessage" as="xs:string*">
<xsl:for-each select="ns0:contentSet/ns0:inlineXML/ns1:html/ns1:body">
<xsl:sequence select="fn:string(.)"/>
</xsl:for-each>
</xsl:variable>
<xsl:variable name="body_content">
<xsl:sequence select="($var1_map_of_newsMessage)[(fn:position() = xs:integer('1'))]"/>
</xsl:variable>
<xsl:element name="body">
<xsl:value-of select="$body_content"/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
I get this when doing the translation: Unable to generate the XML document using the provided XML/XSL input. Errors were reported during stylesheet compilation
Any idea how I can achieve this? I looked everywhere and used Altova mapforce to help me but nothing seems to work. Thank you for taking the time to read my post.