Subject: RE: Difference between <when>x</when> and <when><text>x</text></when>
From: "Markus Karg" <karg@xxxxxxxxx>
Date: Sun, 21 Mar 2010 08:30:02 +0100
|
Hermann,
thanks a lot for this tip!
In fact you might ask yourself why I need it. The reason is: Actually I had
<when>x</when>, but Eclipse (even the latest one) reformats it by instering
breaks when using "Source > Format"...
Thanks!
Markus
> -----Original Message-----
> From: Hermann Stamm-Wilbrandt [mailto:STAMMW@xxxxxxxxxx]
> Sent: Samstag, 20. Mdrz 2010 16:22
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: RE: Difference between <when>x</when> and
> <when><text>x</text></when>
>
> Markus,
>
> if yo want to remove the spaces for all <when> and <otherwise> entries
> you
> can
> do this by having the complete <choose> inside a <xsl:variable> and
> then
> call
> normalize-space() once afterwards:
>
> <xsl:variable name="v">
> <xsl:choose>
> <xsl:when test="sometest1">
> x1
> </xsl:when>
> <xsl:when test="sometest2">
> x2
> </xsl:when>
> ...
> <xsl:when test="sometestn">
> xn
> </xsl:when>
> <xsl:otherwise test="sometest">
> x
> </xsl:otherwise>
> </xsl:choose>
> </xsl:variable>
>
> <xsl:value-of select="normalize-space($v)"/>
>
>
> Mit besten Gruessen / Best wishes,
>
> Hermann Stamm-Wilbrandt
> Developer, XML Compiler, L3
> WebSphere DataPower SOA Appliances
> ----------------------------------------------------------------------
> IBM Deutschland Research & Development GmbH
> Vorsitzender des Aufsichtsrats: Martin Jetter
> Geschaeftsfuehrung: Dirk Wittkopp
> Sitz der Gesellschaft: Boeblingen
> Registergericht: Amtsgericht Stuttgart, HRB 243294
>
>
>
> "Markus Karg"
> <karg@xxxxxxxxx>
>
> To
> 03/19/2010 08:37 <xsl-
> list@xxxxxxxxxxxxxxxxxxxxxx>
> AM
> cc
>
>
> Subject
> Please respond to RE: Difference between
> xsl-list@xxxxxxxx <when>x</when> and
> lberrytech.com <when><text>x</text></when>
>
>
>
>
>
>
>
>
>
>
> > Markus Karg wrote:
> >
> > > But actually I meant: Is there a way how I can tell this *once* at
> > the
> > > <choose> or the <stylesheet> level, instead of rewriting all my
> > <when>s?
> >
> > No, I don't think so, there is no
> > xml:space="normalize"
> > or similar value defined that could achieve that.
>
> Anyways, thanks a lot! :-)
> Markus
|