diff options
author | Erik Fonnesbeck <efonnes@gmail.com> | 2010-07-10 21:36:54 -0600 |
---|---|---|
committer | Erik Fonnesbeck <efonnes@gmail.com> | 2010-07-10 21:36:54 -0600 |
commit | 1fb064e86d12b5a70130e06e3748f345a534fb9b (patch) | |
tree | f62906496ef53a801ff103cbdcd189b4827786ce /etc/inc/xmlparse.inc | |
parent | 42f1649fbb4b90f6e2e1cfb78ab7b7acb744d776 (diff) | |
download | pfsense-1fb064e86d12b5a70130e06e3748f345a534fb9b.zip pfsense-1fb064e86d12b5a70130e06e3748f345a534fb9b.tar.gz |
Separate regdomain.xml parsing back to a separate file, so it can be used when xmlreader.inc is used instead of xmlparse.inc
Diffstat (limited to 'etc/inc/xmlparse.inc')
-rw-r--r-- | etc/inc/xmlparse.inc | 41 |
1 files changed, 1 insertions, 40 deletions
diff --git a/etc/inc/xmlparse.inc b/etc/inc/xmlparse.inc index 59b0eb4..7a9d7b8 100644 --- a/etc/inc/xmlparse.inc +++ b/etc/inc/xmlparse.inc @@ -59,28 +59,14 @@ function listtags_pkg() { return $ret; } -/* The following items will be treated as arrays in regdomain.xml */ -function listtags_rd() { - $ret = explode(" ", - "band country flags freqband netband rd " - ); - return $ret; -} - function startElement($parser, $name, $attrs) { - global $parsedcfg, $depth, $curpath, $havedata, $listtags, $parsedattrs, $parsingattrs; + global $parsedcfg, $depth, $curpath, $havedata, $listtags; array_push($curpath, strtolower($name)); $ptr =& $parsedcfg; - if (isset($parsingattrs) && !empty($attrs)) { - $attrptr =& $parsedattrs; - $writeattrs = true; - } foreach ($curpath as $path) { $ptr =& $ptr[$path]; - if (isset($writeattrs)) - $attrptr =& $attrptr[$path]; } /* is it an element that belongs to a list? */ @@ -94,19 +80,11 @@ function startElement($parser, $name, $attrs) { array_push($curpath, count($ptr)); - if (isset($writeattrs)) { - if (!is_array($attrptr)) - $attrptr = array(); - $attrptr[count($ptr)] = $attrs; - } - } else if (isset($ptr)) { /* multiple entries not allowed for this element, bail out */ die(sprintf("XML error: %s at line %d cannot occur more than once\n", $name, xml_get_current_line_number($parser))); - } else if (isset($writeattrs)) { - $attrptr = $attrs; } $depth++; @@ -180,23 +158,6 @@ function parse_xml_config_pkg($cffile, $rootobj, $isstring = "false") { return $cfg; } -function parse_xml_regdomain(&$rdattributes, $rdfile = '/etc/regdomain.xml', $rootobj = 'regulatory-data') { - global $listtags, $parsedattrs, $parsingattrs; - $listtags = listtags_rd(); - if (isset($rdattributes)) { - $parsedattrs = array(); - $parsingattrs = true; - $ret = parse_xml_config_raw($rdfile, $rootobj); - if ($parsedattrs[$rootobj]) - $rdattributes = $parsedattrs[$rootobj]; - unset($parsedattrs); - unset($parsingattrs); - return $ret; - } else { - return parse_xml_config_raw($rdfile, $rootobj); - } -} - function parse_xml_config_raw($cffile, $rootobj, $isstring = "false") { global $depth, $curpath, $parsedcfg, $havedata, $listtags; |