CIPA 2005 XX International Symposium, 26 September - 01 October. 2005, Torino, Italv
939
Details can not be discussed here. It must be annotated, that the
DTD will be replaced in future by the more powerful Xschema.
With XML, XSL and DTD structured information is separated
from processing: This file structure can be processed with
object-oriented programming languages in client-server
environments.
the menu.
4. PROCESSING GRAPHIC DATA
4.1 SVG Scalable Vector Graphics
3. PARSING XML FILES WITH PHP
3.1 The Parser
It is proposed to explain parsing and processing XML-
documents by using the photogrammetric example from above.
Requested are the camera values for the camera referenced by
the description nikon_28. The client's request typed in the
address line of the browser:
http://www.imagefact.de/zitadelle-wesel/
parse_camera.php?earnera=nikon_28
has to be submitted to the server.
A parser will go through the file until the requested camera is
found. The parser analyses and validates the file structure.
Expat is an event driven parser and provided by PHP. Events
are the occurrences of tags and content. An instance of the
parser is created with the statement:
$parser = xml_parser_create();
It is necessary to set parameter for the parser and handler for the
elements, for example:
xml_set_element_handler( $parser,
"start_element", "end_element" );
or
xml_set_character_data_handler(
$parser, "inhalt" );
start element, end element and inhalX are functions called by
the parser, if it meets one of the defined events.
3.2 Processing Data
The function inhalt will process, if the content of a tag was
camera. The camera data is stored in arrays.
function inhalt(Sparser,$data ){
global $curr_tag,$index,$camera
switch ($curr_tag){
case "type": $index=$data;break;
case "ck": $camera[$index][ck]=$data;break;
case "xh": $camera[$index][xh]=$data;break;
case "yh": $camera[$index][yh]=$data;break;
case "al": $camera[$index][al]=$data;break;
case "a2": $camera[$index][a2]=$data;break;
case "formX": $camera[$index][formX]=
$data;break;
case "formY": $camera[$index][formY]=
$data;break;
}
}
After getting the camera data, the arrays must be evaluated and
the requested data, embedded in HTML-tags, has to be
generated and must be passed to the client. PHP uses the echo-
function for writing HTML commands. Figure 3 shows the
answer to a request including image data as rendered by the
browser. The complete examples can be found on the Web
under www.programmierpraktikum.de, follow the navigation to
the readers section (leserbereich), select PHP&XML there from
Scalable Vector Graphics SVG is the XML formulation of 2D
vector graphics. It includes drawing of vector data, displaying
of image data, interaction and animation. Structure and
appearance of graphic elements is separated by using style
sheets.
gffil .-lPij<j
AmkM f averter* Extras ■BW
*tj
[Angefragte Bildnummer 101
jeam
J60ÖÜ5Ö“
jsmgSre
jgik/101 .jpg
thumb
jgfk/thumb/101 jpg
wx
ji 7.573
Jwy
j-31.390
jwz
1-0.991
*0
yo
|l t .093
jlQ
fj 7.573
Figure 3. Parsing XML-Information and displaying
the result on a Web page
Applying a SVG viewer as a plug-in for the Web browser
enables zooming and panning in the graphic area. Figure 4
displays the position of control points and demonstrates the use
of image data inside vector data.
Figure 4. Image data nd vector data combined with SVG
The images are rectified and represent to a certain extend a true
scale image map. Zooming in is followed by loss of quality.
This is not the case with vector data. The appearance of the
drawing, shown in figure 5, is dependent from the applied style
sheet. The file content can be easily transformed to different