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

Re: Returning HTML tags from a function not working

Subject: Re: Returning HTML tags from a function not working
From: Agnisys <agnisys@xxxxxxxxx>
Date: Thu, 26 Jan 2006 14:31:48 -0800 (PST)
disable output escape
Instead of substituting '\n' with <br /> I had to substitute it with <!CDATA[<br />]].

Then in the calling <xsl:value-of > I had to set attribute disable-output-escape="true".

This seems to work, but it says that the attribute "disable-output-escaping" is deprecated. I'm
not sure what the non-deprectaed method would be.

Anupam.


--- Agnisys <agnisys@xxxxxxxxx> wrote:

> Hi,
>   I'm using Saxson XSLT 2.0 on a Linux system. 
> 
> Input looks like this:
> 
> <doc>
>  Some text that can be 
>  Multiline. It can also have lots of     spaces.
> </doc>
> 
> The Output of XSL is set to HTML.
> 
> I need the output to retain the newlines but retain the spaces.
> 
> So I want the HTML to look like:
> -----------------------------------------------
> Some text that can be 
> Multiline. It can also have lots of spaces.
> -----------------------------------------------
> 
> Here is my function, but somehow the <br /> vanishes from the HTML and so I get one line only.
> <xsl:function name="xrsl:printdoc" as="xs:string*">
>   <xsl:param name="docnode" as="element()?"/>
>   <xsl:if test="$docnode[1]">
>     <xsl:analyze-string  select="$docnode[1]" regex="\n">
>       <xsl:matching-substring><br /></xsl:matching-substring>
>       <xsl:non-matching-substring>
>         <xsl:value-of select="normalize-space(.)"/>
>       </xsl:non-matching-substring>
>     </xsl:analyze-string>             
>   </xsl:if>
> </xsl:function>
> 
> Please help!
> Thanks,
> Anupam.
> 
>  
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.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-2013 All Rights Reserved.