Merge pull request #15313 from yashodha/report_cleanup
[civicrm-core.git] / CRM / Core / CodeGen / Util / Xml.php
CommitLineData
5e434adf
ARW
1<?php
2
b5c2afd0
EM
3/**
4 * Class CRM_Core_CodeGen_Util_Xml
5 */
5e434adf 6class CRM_Core_CodeGen_Util_Xml {
518fa0ee 7
5e434adf 8 /**
6a0b768e
TO
9 * @param string $file
10 * Path to input.
5e434adf
ARW
11 *
12 * @return SimpleXMLElement|bool
13 */
00be9182 14 public static function parse($file) {
5e434adf 15 $dom = new DomDocument();
f9857c59
JP
16 $xmlString = file_get_contents($file);
17 $dom->loadXML($xmlString);
18 $dom->documentURI = $file;
5e434adf
ARW
19 $dom->xinclude();
20 $xml = simplexml_import_dom($dom);
21 return $xml;
22 }
96025800 23
5e434adf 24}