On Jun 28, 2006, at 02:27, James M Snell wrote:
That is, what is the exact behavior that a library must perform when a code library has an API like, "getContent" on the content element.
One sane behaviour is to return an org.w3c.dom.DocumentFragment with the deep copies of the children of the namespace div with the xml:base and xml:lang context pushed down on each child.
That's a bit awkward, so I guess using a placeholder root element with the xml:base and xml:lang context would make sense, provided that the API doc says that the root is not part of the logical content. This could be emphasized by using a root in a private namespace instead of an XHTML div. (Just to be obnoxious enough to make sure users of the API take note. :-)
Or, alternatively, the API could construct a full XHTML nu.xom.Document or org.w3c.dom.Document and thereby unify the return value for type="application/xhtml+xml", type="text/html", type="xhtml" and type="html". (Assuming, that is that the library runs TagSoup and automatically converts HTML to XHTML.) Actually, I think this would be the best way.
In any case, returning a String as the value of the content means that the library is not fully doing its job when the logical value is an XML document fragment.
-- Henri Sivonen [EMAIL PROTECTED] http://hsivonen.iki.fi/