again think i'm missing basic here, can't figure out.
i'm parsing xml file formatted excel, using simplexml in php.
my xml file looks following:
simplexmlelement object ( [documentproperties] => simplexmlelement object ( [author] => surname name [lastauthor] => name surname [created] => 2016-08-01t10:15:25z [version] => 14.00 ) [officedocumentsettings] => simplexmlelement object ( [allowpng] => simplexmlelement object ( ) ) [excelworkbook] => simplexmlelement object ( [windowheight] => 9375 [windowwidth] => 9705 [windowtopx] => 270 [windowtopy] => 615 [protectstructure] => false [protectwindows] => false ) [styles] => simplexmlelement object ( [style] => simplexmlelement object ( [alignment] => simplexmlelement object ( ) [font] => simplexmlelement object ( ) ) ) [worksheet] => array ( [0] => simplexmlelement object ( [table] => simplexmlelement object ( [column] => array ( [0] => simplexmlelement object ( ) [1] => simplexmlelement object ( ) [2] => simplexmlelement object ( ) ) [row] => array ( [0] => simplexmlelement object ( [cell] => array ( [0] => simplexmlelement object ( [data] => model ) [1] => simplexmlelement object ( [data] => qty ) [2] => simplexmlelement object ( [data] => description ) [3] => simplexmlelement object ( [data] => tags ) ) ) [1] => simplexmlelement object ( [cell] => array ( [0] => simplexmlelement object ( [data] => model_name ) [1] => simplexmlelement object ( [data] => 1 ) [2] => simplexmlelement object ( [data] => item ) ) ) [....code repeats other rows/worksheets....]
now, if want display author name, can like: echo $xml->documentproperties->lastauthor; , expected result. how display values in various rows/cells (keeping in mind xml files have diverse number of rows , rows not filled)?
i've tried following:
echo $xml->worksheet[0]->table->row[0]->cell[0];
but doing doesn't return value. able cycle through rows can display them html table.
any ideas?
thanks lot in advance help!
Comments
Post a Comment