1<?php
2
3class syntax_plugin_svg_parser
4{
5	var $width;
6	var $height;
7
8	function parse( $xml_data )
9	{
10		$xmlp = xml_parser_create();
11
12		xml_set_object( $xmlp, $this );
13
14		xml_set_element_handler( $xmlp, 'start_element', false );
15
16		xml_parse( $xmlp, $xml_data );
17
18		xml_parser_free( $xmlp );
19	}
20
21	function start_element( $parser, $name, $attribs )
22	{
23		if( strtolower( $name ) == 'svg' )
24		{
25			$this->width = $attribs[ 'WIDTH' ];
26			$this->height = $attribs[ 'HEIGHT' ];
27		}
28	}
29}
30
31?>
32