public SlideShow parse(String aPathName) {
		if (Debug.parser)
			System.out.println("xmlPath"+aPathName);
		xmlPath = aPathName;
		xmlPath = xmlPath.replace('\\', '/');

		// get schema and xml files
		File inputFile = new File(aPathName);
		if (!inputFile.exists()) {
			System.out.println("Parser error: passed file does not exist");
			return null;
		}
		// create a parser
		SAXParserFactory factory = SAXParserFactory.newInstance();
		SAXParser saxParser;

		// parse files
		try {
			saxParser = factory.newSAXParser();

			mode = "getschema";
			saxParser.parse(inputFile, this);

			File schema = new File(schemaPath);
			if (Debug.parser)
				System.out.println("schemaPath"+schemaPath);
			// validate passed xml against schema
			if (!isValid(inputFile, schema)) {
				System.out.println("Validation error!");
				return null;
			}

			// get schema defaults
			mode = "schemadefs";
			saxParser.parse(schema, this);
			// overwrite schema defaults when redefined in xml
			mode = "xmldefs";
			saxParser.parse(inputFile, this);
			// get data
			mode = "parse";
			saxParser.parse(inputFile, this);
		} catch (Exception e) {
			// something went wrong
			e.printStackTrace();
			System.out.println("SAX Error! Unable to parse slideshow"
					+ e.getMessage());
			return null;
		}
		// sort slides into ascending order of id, name any slide with no name
		sortSlides();

		return (slideShow);
	}