Subject: Re: [xsl] CDATA question From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Wed, 14 Apr 2004 17:35:47 -0400 |
I have the following XML structure, and the extract from the XSLT script which is not producing the desired output. What would be the best way to get desired output?
<xsl:....cdata-section-elements="mattext feedback">
T:\ftemp>type uslu.xml <tests> <assessment teds-type='T'> <distractor> <para>Select the<emphasis>GPO Part Additional Info</emphasis> link in the <emphasis>Navigation</emphasis> screen</para> </distractor> </assessment> <other> <para>Select the<emphasis>GPO Part Additional Info</emphasis> link in the <emphasis>Navigation</emphasis> screen</para> </other> </tests> T:\ftemp>type uslu.xsl <?xml version="1.0" encoding="iso-8859-1"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="distractor | answer"> <xsl:choose> <xsl:when test="(ancestor::assessment[@teds-type = 'M']) or (ancestor::assessment[@teds-type = 'T']) or (ancestor::assessment[@teds-type = 'U'])"> <response_label> <material> <mattext texttype="text/html"> <xsl:apply-templates mode="syntax"/> </mattext> </material> </response_label> </xsl:when> </xsl:choose> </xsl:template>
<xsl:template match="para" mode="syntax"> <xsl:apply-templates mode="syntax"/> </xsl:template>
<xsl:template match="emphasis" mode="syntax"> <xsl:text/><b><xsl:apply-templates/></b><xsl:text/> </xsl:template>
<xsl:template match="@*|node()"><!--identity for all other nodes--> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template>
<!--this cleans up the output when using indent="yes"--> <xsl:template match="text()[not(normalize-space())]" mode="syntax"/> <xsl:template match="text()[not(normalize-space())]"/>
-- Public courses: Spring 2004 world tour of hands-on XSL instruction Each week: Monday-Wednesday: XSLT/XPath; Thursday-Friday: XSL-FO Hong Kong May 17-21; Bremen Germany May 24-28; Helsinki June 14-18
World-wide on-site corporate, govt. & user group XML/XSL training. G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) Male Breast Cancer Awareness http://www.CraneSoftwrights.com/s/bc
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] CDATA question, Michael Kay | Thread | Re: [xsl] CDATA question, David Carlisle |
[xsl] CDATA question, Uslu, Cihan Y (MED) | Date | Re: [xsl] CDATA question, David Carlisle |
Month |