Re: Serialize Component

On 1/31/07, Innovimax SARL <innovimax@gmail.com> wrote:
>
> So I understand that you keep the root and all its attributes, but
> serialize all
> so
> "<!--comment--><root><a/></root>"
> would give
> "&lt;--comment--&gt;<root>&lt;a/&gt;</root>"
>
> which is ill formed



Yeah.  I forgot a part on the parse component.  The parse component needs
to have the ability to define a wrapper element so that you can do the
inverse of this operation.

In smallx I allow an optional wrapper element and default namespace so you
can handle
escaped XHTML chunks.  Effectively you wrap the string of characters with
"<root xmlns='...'>" and "</root>" and then remove the 'root' element.

This is all really to handle unescaping things like the RSS description
element.



-- 
--Alex Milowski
"The excellence of grammar as a guide is proportional to the paucity of the
inflexions, i.e. to the degree of analysis effected by the language
considered."

Bertrand Russell in a footnote of Principles of Mathematics

Received on Wednesday, 31 January 2007 22:01:55 UTC