Subject: Re: [xsl] why no indent here From: Wolfgang Laun <wolfgang.laun@xxxxxxxxx> Date: Mon, 12 Dec 2011 10:08:21 +0100 |
Or your (Symphony) data model isn't appropriate enough as it lacks sufficient detail for expressing what kind of "text" your chunks of text are. For modelling a person's data you'd have fields for name, date of birth, etc. But I think you are trying to model a blog, and for this you might end up with fields like "body" (resulting in an ordinary HTML <p>) OR with another thing "lines" that contains "line" repeatedly. Given <lines> <line>first line</line> ... </lines> it's easy to convert this to <p>first line<br/>...</p> (I'd like to hear some opions from the Wizards on this list: Is it worth doing all this if you can write it in HTML, add a nice CSS and that's it? The "content" isn't going to need much maintenance - at least I can't see it in *this* app. And consider what you have to master either way.) -W On 12 December 2011 09:42, Roelof Wobben <rwobben@xxxxxxxxxxx> wrote: > > > > > ---------------------------------------- > > Date: Mon, 12 Dec 2011 08:35:16 +0000 > > From: tgraham@xxxxxxxxxx > > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > > Subject: RE: [xsl] why no indent here > > > > On Mon, December 12, 2011 7:59 am, Roelof Wobben wrote: > > ... > > > But it don't work well. If I do the <xsl:text> then the sentence after > > > that will be without the line-break. > > > > Sorry, but I didn't understand that. > > > > ... > > > When I have a xml piece of this : > > > > > > <body>Naam : Tamara Wobben > > > Geboorte gewicht : 2000 gram > > > Geboorte lengte : 44 cm. > > > Geboortedatum : 1 september 2005 > > > > > > </body> > > > > > > And I do <xsl:value-of select="body" or I do <xsl:copy-of select="body"> > > > Then all the text will be displayed as this : > > > > > > Tamara Wobben Geboorte gewicht : 2000 gram Geboorte lengte : 44 cm > > > Geboortedatum : 1 september 2005 > > > > > > And not as the text in the xml file. > > > > I expect that the line breaks and extra whitespace are in the XHTML but > > aren't being shown by your web browser: text nodes containing both > > whitespace and non-whitespace text are not stripped, nor stripped of their > > 'extra' whitespace (unless you've slipped in a normalize-space() that you > > haven't told us about, that is). > > > > No, I have give you the exact commands I have used. > > and in the xhtml there are no <br> tags so to my knowlegde the linebreaks are not there. > > > > > > You could output the content in a <pre>, though by default that would come > > out as monospaced text. You could then add CSS styles to use a > > proportionally-spaced font with the <pre> if that's what you want. > > > > If you were using XSLT 2.0, you could use xsl:analyse-string to replace > > the line breaks with <br /> elements. With XSLT 1.0, you could do much > > the same thing with a recursive template that uses substring-before() to > > find the text before the first line break, outputs that text and a <br />, > > then calls itself with the substring-after() the first line break. When > > there's no more line breaks, the template would just output the remaining > > text. > > > Oke, then I have to find or write myself such a recursive template that do that. Symphomny works with xslt 1.0 > > and to my knowlegde there are no plans to switch to xslt 2.0 because Symphony uses the xslt from php. > > > > Regards, > > > > Roelof Wobben
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] why no indent here, Roelof Wobben | Thread | [xsl] What problem are you trying t, Wendell Piez |
RE: [xsl] why no indent here, Roelof Wobben | Date | RE: [xsl] why no indent here, Tony Graham |
Month |