What is an XML parser?
什么是 XML 解析器？
An Extensible Markup Language (XML) parser is software that can process or read XML documents to extract the data within them. XML parsers also check the syntax or rules of the XML file and can validate it against a particular XML schema. Because XML is a strict markup language, the parsers will not process the file if there are any validation or syntax errors. For example, the XML parser will give errors if any of these conditions are true:
A closing tag or end tag is missing
Attribute values don’t have quotation marks
A schema condition has not been met
Software applications use XML parsers to transform XML files into native data types. They can thus focus on the application logic without having to go into the details of the XML itself.
可扩展标记语言 (XML) 解析器是一种可以处理或读取 XML 文档以提取其中数据的软件。XML 解析器还可以检查 XML 文件的语法或规则，并可以根据特定的 XML 架构对其进行验证。由于 XML 是一种严格的标记语言，如果存在任何验证或语法错误，解析器将不会处理该文件。例如，如果以下任一条件成立，XML 解析器将给出错误：
缺少结尾标签或结束标签
属性值没有引号
未满足架构条件
软件应用程序使用 XML 解析器将 XML 文件转换为本地数据类型。这样，他们可以专注于应用程序逻辑，而不必深入 XML 本身的细节。