Subject: Re: [xsl] broken text surrounding an entity I want to drop? From: "Joris Gillis" <roac@xxxxxxxxxx> Date: Tue, 13 Sep 2005 09:07:34 +0200 |
My source XML file contains a myriad of <A id=something></A> entities which for the most part I wish to drop. I am using an identity template plus the following to do this:
----- <!-- drop A tags which have no content --> <xsl:template match="A"> <xsl:if test="* or text() or string(.)"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:if> </xsl:template> -----
Unfortunately and unsurprisingly this is too naC/ve; it drops the <a> tags OK but leaves me with broken text.
<xsl:template match="text()"> <xsl:value-of select="normalize-space(.)"/> </xsl:template>
regards, -- Joris Gillis (http://users.telenet.be/root-jg/me.html) B+Et ipsa scientia potestas estB; - Francis Bacon , Meditationes sacrae
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] broken text surrounding an en, Trevor Nicholls | Thread | RE: [xsl] broken text surrounding a, Michael Kay |
Re: [xsl] Preserve some tags, but i, Joris Gillis | Date | RE: [xsl] Is it possible to modify , Michael Kay |
Month |