Re: [xsl] Preserving CDATA sections?

Subject: Re: [xsl] Preserving CDATA sections?
From: Graydon <graydon@xxxxxxxxx>
Date: Sat, 15 Dec 2012 20:04:24 -0500
On Sun, Dec 16, 2012 at 12:41:27AM +0000, David Carlisle scripsit:
> On 15/12/2012 17:06, Dan Vint wrote:
> >There is a node test for it so it should work like a comment without the
> >restriction of nested comments
> No but with the restriction on nested PI's (you can't have the text
> ?> as a substring of the value of a PI) so they are not really much
> more flexible than comments, just changing the problem characters
> from -- to ?>.

As I recall, you might want to recover the contents as nodes. 

If that is the case, don't do something that converts it to a string,
whether the string contents of the processing instruction or the string
contents of a comment.

*Something* will happen in there, some of the time, as the content is
exposed to editors.  A cut-and-paste operation will go awry, someone
will make a note to themselves, something.  And since it's just a
string, there won't be any kind of automated checking.

And then you will try to unwind it back into markup and something
inexplicable and awful will happen to that process, and you'll have to
find it and fix it, over and over again.

Ken's "sacrificial foreign namespace" solution really is much less work
in the long run.

-- Graydon

Current Thread