- 授权协议: BSD
- 开发语言: C/C++
- 操作系统: 跨平台
- 软件首页: http://code.google.com/p/streamhtmlparser/
软件介绍
Streaming HTML parser 是一个 C 语言的 HTML 解析器。
示例代码
#include <stdio.h>
#include <streamhtmlparser/htmlparser.h>
int main(void) {
unsigned int getchar_ret;
htmlparser_ctx *parser = htmlparser_new();
while((getchar_ret = getchar()) != EOF) {
char c = (char)getchar_ret;
/* If we received a '$' character, we output the current tag and attribute
* name to stdout. */
if (c == '$') {
printf("[[ ");
if (htmlparser_tag(parser))
printf("tag=%s ", htmlparser_tag(parser));
if (htmlparser_attr(parser))
printf("attr=%s ", htmlparser_attr(parser));
printf("]]");
/* If we read any other character, we pass it to the parser and echo it to
* stdout. */
} else {
htmlparser_parse_chr(parser, c);
putchar(c);
}
}
}
输入
<html> <body $> <title> $ </title> <a href="$" alt="$"> url </a> </body> </html>
输出
<html> <body [[ tag=body ]]> <title> [[ tag=title ]] </title> <a href="[[ tag=a attr=href ]]" alt="[[ tag=a attr=alt ]]"> url </a> </body> </html>
个性化网页设计与鉴赏
梁景红 / 西安电子科技大学出版社 / 2003-07-14 / 22.00
本书比较全面地介绍了网页设计应注意的相关问题, 在网页设计基础方面着重讲解了网页框架、页面元素、色彩设计,分析了一些人们容易忽视的细小环节,如页面装饰物、图片、文字、连接等。书中结合实例分析了优秀网页的设计创意思想,可以给读者提供一些启示。书中还介绍了作为网页设计者需要了解的信息管理和技术应用,以及网站VI设计和视觉美学等必要知识,读者可针对各种类别的站点具体实践这些知识,寻找进行网页设计的切入点......一起来看看 《个性化网页设计与鉴赏》 这本书的介绍吧!
