Moodle PHP Documentation 4.1
Moodle 4.1.19+ (Build: 20250706) (3342f23b299)
Box\Spout\Reader\Wrapper\XMLReader Class Reference

Public Member Functions

 getCurrentNodeName ()
 
 getRealPathURIForFileInZip ($zipFilePath, $fileInsideZipPath)
 Returns the real path for the given path components.
 
 isPositionedOnEndingNode ($nodeName)
 
 isPositionedOnStartingNode ($nodeName)
 
 next ($localName=null)
 Move cursor to next node skipping all subtrees.
 
 openFileInZip ($zipFilePath, $fileInsideZipPath)
 Opens the XML Reader to read a file located inside a ZIP file.
 
 read ()
 Move to next node in document.
 
 readUntilNodeFound ($nodeName)
 Read until the element with the given name is found, or the end of the file.
 

Public Attributes

const ZIP_WRAPPER = 'zip://'
 

Protected Member Functions

 fileExistsWithinZip ($zipStreamURI)
 Returns whether the file at the given location exists.
 

Member Function Documentation

◆ fileExistsWithinZip()

Box\Spout\Reader\Wrapper\XMLReader::fileExistsWithinZip ( $zipStreamURI)
protected

Returns whether the file at the given location exists.

Parameters
string$zipStreamURIURI of a zip stream, e.g. "zip://file.zip#path/inside.xml"
Return values
boolTRUE if the file exists, FALSE otherwise

◆ getCurrentNodeName()

Box\Spout\Reader\Wrapper\XMLReader::getCurrentNodeName ( )
Return values
stringThe name of the current node, un-prefixed

◆ getRealPathURIForFileInZip()

Box\Spout\Reader\Wrapper\XMLReader::getRealPathURIForFileInZip ( $zipFilePath,
$fileInsideZipPath )

Returns the real path for the given path components.

This is useful to avoid issues on some Windows setup.

Parameters
string$zipFilePathPath to the ZIP file
string$fileInsideZipPathRelative or absolute path of the file inside the zip
Return values
stringThe real path URI

◆ isPositionedOnEndingNode()

Box\Spout\Reader\Wrapper\XMLReader::isPositionedOnEndingNode ( $nodeName)
Parameters
string$nodeName
Return values
boolWhether the XML Reader is currently positioned on the ending node with given name

◆ isPositionedOnStartingNode()

Box\Spout\Reader\Wrapper\XMLReader::isPositionedOnStartingNode ( $nodeName)
Parameters
string$nodeName
Return values
boolWhether the XML Reader is currently positioned on the starting node with given name

◆ next()

Box\Spout\Reader\Wrapper\XMLReader::next ( $localName = null)

Move cursor to next node skipping all subtrees.

See also
XMLReader::next
Parameters
string | null$localNameThe name of the next node to move to
Exceptions
Box\Spout\Reader\Exception\XMLProcessingExceptionIf an error/warning occurred
Return values
boolTRUE on success or FALSE on failure

◆ openFileInZip()

Box\Spout\Reader\Wrapper\XMLReader::openFileInZip ( $zipFilePath,
$fileInsideZipPath )

Opens the XML Reader to read a file located inside a ZIP file.

Parameters
string$zipFilePathPath to the ZIP file
string$fileInsideZipPathRelative or absolute path of the file inside the zip
Return values
boolTRUE on success or FALSE on failure

◆ read()

Box\Spout\Reader\Wrapper\XMLReader::read ( )

Move to next node in document.

See also
XMLReader::read
Exceptions
Box\Spout\Reader\Exception\XMLProcessingExceptionIf an error/warning occurred
Return values
boolTRUE on success or FALSE on failure

◆ readUntilNodeFound()

Box\Spout\Reader\Wrapper\XMLReader::readUntilNodeFound ( $nodeName)

Read until the element with the given name is found, or the end of the file.

Parameters
string$nodeNameName of the node to find
Exceptions
Box\Spout\Reader\Exception\XMLProcessingExceptionIf an error/warning occurred
Return values
boolTRUE on success or FALSE on failure

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