Subject: Re: [xsl] Removing nodes with text content ? From: Torsten Schassan <schassan@xxxxxx> Date: Wed, 03 Aug 2011 17:25:03 +0200 |
I would like to remove the intermediary<phrase> nodes to avoid line breaks (which are highly desirable on other places, but here are annoying me), and thus having everything on a single line (using the docbook stylesheets, already customized).
- to avoid line breaks in the output using normalize-space() is often useful - xsl:strip-space might help as well.
<xsl:template match="phrase[@role='rtf']"> <xsl:copy> <xsl:apply-templates select="./*"/> </xsl:copy> </xsl:template>
<xsl:template match="text()"> <xsl:value-of select="normalize-space(.)"/> </xsl:template>
<xsl:template match="* | @*"> <xsl:copy><xsl:apply-templates select="node() | @*"/></xsl:copy> </xsl:template>
-- Torsten Schassan Digitale Editionen Abteilung Handschriften und Sondersammlungen Herzog August Bibliothek, Postfach 1364, D-38299 Wolfenbuettel Tel.: +49-5331-808-130 (Fax -165), schassan {at} hab.de
http://www.hab.de/forschung/projekte/europeana-regia.htm http://www.hab.de/forschung/projekte/weiss64.htm
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Removing nodes with text , Fabien Tillier | Thread | [xsl] accessing xml elements from c, Mansour Al Akeel |
RE: [xsl] Removing nodes with text , Fabien Tillier | Date | [xsl] accessing xml elements from c, Mansour Al Akeel |
Month |