Subject: Re: [xsl] CDATA again From: David Carlisle <davidc@xxxxxxxxx> Date: Fri, 11 Feb 2005 11:28:16 GMT |
This is a FAQ. > I need to produce output where some of the input node are inside a valid > CDATA comment. You can't have nodes inside a CDATA section, you can only have character data (hence the name). You want to generate <targetGroup markup="yes"> <![CDATA[ <ul> <li>PK Bestandskunden (Postpaid+Prepaid)</li> <li>Neukunden</li> ... ]]> </targetGroup> That is exactly the same thing as You want to generate <targetGroup markup="yes"> <ul> <li>PK Bestandskunden (Postpaid+Prepaid)</li> <li>Neukunden</li> ... </targetGroup> It's just a syntactic variation just as <a x="2/> and <a x = '2' /> are syntactic variantions, that you don't directly control from XSLT. Do you need a template mopde that writes out the character data corresponding to the tags so <xsl:template match="*" mode="x"> <xsl:text><</xsl:text> <xsl:value-of select="name()"/> <xsl:text><</xsl:text> <xsl:apply-templates mode="x"/> <xsl:text></</xsl:text> <xsl:value-of select="name()"/> <xsl:text><</xsl:text> </xsl:template> More complete examples, handling attributes etc are in the faq or archives of this list. David ________________________________________________________________________ This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] CDATA again, Joe Fawcett | Thread | RE: [xsl] CDATA again, Michael Kay |
Re: [xsl] aborting element creation, M. David Peterson | Date | Re: [xsl] aborting element creation, M. David Peterson |
Month |