Page 1 of 1

Error: When building rowset data", the root element did not match in the file

Posted: Tue Sep 20, 2016 6:40 pm
by anutta78
Having error when reading XML.. please advise

My XML:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<ns0:Study xmlns:ns0="http://www.clientname.com/Site">
<ns0:StudyNum>XA123654</ns0:StudyNum>
<ns0:InformationContained>Full</ns0:InformationContained>
<ns0:StudyRowId>1-SETYE9</ns0:StudyRowId>
<ns0:ListOfSite>
<ns0:Site>
<ns0:SiteNum>12345</ns0:SiteNum>
<ns0:SiteName>University Name</ns0:SiteName>
<ns0:CountryCode>CA</ns0:CountryCode>
<ns0:SiteRowId>1-TYU7ER</ns0:SiteRowId>
</ns0:Site>
</ns0:ListOfSite>
</ns0:Study>
Project:
Code: Select all
<project name="xml to excel" mainModule="Main" version="2.0" logLevel="verbose">
	<module name="Main">
		<xmlRead file="\userdata\2016_part.xml" validation="none" processedInputFilesVariable="toExcel" version="1.0" logLevel="debug">
			<rowset name="data">
				<column index="1" value="/Study" />
				<column index="2" value="/Study/StudyNum" />
				<column index="3" value="/Study/StudyNum/InformationContained" />
				<column index="4" value="/Study/StudyNum/InformationContained/StudyRowId" />
                                 ....

			</rowset>
		</xmlRead>


		<writeExcel inputRowSetVariable="${data}" outputFile="\userdata\fromXML.xlsx" whenFileExists="overwrite" excelFormat="excel2007" includeHeadings="true" version="2.0" />

	</module>

</project>

error:
When building rowset "data", the root element did not match in the file

Re: Error: When building rowset data", the root element did not match in the file

Posted: Wed Sep 21, 2016 8:18 am
by Support_Rick
anutta78,

Please review your access paths to your XML Data. Should be something like the following:
Code: Select all
		<xmlRead file="\Temp\Test XML Data.xml"
		         validation="none"
		         processedInputFilesVariable="toExcel"
		         version="1.0"
		         logLevel="debug">
			<rowset name="data">
				<column index="1"
				        value="/ns0:Study/ns0:StudyNum"
				        name="StudyNum" />
				<column index="2"
				        value="/ns0:Study/ns0:InformationContained"
				        name="InformationContained" />
				<column index="3"
				        value="/ns0:Study/ns0:StudyRowId"
				        name="StudyRowID" />
			</rowset>
		</xmlRead>