[Home] [By Thread] [By Date] [Recent Entries]
Hi everybody,
Some time ago there was a discussion[1] on the W3C XHTML mailing list
about the content type of XHTML fragments. That discussion made me
wonder if it wouldn't be better to have a more generic solution, one
that covers all XML dialects.
I've read the W3C XML Fragment Interchange Candidate Recommendation[2],
which I've never seen implemented (that may just be because I'm
ignorant.) The specification seems verbose, and is therefore in my
opinion unfit as a generic way of transferring XML fragments.
What I think would be optimal is a simple, encapsulating root element in
the XML namespace, such as this:
<xml:fragment xmlns="http://www.w3.org/1999/xhtml">
<li>Foo</li>
<li>Bar</li>
<li>Baz</li>
</xml:fragment>
Such a document could be sent with a content type other than */xml,
maybe */xml-fragment. That would allow the receiving application to
treat the document as a DocumentFragment instead of a Document
(DOM-wise), which would make the insertion of the fragment much easier.
Instead of having to extract the children of a received document and
then insert it into the local document, one can just insert the received
DocumentFragment. I hope that my idea of DocumentFragment corresponds to
yours.
I posted this message to xml-dev because I'd like to get some feedback,
and maybe further develop this, though I'd like like to keep it as
simple as possible.
Cheers,
Daniel Schierbeck
[1]: http://lists.w3.org/Archives/Public/www-html/2006Jan/0031.html
[2]: http://www.w3.org/TR/xml-fragment
|

Cart



