Subject: Re: [xsl] normalize-space and sequence From: Abel Braaksma <abel.online@xxxxxxxxx> Date: Thu, 27 Sep 2007 11:09:52 +0200 |
On 9/27/07, Abel Braaksma <abel.online@xxxxxxxxx> wrote:
Maybe I totally misunderstood your question, but if I did, please
respond with a tiny example of what you are after: a small but working
xslt document, a small input and a small output xml document, plus an
extra output xml containing what you want different. You know, with xml
it is like with pictures: one xml says more than a thousand words, but
thousand xmls (or very large ones) say nothing. ;)
Hi Abel,
Thanks again for your help. I think I have rewritten what happen in a shorter example:
http://gdcm.svn.sourceforge.net/viewvc/gdcm/Sandbox/xslt/ws.xml and http://gdcm.svn.sourceforge.net/viewvc/gdcm/Sandbox/xslt/ws.xsl
Could you please let me know how to fix the following:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:output method="xml" indent="yes" encoding="UTF-8"/> <xsl:template match="@*"> <xsl:attribute name="{name()}" select="normalize-space(.)"/> </xsl:template> <xsl:template match="text()"> <xsl:value-of select="normalize-space(.)"/> </xsl:template> <xsl:template match="/"> <xsl:apply-templates select="*"/> </xsl:template> <xsl:template match="table"> <table> <xsl:apply-templates/> </table> </xsl:template> <xsl:template match="entry/para"> <entry ie="{.}"/> </xsl:template> </xsl:stylesheet>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:output method="xml" indent="yes" encoding="UTF-8"/>
<!-- whitespace correction templates --> <xsl:template match="@*" mode="correct-ws"> <xsl:attribute name="{name()}" select="normalize-space(.)"/> </xsl:template>
<xsl:template match="text()" mode="correct-ws"> <xsl:value-of select="normalize-space(.)"/> </xsl:template>
<xsl:template match="/" mode="correct-ws"> <xsl:variable name="output"> <xsl:apply-templates select="*"/> </xsl:variable> <xsl:apply-templates select="$output/*" mode="correct-ws" /> </xsl:template>
<!-- normal templates --> <xsl:template match="table"> <table> <xsl:apply-templates/> </table> </xsl:template>
<xsl:template match="entry/para"> <entry ie="{.}"/> </xsl:template>
Cheers, -- Abel Braaksma
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] normalize-space and seque, Mathieu Malaterre | Thread | Re: [xsl] normalize-space and seque, David Carlisle |
Re: [xsl] Is the following xml file, Abel Braaksma | Date | Re: [xsl] normalize-space and seque, David Carlisle |
Month |