Php xmlReader vs xmlparser

I know the difference between xmlreader and other tree-based parsers such as simplexml and dom. But what is the difference between xmlreader and xmlparser? Is there any use to using one over the other?

I need to analyze relatively large xml files, affiliate data data about 100M.

+5
source share
2 answers

They use two different software architectures - push vs pull.

XMLReader is a "pull parser". You are responsible for creating a large loop and calling the read () function to move the cursor forward. This software architecture is generally easier to understand intuitively.

XMLParser - , . , , start_element, end_element, character_data, start_namespace_decl .. xml_parse(), Expat XML-, .

push vs pull architecture, XMLReader, "pull" .

+4

, , PHP, XMLReader, , , : " , node .". / , .

http://www.php.net/manual/en/intro.xmlreader.php

XMLParser , xml.

0

All Articles