[xsl] Problem solved

Subject: [xsl] Problem solved
From: John Ericson <john@xxxxxxxxxx>
Date: Thu, 1 Nov 2001 20:07:12 +0000
On Nov 01 18:42, Jeni Tennison wrote:
> OK. I don't think you mentioned that requirement before. You're now
> saying that if you have:
>   <info><link>foo</link>    bar baz</info>
> then you want it to give you:
>   foo[1]bar baz
> whereas if you have one whitespace character at the beginning of the
> text node:
>   <info><link>foo</link> bar baz</info>
> then you want a space added to give you:
>   foo[1] bar baz
> Seems a bit strange, but OK. You need to test whether the second

Yes it really does, I can admit that but it makes more sense when you see
the whole xml file. Heres an excerpt of it below. The thing that has 
caused the trouble is the indenting of the file. It gives me spaces before
and after in the info element which I dont want.

	<link url="http://John.pp.se";>John.pp.se</link> är min hemsida där jag presenterar mig själv och vad jag håller på med. Utveckligen sker löpande och jag har lärt mig massor under utvecklingen. På john.pp.se har jag bl.a. gjort:<br/>
	En webb/xml <link url="http://john.pp.se/scripts";>applikation</link> där jag publicerar mina script.<br/>
	En webb applikation för e-mail hantering där man kan läsa och skicka e-mail från flera e-mail konton.

> So the test would be:
>   <xsl:if test="not(normalize-space(substring(., 1, 1))) and
>                 normalize-space(substring(., 2, 1))">
>     <xsl:text> </xsl:text>
>   </xsl:if>
> I hope that's what you were after,

Yes, thats its! I actually managed to throw up some code that did the same
task after I had posted the previous mail, but this one looks much cleaner
so I take this one instead =)

Well, it renders fine now. Thanks for all the help and all the trixes you
have shared with me!

* John Ericson john@xxxxxxxxxx
* ICQ: 7325429 JID: high@xxxxxxxxxx
* web: http://john.pp.se

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread