This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: using identity transform to change <p /> into <p>text</p>


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]