A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.mail-archive.com/html5lib-discuss@googlegroups.com/msg00057.html below:

About the serializer, filters and tree walkers...

For those of you who, like me, don't read html5lib-commits, I've
started a branch (treewalking-serialization) to experiment this new
"treewalking way".
2007/6/12, Sam Ruby:
>
> > I know there are precedents: SAX first, but also xmlpull, python's
> > xml.dom.pulldom and .NET's XMLReader.
>
> Those aren't so much filters as sources.

What about Python's xml.sax.saxutils.XMLFilterBase and Java's
org.xml.sax.XMLFilter?

And you can also implement a .NET XmlReader which filters another
XmlReader, or an Java XMLPull filtering another XMLPull, etc.

> Why can't genshistream or pulldom simply be a tokenizer?

They can, but then they would be called "adaptors", not "tree walkers"
(because they're already streams, not trees).

And if you want to serialize them as HTML (or XHTML) and be assured
the output is wellformed, you must trust that the stream itself is
kind of "wellformed", and who can trust the stream when it could have
been filter multiple times?

> Part of the premise of HTML5 is that the general case of building a
> well-formed result from a stream of tokens requires building a tree,
> complete with adoption agency algorithms and vodoo modes.

Hence my proposal to use true treewalkers (with wellformedness
guarantee) for serialization rather than streams of tokens.
Are you saying that it's the programmers responsibility to build a
tree from a stream of tokens  and then use a treewalker which he
trusts for serialization? If the source is already a treewalker,
you're building a copy of the tree, just because you don(t trust the
output.
With my proposal, you don't have to trust the input, because the
serializer is the "main controller" (see my first experiments in
serializer.py and treewalkers/_base.py in the
treewalking-serialization branch)

-- 
Thomas Broyer

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"html5lib-discuss" group.
 To post to this group, send email to html5lib-discuss@googlegroups.com
 To unsubscribe from this group, send email to [EMAIL PROTECTED]
 For more options, visit this group at 
http://groups.google.com/group/html5lib-discuss?hl=en-GB
-~----------~----~----~----~------~----~------~--~---


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4