RE: [xsl] Re: Restrict Mixed Content

Subject: RE: [xsl] Re: Restrict Mixed Content
From: "Mark Lundquist" <ml@xxxxxxxxxxxxxx>
Date: Tue, 11 Jan 2005 08:33:39 -0800
I think the phrase "mixed content" in your subject is confusing me.  At any
rate...

> From: Edgar Steven [mailto:edgar_steven@xxxxxxx]
>
> The source is coming from MS Word documents.  I only want to be
> able to use
> data such as bullets, lists, and tables.  All other elements I
> would like to
> ignore like graphs, images, etc.

Something like this...

	<!-- ignore everything -->
	<xsl:template match="*" />

	<!-- ...except for elements X, Y and Z -->
	<xsl:template match="X|Y|Z">
	  <xsl:copy>
		<xsl:apply-templates mode="copy" select="*|*@" />
  	<xsl:copy>
	</xsl:template>

	<xsl:template match="*|*@|text()" mode="copy" />
	   <xsl:copy/>
	<xsl:template>

cheers,
mark

Current Thread