ILIAS  trunk Revision v11.0_alpha-1744-gb0451eebef4
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilXMLResultSetParser Class Reference
+ Inheritance diagram for ilXMLResultSetParser:
+ Collaboration diagram for ilXMLResultSetParser:

Public Member Functions

 __construct (string $a_xml_data='')
 
 getXMLResultSet ()
 
 setHandlers ($a_xml_parser)
 
 handlerBeginTag ($a_xml_parser, string $a_name, array $a_attribs)
 
 handlerEndTag ($a_xml_parser, string $a_name)
 Handler for end of element. More...
 
 handlerCharacterData ($a_xml_parser, string $a_data)
 Handler for character data. More...
 
- Public Member Functions inherited from ilSaxParser
 __construct (?string $path_to_file='', ?bool $throw_exception=false)
 
 setXMLContent (string $a_xml_content)
 
 getXMLContent ()
 
 getInputType ()
 
 startParsing ()
 stores xml data in array More...
 
 createParser ()
 
 setHandlers ($a_xml_parser)
 
 parse ($a_xml_parser, $a_fp=null)
 

Private Attributes

ilXMLResultSet $xmlResultSet = null
 
ilXMLResultSetRow $currentRow = null
 
int $currentColumnIndex = 0
 
string $cdata = ''
 

Additional Inherited Members

- Data Fields inherited from ilSaxParser
string $xml_file
 
bool $throw_exception = false
 
- Protected Member Functions inherited from ilSaxParser
 openXMLFile ()
 
 handleError (string $message)
 
 setThrowException (bool $throw_exception)
 
- Protected Attributes inherited from ilSaxParser
ilLanguage $lng = null
 

Detailed Description

Definition at line 21 of file class.ilXMLResultSetParser.php.

Constructor & Destructor Documentation

◆ __construct()

ilXMLResultSetParser::__construct ( string  $a_xml_data = '')

Definition at line 28 of file class.ilXMLResultSetParser.php.

References ILIAS\GlobalScreen\Provider\__construct(), and ilSaxParser\setXMLContent().

29  {
31  $this->setXMLContent($a_xml_data);
32  }
__construct(Container $dic, ilPlugin $plugin)
setXMLContent(string $a_xml_content)
+ Here is the call graph for this function:

Member Function Documentation

◆ getXMLResultSet()

ilXMLResultSetParser::getXMLResultSet ( )

Definition at line 34 of file class.ilXMLResultSetParser.php.

References $xmlResultSet.

◆ handlerBeginTag()

ilXMLResultSetParser::handlerBeginTag (   $a_xml_parser,
string  $a_name,
array  $a_attribs 
)
Parameters
XMLParser | resource$a_xml_parserxml parser
string$a_nameelement name
array$a_attribselement attributes array
Returns
void

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

Referenced by setHandlers().

54  : void
55  {
56  switch ($a_name) {
57  case 'result':
58  $this->xmlResultSet = new ilXMLResultSet();
59  break;
60 
61  case 'colspecs':
62  break;
63 
64  case 'colspec':
65  $this->xmlResultSet->addColumn($a_attribs["name"]);
66  break;
67  case 'row':
68  $this->currentRow = new ilXMLResultSetRow();
69  $this->xmlResultSet->addRow($this->currentRow);
70  $this->currentColumnIndex = 0;
71  break;
72  }
73  }
Row Class for XMLResultSet.
+ Here is the caller graph for this function:

◆ handlerCharacterData()

ilXMLResultSetParser::handlerCharacterData (   $a_xml_parser,
string  $a_data 
)

Handler for character data.

Parameters
XMLParser | resource$a_xml_parserxml parser
string$a_datacharacter data
Returns
void

Definition at line 98 of file class.ilXMLResultSetParser.php.

Referenced by setHandlers().

98  : void
99  {
100  if ($a_data !== "\n") {
101  // Replace multiple tabs with one space
102  $a_data = preg_replace("/\t+/", " ", $a_data);
103  $this->cdata .= trim($a_data);
104  }
105  }
+ Here is the caller graph for this function:

◆ handlerEndTag()

ilXMLResultSetParser::handlerEndTag (   $a_xml_parser,
string  $a_name 
)

Handler for end of element.

Parameters
XMLParser | resource$a_xml_parserxml parser
string$a_nameelement name
Returns
void

Definition at line 81 of file class.ilXMLResultSetParser.php.

Referenced by setHandlers().

81  : void
82  {
83  switch ($a_name) {
84  case 'column':
85  $this->currentRow->setValue($this->currentColumnIndex, $this->cdata);
86  $this->currentColumnIndex++;
87  break;
88  }
89  $this->cdata = '';
90  }
+ Here is the caller graph for this function:

◆ setHandlers()

ilXMLResultSetParser::setHandlers (   $a_xml_parser)
Parameters
XMLParser|resourceA reference to the xml parser

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

References handlerBeginTag(), handlerCharacterData(), and handlerEndTag().

42  : void
43  {
44  xml_set_element_handler($a_xml_parser, $this->handlerBeginTag(...), $this->handlerEndTag(...));
45  xml_set_character_data_handler($a_xml_parser, $this->handlerCharacterData(...));
46  }
handlerEndTag($a_xml_parser, string $a_name)
Handler for end of element.
handlerCharacterData($a_xml_parser, string $a_data)
Handler for character data.
handlerBeginTag($a_xml_parser, string $a_name, array $a_attribs)
+ Here is the call graph for this function:

Field Documentation

◆ $cdata

string ilXMLResultSetParser::$cdata = ''
private

Definition at line 26 of file class.ilXMLResultSetParser.php.

◆ $currentColumnIndex

int ilXMLResultSetParser::$currentColumnIndex = 0
private

Definition at line 25 of file class.ilXMLResultSetParser.php.

◆ $currentRow

ilXMLResultSetRow ilXMLResultSetParser::$currentRow = null
private

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

◆ $xmlResultSet

ilXMLResultSet ilXMLResultSetParser::$xmlResultSet = null
private

Definition at line 23 of file class.ilXMLResultSetParser.php.

Referenced by getXMLResultSet().


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