This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: using identity transform to change <p /> into <p>text</p>
- From: "Michael Kay" <michael dot h dot kay at ntlworld dot com>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Wed, 8 May 2002 15:31:10 +0100
- Subject: RE: [xsl] using identity transform to change <p /> into <p>text</p>
- Reply-to: xsl-list at lists dot mulberrytech dot com
Depending on the exact details of your source document, you might be able to
do this with
<xsl:template match="section/text()">
<p><xsl:copy-of select="."/></p>
</xsl:template>
<xsl:template match="section/p[not(node())]"/>
<xsl:template match="p">
<xsl:copy-of select="."/>
</xsl:template>
Michael Kay
Software AG
home: Michael.H.Kay@ntlworld.com
work: Michael.Kay@softwareag.com
> -----Original Message-----
> From: owner-xsl-list@lists.mulberrytech.com
> [mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of Zack Brown
> Sent: 08 May 2002 15:03
> To: xsl-list@lists.mulberrytech.com
> Subject: [xsl] using identity transform to change <p /> into
> <p>text</p>
>
>
> Hi folks,
>
> I have a bunch of files with the following form:
>
> --------------------------------------------------------------
> <section>
>
> first paragraph.
>
> <p />
>
> second paragraph.
>
> <p />
>
> third paragraph.
>
> <p />
>
> fourth paragraph.
>
> </section>
>
> <section>
>
> <p>paragraph not to change</p>
>
> <p>another good paragraph</p>
>
> </section>
> --------------------------------------------------------------
>
> Is there a way to use the identity transform (or anything else) to
> change that to
>
> --------------------------------------------------------------
> <section>
>
> <p>first paragraph.</p>
>
> <p>second paragraph.</p>
>
> <p>third paragraph.</p>
>
> <p>fourth paragraph.</p>
>
> </section>
>
> <section>
>
> <p>paragraph not to change</p>
>
> <p>another good paragraph</p>
>
> </section>
> --------------------------------------------------------------
>
> Thanks,
> Zack
>
> --
> Zack Brown
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list