public static void main(String[] args) throws Exception
	{
		//String XML_FILE_NAME = "E:\\amitk\\stsworkspace\\yakstore\\target\\classes\\herd.xml";


		if(args==null || args.length !=2)
		{
			throw new IllegalArgumentException("Two arguments are required, fileName space day");
		}


		String fileName = args[0];
		int nthDay = 0;

		File file = new File(fileName);

		if(!file.exists()){
			throw new IllegalArgumentException("Xml file to parse does not Exists.");
		}


		String nthDayStr = args[1];

		try
		{
			nthDay = Integer.parseInt(nthDayStr);
		}
		catch(NumberFormatException e)
		{
			throw new IllegalArgumentException("2nd argument should be integer.");
		}

		System.out.println("fileName="+fileName+", nthDay="+nthDay);


		JAXBContext jaxbContext = JAXBContext.newInstance(Herd.class, LabYak.class);
		javax.xml.bind.Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
		Herd herd = (Herd) jaxbUnmarshaller.unmarshal(new File(fileName));



		/*ApplicationContext appContext = new ClassPathXmlApplicationContext("xml-config.xml");
		XmlParser converter = (XmlParser) appContext.getBean("XmlParser");
		Herd herd = (Herd)converter.convertFromXMLToObject(fileName,true);
		*/
		StringBuilder herdPrint = new StringBuilder(200);
		StringBuilder stockPrint = new StringBuilder(200);
		float ageOnNthDay=0.0f;
		float milkStockOnNthDay=0.0f;
		int noOfSkins = 0;
		float dayToBeAddedInAge = nthDay;

		for(Yak yak:herd.getYaks())
		{

			ageOnNthDay = yak.getAgeInYears() + (dayToBeAddedInAge/100);
			herdPrint.append(yak.getName()).append(" ").append(ageOnNthDay).append(" years old").append(System.lineSeparator());

			milkStockOnNthDay += yak.milkProducedOn(nthDay);
			noOfSkins += yak.getSkinsAvailable(nthDay);
		}

		stockPrint.append(milkStockOnNthDay).append(" liters of milk").append(System.lineSeparator()).append(noOfSkins).append(" skins of wool");

		System.out.println("In Stock:");
		System.out.println(stockPrint);
		System.out.println("Herd:");
		System.out.println(herdPrint);
	}