Subject: Re: cdata was: XSL and HTML From: David Carlisle <davidc@xxxxxxxxx> Date: Thu, 14 Jan 1999 17:55:44 GMT |
> In a transformation how would you produce CDATA You can't produce `CDATA' because there is no such thing as CDATA. CDATA is a flag to a parser to use different rules, but the parsed result should be the same: character data. I can write `a' or <![CDATA[a]]> anywhere in my document and I should get the same document tree. You get ___normal___ character data inside a CDATA marked section. The only way to change this is, as Oren said in his reply, to change this and make <![CDATA no longer just a parser flag, but to really generate a new type of node in the parsed result. (This is what happens in the DOM). This seems to be rather bad as far as I can see. Traditionally, if say I had a paragraph that had a lot of < and & in the text, then I may chose to stick a CDATA section around the whole paragraph, or just around the parts of the text that contain the & or <, or I might not bother with CDATA at all, and just use & and <. As an author I _know_ I am free to do whichever of these I want as I know that they all produce exactly the same result, and so anyone else using the text (eg searching in it) doesn't need to know _which_ parsing trick I used to get the `&' into the document, only that they got there somehow. If you introduce a new CDATA node type just for the dubious benefit of saying that you want some particular characters to be linearised in a certain way, then you have lost this facility. Now if you are looking for A&B do you look for a CDATA section containing A&B, or A followed by a CDATA section containing &, or A followed by an amp entity? Having the parser produce the same thing from all these things is a _feature_ so making it distinguish them by adding new node types is a loss of functionality. (Well it's not lost, but you have to layer something over the new tree, removing all the spurious stuff). David PS I'm replying since you prefaced your question with `Hi David.' but I'm really scared posting about arcane SGML details on a list that I know is being monitored by people like PP and JC. I'm really a TeX person you know.... XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: cdata was: XSL and HTML, Guy_Murphy | Thread | Re: cdata was: XSL and HTML, Guy_Murphy |
RE: Feature Request: OtherNodeExpr:, Lawton, Scott | Date | RE: Still a Newbie , Still got ques, carlton . e . noles |
Month |