On 3 Dec 2009, at 19:56, Levi Stanley <l...@eneservices.com> wrote:
I was thinking about trying to incorporate phptal dom into my
filters, however does this page (http://phptal.org/manual/en/split/phptal-dom.html
) still apply, or has there been some changes to the dom since I
last checked? I remember there was some discussions about using
another dom in its place because it gave more functionality, but
don't remember if there was anything different that changed or not.
It still applies. It's new actually.
I've looked into replacement of dom, even wrote experimental
implementation (another one after Rodrigo's prototype), and the
verdict is that it's not going to work well. At least not yet.
PHPTAL parser preserves more information than w3c DOM, e.g. exact
entities, <?php?> blocks in attributes (different than <?php).
Before PHP 5.3 you couldn't even get line numbers.
PHPTAL's parser is also more preserving (cdata) and forgiving. It
turns out that strict XML parser would get annoying quickly (DOCTYPE
and 4 xmlns declarations required in almost every file, even most
harmless '&' must be escaped, etc.)
In 1.2 I've improved namespace handling and made phptal's dom
more aligned with w3c's. I've also separated document builder and
parser, so it'll be easier to jump to w3c dom eventually.
Short term it should be possible to use phptal's parser to build w3c
dom for filters and then convert it to phptal's dom for further
processing. I haven't implemented that yet.
What methods do you need? Maybe small extension of phptal's dom will
PHPTAL mailing list