ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilXMLResultSetWriter Class Reference

XML Writer for XMLResultSet. More...

+ Inheritance diagram for ilXMLResultSetWriter:
+ Collaboration diagram for ilXMLResultSetWriter:

Public Member Functions

 __construct (&$xmlResultSet)
 
 start ()
 
 getXML ()
 
 __appendRow (&$xmlResultSetRow)
 
 __buildHeader ()
 
 __buildColSpecs ()
 
 __buildRows ()
 
 __buildFooter ()
 
- Public Member Functions inherited from ilXmlWriter
 __construct ($version="1.0", $outEnc="utf-8", $inEnc="utf-8")
 constructor More...
 
 _ilXmlWriter ()
 destructor public More...
 
 xmlSetDtdDef ($dtdDef)
 Sets dtd definition. More...
 
 xmlSetStSheet ($stSheet)
 Sets stylesheet. More...
 
 xmlSetGenCmt ($genCmt)
 Sets generated comment. More...
 
 xmlEncodeData ($data)
 Encodes text from input encoding into output encoding. More...
 
 xmlFormatData ($data)
 Indents text for better reading. More...
 
 xmlFormatElement ($array)
 Callback function for xmlFormatData; do not invoke directly. More...
 
 xmlHeader ()
 Writes xml header public. More...
 
 xmlStartTag ($tag, $attrs=null, $empty=false, $encode=true, $escape=true)
 Writes a starttag. More...
 
 xmlEndTag ($tag)
 Writes an endtag. More...
 
 xmlComment ($comment)
 Writes a comment. More...
 
 xmlData ($data, $encode=true, $escape=true)
 Writes data. More...
 
 xmlElement ($tag, $attrs=null, $data=null, $encode=true, $escape=true)
 Writes a basic element (no children, just textual content) More...
 
 xmlDumpFile ($file, $format=true)
 Dumps xml document from memory into a file. More...
 
 xmlDumpMem ($format=true)
 Returns xml document from memory. More...
 
 appendXML ($a_str)
 append xml string to document More...
 
 xmlClear ()
 clears xmlStr public More...
 

Data Fields

 $xmlResultSet
 
- Data Fields inherited from ilXmlWriter
 $xmlStr
 
 $version
 
 $outEnc
 
 $inEnc
 
 $dtdDef = ""
 
 $stSheet = ""
 
 $genCmt = "Generated by ILIAS XmlWriter"
 

Additional Inherited Members

- Static Public Member Functions inherited from ilXmlWriter
static _xmlEscapeData ($data)
 Escapes reserved characters. More...
 

Detailed Description

XML Writer for XMLResultSet.

Author
Roland Kuestermann (rku@a.nosp@m.ifb..nosp@m.uni-k.nosp@m.arls.nosp@m.ruhe..nosp@m.de)
Version
Id
class.ilXMLResultSet.php,v 1.5 2006/05/23 23:09:06 hschottm Exp

Definition at line 13 of file class.ilXMLResultSetWriter.php.

Constructor & Destructor Documentation

◆ __construct()

ilXMLResultSetWriter::__construct ( $xmlResultSet)

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

References $xmlResultSet.

18  {
19  parent::__construct();
20  $this->xmlResultSet = $xmlResultSet;
21  }

Member Function Documentation

◆ __appendRow()

ilXMLResultSetWriter::__appendRow ( $xmlResultSetRow)

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

References ilXmlWriter\xmlElement(), ilXmlWriter\xmlEndTag(), and ilXmlWriter\xmlStartTag().

Referenced by __buildRows().

49  {
50  $this->xmlStartTag('row', null);
51 
52  foreach ($xmlResultSetRow->getColumns() as $value) {
53  $this->xmlElement('column', null, $value);
54  }
55 
56  $this->xmlEndTag('row');
57  }
xmlStartTag($tag, $attrs=null, $empty=false, $encode=true, $escape=true)
Writes a starttag.
xmlEndTag($tag)
Writes an endtag.
xmlElement($tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __buildColSpecs()

ilXMLResultSetWriter::__buildColSpecs ( )

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

References ilXmlWriter\xmlElement(), ilXmlWriter\xmlEndTag(), and ilXmlWriter\xmlStartTag().

Referenced by start().

71  {
72  $this->xmlStartTag("colspecs");
73 
74  foreach ($this->xmlResultSet->getColSpecs() as $colSpec) {
75  $attr = array("idx" => $colSpec->getIndex(), "name" => $colSpec->getName());
76 
77  $this->xmlElement("colspec", $attr, null);
78  }
79 
80  $this->xmlEndTag("colspecs");
81  }
xmlStartTag($tag, $attrs=null, $empty=false, $encode=true, $escape=true)
Writes a starttag.
xmlEndTag($tag)
Writes an endtag.
xmlElement($tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __buildFooter()

ilXMLResultSetWriter::__buildFooter ( )

Definition at line 94 of file class.ilXMLResultSetWriter.php.

References ilXmlWriter\xmlEndTag().

Referenced by start().

95  {
96  $this->xmlEndTag('result');
97  }
xmlEndTag($tag)
Writes an endtag.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __buildHeader()

ilXMLResultSetWriter::__buildHeader ( )

Definition at line 60 of file class.ilXMLResultSetWriter.php.

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

Referenced by start().

61  {
62  $this->xmlSetDtdDef("<!DOCTYPE result PUBLIC \"-//ILIAS//DTD XMLResultSet//EN\" \"" . ILIAS_HTTP_PATH . "/xml/ilias_xml_resultset_3_7.dtd\">");
63  $this->xmlHeader();
64 
65  $this->xmlStartTag("result");
66 
67  return true;
68  }
xmlStartTag($tag, $attrs=null, $empty=false, $encode=true, $escape=true)
Writes a starttag.
xmlSetDtdDef($dtdDef)
Sets dtd definition.
xmlHeader()
Writes xml header public.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __buildRows()

ilXMLResultSetWriter::__buildRows ( )

Definition at line 83 of file class.ilXMLResultSetWriter.php.

References $row, __appendRow(), ilXmlWriter\xmlEndTag(), and ilXmlWriter\xmlStartTag().

Referenced by start().

84  {
85  $this->xmlStartTag("rows");
86 
87  foreach ($this->xmlResultSet->getRows() as $row) {
88  $this->__appendRow($row);
89  }
90 
91  $this->xmlEndTag("rows");
92  }
xmlStartTag($tag, $attrs=null, $empty=false, $encode=true, $escape=true)
Writes a starttag.
xmlEndTag($tag)
Writes an endtag.
$row
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getXML()

ilXMLResultSetWriter::getXML ( )

Definition at line 41 of file class.ilXMLResultSetWriter.php.

References ilXmlWriter\xmlDumpMem().

42  {
43  return $this->xmlDumpMem(false);
44  }
xmlDumpMem($format=true)
Returns xml document from memory.
+ Here is the call graph for this function:

◆ start()

ilXMLResultSetWriter::start ( )

Definition at line 24 of file class.ilXMLResultSetWriter.php.

References __buildColSpecs(), __buildFooter(), __buildHeader(), and __buildRows().

25  {
26  if (!is_object($this->xmlResultSet)) {
27  return false;
28  }
29 
30  $this->__buildHeader();
31 
32  $this->__buildColSpecs();
33 
34  $this->__buildRows();
35 
36  $this->__buildFooter();
37 
38  return true;
39  }
+ Here is the call graph for this function:

Field Documentation

◆ $xmlResultSet

ilXMLResultSetWriter::$xmlResultSet

Definition at line 15 of file class.ilXMLResultSetWriter.php.

Referenced by __construct().


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