ILIAS  release_8 Revision v8.23
ilSoapStructureObjectXMLWriter Class Reference

XML writer class Class to simplify manual writing of xml documents. More...

+ Inheritance diagram for ilSoapStructureObjectXMLWriter:
+ Collaboration diagram for ilSoapStructureObjectXMLWriter:

Public Member Functions

 __construct ()
 
 setStructureObject (ilSoapStructureObject $structureObject)
 
 start ()
 
 getXML ()
 
- Public Member Functions inherited from ilXmlWriter
 __construct (string $version="1.0", string $outEnc="utf-8", string $inEnc="utf-8")
 
 xmlSetDtdDef (string $dtdDef)
 Sets dtd definition. More...
 
 xmlSetGenCmt (string $genCmt)
 Sets generated comment. More...
 
 xmlFormatData (string $data)
 Indents text for better reading. More...
 
 xmlHeader ()
 Writes xml header. More...
 
 xmlStartTag (string $tag, ?array $attrs=null, bool $empty=false, bool $encode=true, bool $escape=true)
 Writes a starttag. More...
 
 xmlEndTag (string $tag)
 Writes an endtag. More...
 
 xmlData (string $data, bool $encode=true, bool $escape=true)
 Writes data. More...
 
 xmlElement (string $tag, $attrs=null, $data=null, $encode=true, $escape=true)
 Writes a basic element (no children, just textual content) More...
 
 xmlDumpFile (string $file, bool $format=true)
 Dumps xml document from memory into a file. More...
 
 xmlDumpMem (bool $format=true)
 Returns xml document from memory. More...
 
 appendXML (string $a_str)
 append xml string to document More...
 
 xmlClear ()
 clears xmlStr More...
 

Data Fields

string $xml
 
ilSoapStructureObject $structureObject = null
 

Private Member Functions

 buildHeader ()
 
 buildFooter ()
 

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
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
Id
class.ilObjectXMLWriter.php,v 1.3 2005/11/04 12:50:24 smeyer Exp

Definition at line 17 of file class.ilSoapStructureObjectXMLWriter.php.

Constructor & Destructor Documentation

◆ __construct()

ilSoapStructureObjectXMLWriter::__construct ( )

Definition at line 22 of file class.ilSoapStructureObjectXMLWriter.php.

References $DIC, $ilUser, and ILIAS\GlobalScreen\Provider\__construct().

23  {
24  global $DIC;
25 
26  $ilUser = $DIC->user();
28  }
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
$ilUser
Definition: imgupload.php:34
+ Here is the call graph for this function:

Member Function Documentation

◆ buildFooter()

ilSoapStructureObjectXMLWriter::buildFooter ( )
private

Definition at line 59 of file class.ilSoapStructureObjectXMLWriter.php.

Referenced by start().

59  : void
60  {
61  }
+ Here is the caller graph for this function:

◆ buildHeader()

ilSoapStructureObjectXMLWriter::buildHeader ( )
private

Definition at line 52 of file class.ilSoapStructureObjectXMLWriter.php.

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

Referenced by start().

52  : void
53  {
54  $this->xmlSetDtdDef("<!DOCTYPE RepositoryObject PUBLIC \"-//ILIAS//DTD UserImport//EN\" \"" . ILIAS_HTTP_PATH . "/xml/ilias_soap_structure_object_3_7.dtd\">");
55  $this->xmlSetGenCmt("Internal Structure Information of Repository Object");
56  $this->xmlHeader();
57  }
xmlSetGenCmt(string $genCmt)
Sets generated comment.
xmlSetDtdDef(string $dtdDef)
Sets dtd definition.
xmlHeader()
Writes xml header.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getXML()

ilSoapStructureObjectXMLWriter::getXML ( )

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

References ilXmlWriter\xmlDumpMem().

47  : string
48  {
49  return $this->xmlDumpMem(false);
50  }
xmlDumpMem(bool $format=true)
Returns xml document from memory.
+ Here is the call graph for this function:

◆ setStructureObject()

ilSoapStructureObjectXMLWriter::setStructureObject ( ilSoapStructureObject  $structureObject)

Definition at line 30 of file class.ilSoapStructureObjectXMLWriter.php.

References $structureObject.

30  : void
31  {
32  $this->structureObject = $structureObject;
33  }

◆ start()

ilSoapStructureObjectXMLWriter::start ( )

Definition at line 35 of file class.ilSoapStructureObjectXMLWriter.php.

References buildFooter(), and buildHeader().

35  : bool
36  {
37  if (!is_object($this->structureObject)) {
38  return false;
39  }
40 
41  $this->buildHeader();
42  $this->structureObject->exportXML($this);
43  $this->buildFooter();
44  return true;
45  }
+ Here is the call graph for this function:

Field Documentation

◆ $structureObject

ilSoapStructureObject ilSoapStructureObjectXMLWriter::$structureObject = null

Definition at line 20 of file class.ilSoapStructureObjectXMLWriter.php.

Referenced by setStructureObject().

◆ $xml

string ilSoapStructureObjectXMLWriter::$xml

Definition at line 19 of file class.ilSoapStructureObjectXMLWriter.php.


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