Skip to content

litwinski/XmlStreamer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

XmlStreamer
[email protected]
Free for everyone for everything, attribution voluntary
------

Usage:
Extend the class and implement the processNode method.

Example:
class SimpleXmlStreamer extends XmlStreamer {
	public function processNode($xmlString, $elementName, $nodeIndex) {
		$xml = simplexml_load_string($xmlString);
		$something = (string)$xml->Something->SomethingElse->ReadThis;
		echo "$nodeIndex: Extracted string '$something' from parent node '$elementName'\n";		
		return true;
	}
}

$streamer = new SimpleXmlStreamer("myLargeXmlFile.xml");
if ($streamer->parse()) {
	echo "Finished successfully";
} else {
	echo "Couldn't find root node";
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published