4 * @file classes/db/XMLDAO.inc.php
6 * Copyright (c) 2000-2009 John Willinsky
7 * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
12 * @brief Operations for retrieving and modifying objects from an XML data source.
15 // $Id: XMLDAO.inc.php,v 1.4 2009/04/08 21:34:54 asmecher Exp $
18 import('xml.XMLParser');
28 * Parse an XML file and return data in an object.
29 * @see xml.XMLParser::parse()
31 function &parse($file) {
32 $parser = new XMLParser();
33 $data =& $parser->parse($file);
39 * Parse an XML file with the specified handler and return data in an object.
40 * @see xml.XMLParser::parse()
41 * @param $handler reference to the handler to use with the parser.
43 function &parseWithHandler($file, &$handler) {
44 $parser = new XMLParser();
45 $parser->setHandler($handler);
46 $data =& $parser->parse($file);
52 * Parse an XML file and return data in an array.
53 * @see xml.XMLParser::parseStruct()
55 function &parseStruct($file, $tagsToMatch = array()) {
56 $parser = new XMLParser();
57 $data =& $parser->parseStruct($file, $tagsToMatch);