Public Member Functions | Data Fields | Static Public Attributes

ilExerciseXMLWriter Class Reference

XML writer class. More...

Inheritance diagram for ilExerciseXMLWriter:
Collaboration diagram for ilExerciseXMLWriter:

Public Member Functions

 ilExerciseXMLWriter ()
 constructor
 setExercise (&$exercise)
 setAttachFileContents ($attachFileContents)
 set attachment content mode
 getXML ()
 __buildHeader ()
 __buildFooter ()

Data Fields

 $attachFileContents
 $exercise

Static Public Attributes

static $CONTENT_ATTACH_NO = 0
static $CONTENT_ATTACH_ENCODED = 1
static $CONTENT_ATTACH_ZLIB_ENCODED = 2
static $CONTENT_ATTACH_GZIP_ENCODED = 3

Detailed Description

XML writer class.

Class to simplify manual writing of xml documents. It only supports writing xml sequentially, because the xml document is saved in a string with no additional structure information. The author is responsible for well-formedness and validity of the xml document.

Author:
Roland Küstermann <Roland@kuestermann.com>
Version:
Id:
class.ilExerciseXMLWriter.php,v 1.3 2005/11/04 12:50:24 smeyer Exp

Definition at line 42 of file class.ilExerciseXMLWriter.php.


Member Function Documentation

ilExerciseXMLWriter::__buildFooter (  ) 

Definition at line 190 of file class.ilExerciseXMLWriter.php.

        {

        }

ilExerciseXMLWriter::__buildHeader (  ) 

Definition at line 181 of file class.ilExerciseXMLWriter.php.

References ilXmlWriter::xmlHeader(), ilXmlWriter::xmlSetDtdDef(), and ilXmlWriter::xmlSetGenCmt().

        {
                $this->xmlSetDtdDef("<!DOCTYPE Exercise PUBLIC \"-//ILIAS//DTD ExerciseAdministration//EN\" \"".ILIAS_HTTP_PATH."/xml/ilias_exercise_3_8.dtd\">");
                $this->xmlSetGenCmt("Exercise Object");
                $this->xmlHeader();

                return true;
        }

Here is the call graph for this function:

ilExerciseXMLWriter::getXML (  ) 

Definition at line 175 of file class.ilExerciseXMLWriter.php.

References ilXmlWriter::xmlDumpMem().

        {
                return $this->xmlDumpMem(FALSE);
        }

Here is the call graph for this function:

ilExerciseXMLWriter::ilExerciseXMLWriter (  ) 

constructor

Parameters:
string xml version
string output encoding
string input encoding public

Definition at line 70 of file class.ilExerciseXMLWriter.php.

References $CONTENT_ATTACH_NO, and ilXmlWriter::ilXmlWriter().

        {
                parent::ilXmlWriter();
                $this->attachFileContents = ilExerciseXMLWriter::$CONTENT_ATTACH_NO;
        }

Here is the call graph for this function:

ilExerciseXMLWriter::setAttachFileContents ( attachFileContents  ) 

set attachment content mode

Parameters:
int $attachFileContents
Exceptions:
ilExerciseException if mode is not supported

Definition at line 88 of file class.ilExerciseXMLWriter.php.

References $attachFileContents, $CONTENT_ATTACH_GZIP_ENCODED, $CONTENT_ATTACH_ZLIB_ENCODED, and ilExerciseException::$ID_DEFLATE_METHOD_MISMATCH.

        {
             if ($attachFileContents == ilExerciseXMLWriter::$CONTENT_ATTACH_GZIP_ENCODED && !function_exists("gzencode"))
                 {
                      throw new ilExerciseException("Inflating with gzip is not supported",  ilExerciseException::$ID_DEFLATE_METHOD_MISMATCH);
         }
         if ($attachFileContents == ilExerciseXMLWriter::$CONTENT_ATTACH_ZLIB_ENCODED && !function_exists("gzcompress"))
         {
            throw new ilExerciseException("Inflating with zlib (compress/uncompress) is not supported",  ilExerciseException::$ID_DEFLATE_METHOD_MISMATCH);
         }

                $this->attachFileContents = $attachFileContents;
        }

ilExerciseXMLWriter::setExercise ( &$  exercise  ) 

Definition at line 77 of file class.ilExerciseXMLWriter.php.

References $exercise.

        {
                $this->exercise = & $exercise;
        }


Field Documentation

ilExerciseXMLWriter::$attachFileContents

Definition at line 54 of file class.ilExerciseXMLWriter.php.

Referenced by setAttachFileContents().

ilExerciseXMLWriter::$CONTENT_ATTACH_ENCODED = 1 [static]

Definition at line 46 of file class.ilExerciseXMLWriter.php.

ilExerciseXMLWriter::$CONTENT_ATTACH_GZIP_ENCODED = 3 [static]

Definition at line 48 of file class.ilExerciseXMLWriter.php.

Referenced by setAttachFileContents().

ilExerciseXMLWriter::$CONTENT_ATTACH_NO = 0 [static]

Definition at line 45 of file class.ilExerciseXMLWriter.php.

Referenced by ilExerciseXMLWriter().

ilExerciseXMLWriter::$CONTENT_ATTACH_ZLIB_ENCODED = 2 [static]

Definition at line 47 of file class.ilExerciseXMLWriter.php.

Referenced by setAttachFileContents().

ilExerciseXMLWriter::$exercise

Definition at line 61 of file class.ilExerciseXMLWriter.php.

Referenced by setExercise().


The documentation for this class was generated from the following file: