J
Johnny
Hi,
Do you know any kind of html dtd parser? I want to parse the html dtd
file and generate a tree or graph containing all the info. I want to
have some basic operations based on the tree or graph:
1. Query which elements can be included under a specific element.
* eg. specify "UL" element, I can get the answer that only "LI"
element can be included under "UL" element
2. Query which elements is needed to construct a document
* eg. specify "TD" element, I can get the answer that if I need to
build a document, I need the following elements in order:
* HTML
* BODY
* TABLE
* TBODY
* TR/TH
I have tried two dtd parser:
http://matra.sourceforge.net/
and
http://www.wutka.com/dtdparser.html
They are all written in Java. But they all can't handle the html dtd.
As you know, html dtd has its own grammar, is there any existing parser
that can handle the html dtd? I don't think I am the first one who need
to manipulate the html dtd data.
Thanks for your consideration.
Regards,
Johnny
Do you know any kind of html dtd parser? I want to parse the html dtd
file and generate a tree or graph containing all the info. I want to
have some basic operations based on the tree or graph:
1. Query which elements can be included under a specific element.
* eg. specify "UL" element, I can get the answer that only "LI"
element can be included under "UL" element
2. Query which elements is needed to construct a document
* eg. specify "TD" element, I can get the answer that if I need to
build a document, I need the following elements in order:
* HTML
* BODY
* TABLE
* TBODY
* TR/TH
I have tried two dtd parser:
http://matra.sourceforge.net/
and
http://www.wutka.com/dtdparser.html
They are all written in Java. But they all can't handle the html dtd.
As you know, html dtd has its own grammar, is there any existing parser
that can handle the html dtd? I don't think I am the first one who need
to manipulate the html dtd data.
Thanks for your consideration.
Regards,
Johnny