|
Subject: Re: [xsl] removing trailing space for all the elements From: George Cristian Bina <george@xxxxxxxxxxxxx> Date: Thu, 11 Dec 2008 12:07:56 +0200 |
<xsl:template match="node() | @*">
<xsl:copy>
<xsl:apply-templates select="node() | @*"/>
</xsl:copy>
</xsl:template><xsl:template match="node() | @*">
<xsl:copy>
<xsl:apply-templates select="node() | @*"/>
</xsl:copy>
</xsl:template><xsl:template match="text()" priority="1">
<xsl:value-of select="normalize-space(.)"/>
</xsl:template>Best Regards, George -- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com
Hi All,
I need to remove trailing space for all the elements. Any help appreciated.
Input:
<?xml version="1.0"?> <Toc> <a> Say you want display this <emph type="b"> data</emph> in the form of a sequentially numbered booklist.</a> </Toc>
Expected Output:
<?xml version="1.0"?> <Toc> <a>Say you want display this <emph type="b">data</emph> in the form of a sequentially numbered booklist.</a> </Toc>
Tried Coding:
<xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform version="1.0">
<xsl:template match="*|@*"> <xsl:copy> <xsl:apply-templates select="normalize-space(*)"/> </xsl:copy> </xsl:template>
</xsl:stylesheet>
For the above style sheet I'm getting error "apply-templates expected node()" and I'm using saxon version 8.
Thanks in advance, Balaji. M
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| [xsl] removing trailing space for a, M Balaji | Thread | RE: [xsl] removing trailing space f, Michael Kay |
| RE: [xsl] Generating ID key values, Trevor Nicholls | Date | [xsl] Relative/Absolute path querie, peter verhaar |
| Month |