xsl-list
[Top] [All Lists]

Re: identity transform - include CDATA's, etc

2003-07-07 09:40:04
This is to continue on david carlisle's thread. I hope it goes to the right place. if not, I hope someone can tell me how to do it right next time.


CDATA sections are not elements they are just syntactic sugar so you can
enter < and & as < and & rather than &lt; and &amp;,
In the Xpath model text may or may not be output using CDATA at the will
of the system, just as it may use " or ' to surround attribute values,
the original markup is not recorded so a stylesheet has no way to
recreate it.


Why do you mind?

the reason I wanted the <![CDATA[]]> to come out in the output is that output of the identity transform is supposed to undergo another xslt transform. it is therefore necessary that the CDATA section beginning and end markers get represented as is, since these sections contain '<' characters.

In case you'll ask why I'm using the identity transform altogether in this case, I hope it will suffice to say that there are logistical reasons relating to the development group in which I work. but I think it would be easy to see how this issue would come up if a person wanted to use a variant of the identity transform and still be able to do another transform afterwards - in fact, it would probably come up any time that a document is meant to be processed in 2 successive transformations. one would want the CDATA section markers to remain intact during the first transformation so that the document will come out right for the second.

_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail


XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list