Is XMLReader a SAX parser, a DOM parser, or neither?

前端 未结 4 1334
盖世英雄少女心
盖世英雄少女心 2020-12-21 02:24

I am testing various methods to read (possibly large, with very frequent reads) XML configuration files in PHP. No writing is ever needed. I have two successful implementa

4条回答
  •  抹茶落季
    2020-12-21 03:00

    XMLReader is an interface that a SAX2 parser must implement. Thus you could say that you have a SAX parser when you access it through XMLReader and for short that XMLReader is the SAX parser.

    See the javadoc of XMLReader.

    XMLReader is the interface that an XML parser's SAX2 driver must implement. This interface allows an application to set and query features and properties in the parser, to register event handlers for document processing, and to initiate a document parse.

    I think this information is relevant because:

    • It comes from the official Web site for SAX
    • Even if the javadoc is for Java, SAX originated in the Java language.

提交回复
热议问题