HTML 解析器将文本转换为代码页 UTF-8。它执行 HTML 标记识别,并将它们归类为下列标记类:
它将识别 HTML 4 中定义的所有字符实体引用(如“ä”(ä))并将它们解析为 UTF-8 中相应的代码点。
它将识别元标记并对元标记文本进行语法分析。
以下是 HTML 文档的示例:
<HTML> <HEAD> <META NAME="year" CONTENT="2002"> <TITLE> The Firm </TITLE> </HEAD> <BODY> <H1>Synopsis</H1>; <H1>Prologue</H1>;: : </BODY>
以下是 HTML 文档模型的示例:
<?xml version="1.0"?> <HTMLModel> <HTMLFieldDefinition name="subtitle" tag="title" exclude="YES" /> <HTMLFieldDefinition - This is the start of text field name="header1" tag="h1" exclude="YES" /> - This is the end of the text field <HTMLAttributeDefinition - This is the start of the document name="year" attribute tag="meta" meta-qualifier="year" type="NUMBER" /> - This is the end of the document attribute </HTMLModel>
第一行 <?xml version="1.0"?> 指定使用 XML 标记编写文档模型。注意,此模型不是为 XML 格式文档编写的。
每个字段都是在 HTMLFieldDefinition 或 HTMLAttributeDefinition 标记内定义的,该标记包含元素参数。
所有文本字段定义都必须包含在 <HTMLModel> 标记内。