ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 49 of file class.ilXMLResultSetWriter.php.

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

Referenced by __buildRows().

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

◆ __buildColSpecs()

ilXMLResultSetWriter::__buildColSpecs ( )

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

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

Referenced by start().

74  {
75  $this->xmlStartTag("colspecs");
76 
77  foreach ($this->xmlResultSet->getColSpecs() as $colSpec) {
78  $attr = array ("idx" => $colSpec->getIndex(), "name" => $colSpec->getName());
79 
80  $this->xmlElement("colspec", $attr, null);
81  }
82 
83  $this->xmlEndTag("colspecs");
84  }
xmlStartTag($tag, $attrs=NULL, $empty=FALSE, $encode=TRUE, $escape=TRUE)
Writes a starttag.
xmlElement($tag, $attrs=NULL, $data=Null, $encode=TRUE, $escape=TRUE)
Writes a basic element (no children, just textual content)
xmlEndTag($tag)
Writes an endtag.
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __buildFooter()

ilXMLResultSetWriter::__buildFooter ( )

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

References ilXmlWriter\xmlEndTag().

Referenced by start().

98  {
99  $this->xmlEndTag('result');
100  }
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 64 of file class.ilXMLResultSetWriter.php.

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

Referenced by start().

65  {
66  $this->xmlSetDtdDef("<!DOCTYPE result PUBLIC \"-//ILIAS//DTD XMLResultSet//EN\" \"".ILIAS_HTTP_PATH."/xml/ilias_xml_resultset_3_7.dtd\">");
67  $this->xmlHeader();
68 
69  $this->xmlStartTag("result");
70 
71  return true;
72  }
xmlSetDtdDef($dtdDef)
Sets dtd definition.
xmlStartTag($tag, $attrs=NULL, $empty=FALSE, $encode=TRUE, $escape=TRUE)
Writes a starttag.
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 86 of file class.ilXMLResultSetWriter.php.

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

Referenced by start().

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

◆ getXML()

ilXMLResultSetWriter::getXML ( )

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

References ilXmlWriter\xmlDumpMem().

43  {
44  return $this->xmlDumpMem(FALSE);
45  }
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  {
28  return false;
29  }
30 
31  $this->__buildHeader();
32 
33  $this->__buildColSpecs();
34 
35  $this->__buildRows();
36 
37  $this->__buildFooter();
38 
39  return true;
40  }
+ 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: