Subject: Re: [xsl] FW: Dealing with mixed content From: "Joris Gillis" <roac@xxxxxxxxxx> Date: Tue, 15 Feb 2005 19:47:34 +0100 |
Hello,Hi,
Apologies inadvance for the 'XSL 101' nature of this question but I'm new to
XSL.
I receive XML from an automate conversion process, over which I have no control.
Example:
<block >Text <font font-weight="bold">more text</font> more text<sr/>more text. <hr/>more text <sr/>more text.</block>
The <sr/> elements can be ignored but the <hr/> element indicates that an exisitng <P> element should be terminated and a new <P> element started.
From the above sample the output would be:
<P>Text <f>more text</f> more text more text. </P> <P>more text more text</P>
<xsl:template match="block"> <xsl:copy> <xsl:for-each select="hr|."> <p> <xsl:apply-templates select="key('group',generate-id())"/> </p> </xsl:for-each> </xsl:copy> </xsl:template>
<xsl:template match="font"> <f> <xsl:apply-templates/> </f> </xsl:template>
regards, -- Joris Gillis (http://www.ticalc.org/cgi-bin/acct-view.cgi?userid=38041) Spread the wiki (http://www.wikipedia.org)
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] FW: Dealing with mixed conten, Paul Clarke | Thread | RE: [xsl] FW: Dealing with mixed co, Paul Clarke |
[xsl] FW: Dealing with mixed conten, Paul Clarke | Date | Re: [xsl] Bug in Schema for XSLT 2., Dimitre Novatchev |
Month |