Examples of stream parsers include XMLReader and SAX.
流解析器的例子包括XMLReader和SAX。
XMLReader is a useful addition to the PHP programmer's toolkit.
XMLReader是添加到PHP程序员工具箱中的一个很有用的工具。
This example in Listing 10 parses a large XML document with XMLReader.
清单10中的例子使用XMLReader解析大型XML文档。
With XMLReader, the data is passed one element at a time using expand().
通过XMLReader,每次使用 expand()传递一个元素的数据。
XMLReader supports namespaces and validation, including DTD and Relaxed ng.
XMLReader支持名称空间和验证,包括DTD和RelaxedNG。
Reads the contents of the current node into a string. Overrides XmlReader.
将当前节点的内容读入字符串。
With this method, you can convert a node passed by XMLReader to a DOMElement.
通过这种方法就能将XMLReader传递的节点转换成DOMElement。
The only way to access these events is to work directly with the SAX XMLReader interface.
访问这些事件的惟一方式是直接操作SAXXMLReader接口。
If your PHP programs need to accept XML input, XMLReader is well worth your consideration.
如果PHP程序需要接受XML输入,则XMLReader是很值得考虑的一个工具。
More recently, I've discovered that it's even more beneficial to implement the XMLReader interface.
最近我发现,实现XMLReader接口甚至更有益处。
I also need to start fully implementing the XMLReader interface, but this isn't particularly difficult.
另外还需要开始完整地实现XMLReader接口,但这并不特别困难。
A major disadvantage is that SAX parser code is complex and more difficult to write than XMLReader code.
SAX解析器的主要缺点是代码很复杂,比XMLReader代码编写起来更难。
One final dependency: the XJConf for PHP package requires that you enable the xmlreader extension of PHP.
最后一点要求:XJConf forPHP需要启用 PHP的xmlreader扩展。
You might remember from my previous column, "Wrapping up XI," I chose to implement the XMLReader interface.
您可能记得我的上一篇专栏文件“完成XI”,我选择了实现XMLReader接口。
The XMLReader extension is a stream-based parser of the type often referred to as a cursor type or pull parser.
XMLReader扩展是一种基于流的解析器,其类型通常被称为游标类型或者pull类型解析器。
XMLReader is a pull parser and you code for it in much the same way as for a database query result table in a cursor.
XMLReader是一种pull解析器,其编码方法和数据库查询结果表的游标中非常类似。
Very unusually for an XML API, XMLReader lets you read the attributes from either the beginning or the end of the element.
对于XMLAPI 来说非常难得的是,XMLReader 允许从元素的起点或终点读取属性。
You can, for instance, use XMLReader, a stream parser, to get an element, import it into the DOM and extract data using XPath.
比方说,可以使用流解析器XMLReader获取一个元素,将其导入DOM,然后用XPath提取数据。
I'll also show you how a single parser (represented by an instance of an XMLReader) can have multiple handlers registered to it.
我还将为您展示一个解析器(由XMLReader的一个实例作为代表)如何可以注册多个处理程序。
Part 2 also looked at the use of XMLReader, which provides a faster easier way to perform tasks that one would previously do using SAX.
第2部分考察了XMLReader的使用,它提供了一种比SAX更快更简单的办法。
You can then work with the XMLReader instance as you would with a straight SAX application which of course includes setting an error handler.
接下来可以像处理一个简单SAX应用程序一样处理XMLReader实例,并设置一个错误处理程序。
The primary reason to use the SAX parser rather than the XMLReader is that the SAX parser is sometimes more efficient and usually more familiar.
使用SAX解析器而不是XMLReader的主要原因在于SAX解析器有时候效率更高一些,而且通常更被人们熟悉。
The XMLWriter and XMLReader are stream-based object-oriented classes that allow you to read and write XML without having to worry about the XML details.
XMLWriter和XMLReader是基于流的面向对象类,它们允许您读写XML,并且不要担心 XML 的细节。
You can either integrate XI as a library into your project (it USES the familiar XMLReader API) or turn to the user interface for occasional data conversion.
您可以将XI作为一个库集成到您项目中(它使用熟悉的XMLReaderAPI)或变成用户界面以用于临时数据转换。
This final, follow-up example in Listing 5 uses the DOM with XPath in the same way, except the data is passed one element at a time by XMLReader using expand().
后面清单5中的例子仍然使用DOM和XPath,但每次让 XMLReader用expand()传递一个元素的数据。
To register event handlers and to start parsing, the application USES the XMLReader interface. As we have seen, parse , a method of XMLReader, starts the parsing.
为注册事件处理器并启动语法分析器,应用程序使用XMLReader接口。
Even though you don't have direct access to a SAX XMLReader implementation, you can get to the SAX-specific methods that are the core of error handling in this article.
即使不能直接访问SAXXMLReader实现,也可获得一些与SAX有关的方法,它们是本文中错误处理的核心方法。
Even though you don't have direct access to a SAX XMLReader implementation, you can get to the SAX-specific methods that are the core of error handling in this article.
即使不能直接访问SAXXMLReader实现,也可获得一些与SAX有关的方法,它们是本文中错误处理的核心方法。
应用推荐