Hi,

 

In code my directory is set to

File directory = new File("C:\\java_training\\com\\XMLtoExcel\\orm\\");

 

when parsing

public void generateExcel(ArrayList<String> array1) throws XPathExpressionException {

 

  //System.out.println("in generateexcel " +array1);

 

  for (int i = 0; i < array1.size(); i++) {

 

  try {

 

  HSSFWorkbook wb = new HSSFWorkbook();

  HSSFSheet spreadSheet = wb.createSheet("spreadSheet");

 

  System.out.println("in generateexcel " + array1.get(i));

  DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();

  DocumentBuilder builder = factory.newDocumentBuilder();

  Document document = builder.parse(array1.get(i));

  document.getDocumentElement().normalize();

 

 

When executing   Document document = builder.parse(array1.get(i)); returns the following error

IOException C:\java_training\com\XMLtoExcel\AccountBenefitActionSet.orm.xml (The system cannot find the file specified)

 

my directory structure is C:\java_training\com\XMLtoExcel\orm

but the parse does C:\java_training\com\XMLtoExcel\



Pleases can I know how to resolve this issue.



FacebookTwitterLinkedin
Pin It
Joomla Tutorials for Beginners