[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Fwd: xml/xslt line break

Subject: Re: Fwd: xml/xslt line break
From: Taly <urania.muse@xxxxxxxxx>
Date: Sun, 20 Jul 2008 15:18:09 +0300
Re:  Fwd: xml/xslt line break
what I need to change is something from xsl I am reading using xpath -
I called it here :txtTargetTextforchange
can you help?

my xsl looks like that:

<?xml version="1.0" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href="common.xslt"/>
<xsl:output method="html" indent="no"/>
=======================
.
.
.
.<xsl:template match="*" mode="Resp">
<table>
.
.
.<td>
<xsl:value-of select="./txtTargetTextforchange" />&#160;
</td>

.
.
.
===

On Sun, Jul 20, 2008 at 2:32 PM, Martin Honnen <Martin.Honnen@xxxxxx> wrote:
> Taly wrote:
>>
>> I am using version 1.0 thats the problem.I saw a samplw in the web but
>> didn't work for me:
>> http://www.dpawson.co.uk/xsl/sect2/break.html#d3080e76
>> perhaps I donno ow to use call-template the way I should
>
> It is not possible to guess where your attempts failed. You will need to
> show us your XML input and your stylesheet trying to process that.
> Perhaps this example helps, the XML is
>
> <root>
>  <foo>Line 1
> Line 2
> Line 3</foo>
> </root>
>
> the stylesheet, incorporating the template from the FAQ looks as follows:
>
>  <xsl:stylesheet
>    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>    version="1.0">
>
>  <xsl:output method="html" indent="yes"/>
>
>  <xsl:template match="/root">
>    <html>
>      <head>
>        <title>Example</title>
>      </head>
>      <body>
>        <xsl:apply-templates/>
>      </body>
>    </html>
>  </xsl:template>
>
> <xsl:template name="substitute">
>   <xsl:param name="string" />
>   <xsl:param name="from" select="'&#xA;'" />
>   <xsl:param name="to">
>      <br />
>   </xsl:param>
>   <xsl:choose>
>      <xsl:when test="contains($string, $from)">
>         <xsl:value-of select="substring-before($string, $from)" />
>         <xsl:copy-of select="$to" />
>         <xsl:call-template name="substitute">
>            <xsl:with-param name="string"
>                            select="substring-after($string, $from)" />
>            <xsl:with-param name="from" select="$from" />
>            <xsl:with-param name="to" select="$to" />
>         </xsl:call-template>
>      </xsl:when>
>      <xsl:otherwise>
>         <xsl:value-of select="$string" />
>      </xsl:otherwise>
>   </xsl:choose>
> </xsl:template>
>
>  <xsl:template match="foo">
>    <div>
>      <xsl:call-template name="substitute">
>        <xsl:with-param name="string" select="."/>
>      </xsl:call-template>
>    </div>
>  </xsl:template>
>
> </xsl:stylesheet>
>
> the result then is
>
> <html>
>   <head>
>      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
>
>      <title>Example</title>
>   </head>
>   <body>
>
>      <div>Line 1<br>Line 2<br>Line 3
>      </div>
>
>   </body>
> </html>
>
>
> --
>
>        Martin Honnen
>        http://JavaScript.FAQTs.com/

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2011 All Rights Reserved.