[xmlenc-devel] VOID_WITHIN_ELEMENT and short-circuiting
Brought to you by:
znerd
From: Ernst de H. <znerd@FreeBSD.org> - 2003-01-10 21:14:53
|
Hey, A while ago I've mentioned adding the state VOID_WITHIN_ELEMENT. This state would be entered when for example pcdata("") would be called in the state START_TAG_OPEN. This would make it possible to output a combined start/end tag instead of separate start/end tags. Example: startTag("html"); attribute("lang", "en"); pcdata(""); endTag(); Currently (xmlenc 0.21) this would produce the following XML: <html lang="en"></html> But when VOID_WITHIN_ELEMENT is fully supported, then this would produce: <html lang="en"/> Reconsidering this, I think I should not pursue this any further and remove all evidence I ever did. It's just getting away from simplicity. The same applies to the short-circuiting when an empty string is printed. For example, currently (xmlenc 0.21) the following code: startTag("head"); comment(""); startTag("title"); produces the following XML: <head><title> instead of the (perhaps expected): <head><!----><title> I see no good reason to _keep_ the old behaviour. It's again conflicting with the principle of simplicity. Ernst -- Ernst de Haan Development Team Leader Wanadoo Nederland B.V. The Lord has truly risen! Merry Christmas and a blessed New Year! |