Re: Escaped markup

/ Innovimax SARL <innovimax@gmail.com> was heard to say:
| Sorry I was talking about this
| [[
| <?xml version="1.0"?>
| <?my-funky-pi i prefer to see here?>
| <!-- my prefered first comment-->
| <root attribute-i-like="value-of-attribute" xmlns:my-funky-namespace="funky
| rulez">
|  ...
| </root>
| <!-- my prefered last comment-->
| <?my-funky-pi i prefer to see here?>
| ]]

If you run that through escape-markup, you should get:

<c:result>
&lt;?my-funky-pi i prefer to see here?>
&lt;!-- my prefered first comment-->
&lt;root attribute-i-like="value-of-attribute" xmlns:my-funky-namespace="funky
rulez">
 ...
&lt;/root>
&lt;!-- my prefered last comment-->
&lt;?my-funky-pi i prefer to see here?>
</c:result>

I said before, and I still strongly believe, that it's totally broken
for p:escape-markup not to escape the "root element". It should return
a c:result containing the entire document as a single text node.

Note that it's a bad idea to escape the XML declaration on the source
document because you're not allowed to ever have that as a PI in a
document.

And p:unescape-markup should throw away whatever document element is
provided and return c:result containing the unescaped content, in
other words:

<c:result>
<?my-funky-pi i prefer to see here?>
<!-- my prefered first comment-->
<root attribute-i-like="value-of-attribute" xmlns:my-funky-namespace="funky
rulez">
 ...
</root>
<!-- my prefered last comment-->
<?my-funky-pi i prefer to see here?>
</c:result>

                                        Be seeing you,
                                          norm

-- 
Norman Walsh <ndw@nwalsh.com> | To the man who is afraid everything
http://nwalsh.com/            | rustles.-- Sophocles

Received on Tuesday, 1 May 2007 14:35:37 UTC