Subject: RE: [xsl] Re: Restrict Mixed Content From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Tue, 11 Jan 2005 12:03:04 -0500 |
> 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>
<Q> <X> ... stuff ... </X> <Y> ... stuff ... </Y> <Z> ... stuff ... </Z> </Q>
<!-- ignore everything --> <xsl:template match="*" />
<!-- by default, pass everything without copying (though since this template is built in it doesn't have to be included literally) --> <xsl:template match="*"> <xsl:apply-templates/> </xsl:template>
<!-- by default, suppress text nodes (wanted text nodes are picked up in 'copy' mode --> <xsl:template match="text()"/>
<xsl:template match="X|Y|Z"> <xsl:copy> <xsl:apply-templates mode="copy" select="*|*@" /> <xsl:copy> </xsl:template>
Cheers, Wendell
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Re: Restrict Mixed Conten, Mark Lundquist | Thread | [xsl] Use predicates/patterns or xs, christof.hoeke |
RE: [xsl] Re: Restrict Mixed Conten, Mark Lundquist | Date | RE: [xsl] Multiple IDs, Michael Kay |
Month |