Need for Entities Support in DTD parser for OCaml
[ Nouvelle discussion
| Répondre au groupe
|
fr.comp.lang.caml ]
Hi,
I'm currently using PXP to parse XML DTDs. My aim is to build tree
automata from DTDs.
I would like to use the defined parameter entities (for instance those
of XHTML) in my OCaml programs but until now I didn't find any way of
doing it.
Precisely in PXP there is a class called Pxp_dtd from which I can
obtain instances of type Pxp_entity.entity. There is a module Entity
inside Pxp_dtd to manipulate entities but it doesn't exactly
corresponds to my needs.
I tried to find what I was looking for in the class Pxp_entity but I
have to admit that it is beyond my technical skills. I don't know how
entities are stored and how the parser processes.
So in short, I need an abstraction for parameter entities. In XHTML
you have for example:
<!ENTITY % special.extra "object | applet | img | map | iframe">
<!ENTITY % special.basic "br | span | bdo">
<!ENTITY % special "%special.basic; | %special.extra;">
But there are other forms of entities. If I use the function
'Pxp_dtd.Entity.replacement_text entity_special', I get the string
"object | applet | img | map | iframe | br | span | bdo". I'd rather
have an instance of something of type like:
type param_entity = param_entity list | string
I could then manipulate entities easily.
I hope that you understand my problem. If not I can try to say more
about it.
If someone has already faced this kind of issue and solved it, I'd
really appreciate some help. Or if you know another parser for DTDs in
OCaml (xml-light doesn't manage entities and the documentation of
expat didn't leave me nay hope to find how I could do what I want to
do). Or any easy way to solve my problem.
Bye.

|
 cette fonctionnalité est reservée aux membres ayant une session active !
|