Subject: Re: [xsl] Processing data after an empty tag. From: "Joris Gillis" <roac@xxxxxxxxxx> Date: Tue, 01 Mar 2005 18:07:58 +0100 |
SGML Input Supplied:
<para>
<text> The following is a list <style type="list"></style><style type="para"></style>List Item One.
<style type="para"></style>List Item Two.<style type="para"></style>List Item Three</text>
</para>
XML Output Required:
<para>The following is a list. <itemizedlist> <listitem><para>List Item One</para></listitem> <listitem><para>List Item Two</para></listitem> <listitem><para>List Item Three</para></listitem> </itemizedlist> </para>
This could be treated as a grouping problem. Here's a working solution:
<xsl:template match="para"> <xsl:copy> <xsl:apply-templates/> </xsl:copy> </xsl:template>
<xsl:template match="style[@type='list']"> <itemizedlist> <xsl:apply-templates select="key('listHead',generate-id())"/> </itemizedlist> </xsl:template>
<xsl:template match="style"> <listitem> <xsl:element name="{@type}"> <xsl:apply-templates select="key('listText',generate-id())"/> </xsl:element> </listitem> </xsl:template>
regards, -- Joris Gillis (http://www.ticalc.org/cgi-bin/acct-view.cgi?userid=38041) "Et ipsa scientia potestas est" - Francis Bacon , Meditationes sacrae
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Processing data after an empt, McKinstry, Scott A | Thread | [xsl] XSL-List Guidelines, Mulberry Technologie |
RE: [xsl] Triming in XSLT, Michael Kay | Date | RE: [xsl] Triming in XSLT, Pieter Reint Siegers |
Month |