<> = Motivation = Generating valid HTML output has proven to be difficult. Because XML is much less forgiving than a browser it might be a good idea to do the harder job first. "Hard work now leads to less work FULLSTOP" -- Alan Cox = Wiki XML = The exact format of Wiki XML is still open. It would be nice to have a !WikiDtd and as an extentions the MoinMoinDtd. See also: WikiXml == DOM tree vs tags == Because we want to reuse the result, the implementation should not be too DOM centric. There is an obvious analogy between generating a text/xml document and build a DOM tree. To make this more clear: || XML document || DOM operation || || process line by line || depth first traversal || || open tag || add node as last child at "current" position node <
> move current position to new node || || close tag || move "current" one node up || With implementation of .new_tag() .close_tag() it should be easy to reuse the code to produce text/xml or text/html. == Ideas/Problems == * Keep stack of all open tags as state (don't use the DOM tree directly for this) * `text

texttext

` must be converted to `text

texttext

` * differ between * "breakable" tags (may be closed and reopened again) * , , * , , , * "unbreakable" tags (reopen creates a new entity we don't want) * * , *
    ,
,
closes and ) * close tag * reinsert collected tags = comments = I do not see the problem with opening and closing tags. Nobody should want to write a new parser. I think there a re a lot of tools that can be embedded that know how to handle. If we use a DTD or a schema all should work by definition. The problem is, is tags are written by a new parser that can not read DTDs or Schemas. -- ThiloPfennig <>