Hi @Partha Das ,
Welcome to Microsoft Q&A forum and thanks for reaching out here.
As per my understanding you are trying to validate your XML file against XSD and then copy data to your desired sink location. Please correct me if I'm wrong anywhere.
When I looked at the error message noticed that the schema validation is failing. And then I opened your XML file attached above in the question and noticed that XML file doesn't have XSD reference and hence the validation is failing as there no reference to your XSD in your XML file. Please see below (left side is your file data and right side what I updated referencing the XSD)
Resolution: Please add XSD reference in your XML file to validate schema. I have placed xsd in same location as xml file for testing. After adding XSD reference, your XML file will look like below:
<?xml version="1.0"?>
<books xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="books.xsd">
<book id="bk001">
<author>Writer</author>
<title>The First Book</title>
<genre>Fiction</genre>
<price>44.95</price>
<pub_date>2000-10-01</pub_date>
<review>An amazing story of nothing.</review>
</book>
<book id="bk002">
<author>Poet</author>
<title>The Poet's First Poem</title>
<genre>Poem</genre>
<price>24.95</price>
<review>Least poetic poems.</review>
</book>
</books>
The above will overcome your error message.
To your second question, in Copy activity mapping section, please configure as below so that data will be copied accordingly. First select the collection reference to $['books']['book']
and then click on Import Schemas
which will import the columns as shown below and map it to your desired destination columns and run the pipeline.
For testing I copied the data to a blob as txt file and sample looks like below:
Hope this helps.
Please don’t forget to Accept Answer
and Yes
for "was this answer helpful" wherever the information provided helps you, this can be beneficial to other community members.