|
Subject: Re: [xsl] Move leading/trailing spaces outside (XSLT 2.0) From: Yves Forkl <Y.Forkl@xxxxxx> Date: Tue, 06 Feb 2007 16:54:03 +0100 |
You can make this easier by doing it in one pass:
<xsl:analyze-string select="." regex="^\s+|\s+$"> ....
Greedy matching (which it is always) will ensure that the matching-substring is always either the leading or the trailing. Non-matching-substring is always the middle part.
<xsl:template match="e">
<xsl:analyze-string select="." regex="^\s+|\s+$">
<xsl:matching-substring>
<xsl:value-of select="."/>
</xsl:matching-substring>
<xsl:non-matching-substring>
<e><xsl:value-of select="."/></e>
</xsl:non-matching-substring>
</xsl:analyze-string>
</xsl:template>| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] Move leading/trailing spa, Abel Braaksma | Thread | Re: [xsl] Move leading/trailing spa, Abel Braaksma |
| Re: [xsl] Move leading/trailing spa, Abel Braaksma | Date | Re: [xsl] Getting the root namespac, Florent Georges |
| Month |