eraviart
42a4a98f59
Added XHTML DTDs & entities as XML catalogs. These catalogs are handled the
...
Debian way <http://debian-xml-sgml.alioth.debian.org/ >.
Q: Why do you use manage XML catalogs the standard way instead of libxml2 way?
A: Because the Debian way is the standard (Oasis) way and it is partially
incompatible with libxml2 way.
Q: Why do you use XML catalogs?
A: Because I needed to store XHTML entities definitions in the local
filesystem.
Q: Why do you need to store XHTML DTDs & entities definitions in the local
filesystem?
A: For speed reasons. Otherwise calls to libxml2 function xmlReadDoc with
option XML_PARSE_DTDLOAD require HTTP calls to get the DTD and its entities.
Q: Why do you need to use xmlReadDoc function with option XML_PARSE_DTDLOAD?
A: Otherwise, the parsing of XHTML files fails when the files contain
entities like é, etc.
Q: Why are entities definitions needed? You don't need entities substitution
when parsing XML & XHTML files.
A: Because after spending several hours testing and reading libxml2
documentation, I discovered that even when not substituting entities,
libxml2 needs to know their definitions (the reason is it stores both
entities declarations and substitutions inside XML tree. See
http://xmlsoft.org/entities.html ).
Q: Why do you use xmlReadDoc instead of xmlParseDoc?
A: Because after spending several hours testing and reading libxml2
documentation, I discovered that xmlParse functions are deprecated.
Q: Why don't you use htmlParseDoc (or htmlReadDoc) anymore to read XHTML
files? They worked well with entities without requiring DTDs.
A: Because html(Parse|Read)Doc ignore namespace declarations.
Q: Why don't you ignore namespace declarations when parsing XHTML files?
A: Because XHTML files are XML files. And we need to differentiate XML tags
with and without namespaces.
Q: Why did you repair XHTML namespaces handling today.
A: Because Fred asked for it yesterday: "je crée un fichier xml, je ne
spécifie pas de namespace, pq l'attribution à l'holder et à l'élément
du namespace xhtml ?".
Q: Did you spent the whole day programming this small feature request?
A: No, I also wrote this FAQ.
2004-05-23 23:13:05 +00:00