[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] property/inc class.boifc.inc.php
From: |
Sigurd Nes |
Subject: |
[Phpgroupware-cvs] property/inc class.boifc.inc.php |
Date: |
Tue, 09 Jan 2007 15:07:08 +0000 |
CVSROOT: /sources/phpgroupware
Module name: property
Changes by: Sigurd Nes <sigurdne> 07/01/09 15:07:08
Modified files:
inc : class.boifc.inc.php
Log message:
work in progress
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.boifc.inc.php?cvsroot=phpgroupware&r1=1.1&r2=1.2
Patches:
Index: class.boifc.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.boifc.inc.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- class.boifc.inc.php 2 Jan 2007 15:05:49 -0000 1.1
+++ class.boifc.inc.php 9 Jan 2007 15:07:08 -0000 1.2
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage ifc
- * @version $Id: class.boifc.inc.php,v 1.1 2007/01/02 15:05:49 sigurdne
Exp $
+ * @version $Id: class.boifc.inc.php,v 1.2 2007/01/09 15:07:08 sigurdne
Exp $
*/
/**
@@ -140,66 +140,27 @@
function import($values='',$ifcfile='')
{
_debug_array($ifcfile);
- // $data = file_get_contents ($ifcfile);
- $data = utf8_encode(file_get_contents ($ifcfile));
- // _debug_array($data);
- error_reporting(0);
+/* $xmltool =
CreateObject('phpgwapi.xmltool');
+ $xmldata = file_get_contents($ifcfile);
+ $xmltool->import_xml($xmldata);
+ $xml = $xmltool->export_var();
+
+_debug_array('hei');
+*/
+/* $xmlparse = CreateObject('phpgwapi.parsexml');
+ $xml = $xmlparse->GetXMLTree($ifcfile);
+*/
+
+// _debug_array($this->xml_to_array($ifcfile));
+
+ $xa = CreateObject('phpgwapi.XmlToArray');
+ $xml = $xa->parseFile($ifcfile);
+ _debug_array($xml);
-
- //$xml = simplexml_load_file($ifcfile);
- //_debug_array($xml);
-
-
-// $doc = new DOMDocument();
-// $doc->load($ifcfile);
-// _debug_array($doc->getElementsByTagName('document'));
-// _debug_array($xml);
-
-
- $xml_parser = xml_parser_create();
- xml_parse_into_struct($xml_parser, $data, $vals,
$index);
- xml_parser_free($xml_parser);
- //Uncomment the lines below to see the entire structure
of your XML document
- // echo "<pre>INDEX: \n";
- // _debug_array ($index);
- // echo "\n \n \n VALUES:";
- // print_r ($vals);
- // echo "</pre>";
- $params = array();
- $level = array();
- $start_level = 1;
- foreach ($vals as $xml_elem)
- {
- if ($xml_elem['type'] == 'open')
- {
- if
(array_key_exists('attributes',$xml_elem))
- {
-
list($level[$xml_elem['level']],$extra) = array_values($xml_elem['attributes']);
}
- else
- {
- $level[$xml_elem['level']] =
$xml_elem['tag'];
- }
- }
- if ($xml_elem['type'] == 'complete')
- {
- $php_stmt = '$params';
- while($start_level < $xml_elem['level'])
- {
- $php_stmt .=
'[$level['.$start_level.']]';
- $start_level++;
- }
- $php_stmt .= '[$xml_elem[\'tag\']][] =
$xml_elem[\'value\'];';
- eval($php_stmt);
- $start_level--;
- }
- }
- _debug_array($params);
- }
-
function read()
{
$ifc_info = $this->so->read(array('start' =>
$this->start,'query' => $this->query,'sort' => $this->sort,'order' =>
$this->order,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] property/inc class.boifc.inc.php,
Sigurd Nes <=