read xml
I need to read the xml file and get the attribute value
<?xml version="1.0" encoding="UTF-8"?>
<SOURCE>
<Paragraph ParaNumber="Pg_1_P_3"/>
<Paragraph ParaNumber="Pg_1_P_4"/>
</SOURCE>
var outmyf=Folder.selectDialog("Choose Out folder path");
var FilePath=new File(outmyf+"/PageNumber.xml");
//alert (FilePath)
var xmlFile = new File(FilePath);
if(xmlFile.exists)
{
var xmlFileOpenFlag = xmlFile.open("r");
if(xmlFileOpenFlag == true)
{
var xmlFileContents = xmlFile.read();
var root = new XML(xmlFileContents);
var Pageno = root.xpath("/SOURCE/Paragraph[@ParaNumber]");
}
}
But I need only the attribute value of the xml element the above code returning all the values.
