Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Whitespace content...

From: exemell.com user <webuser@-------.--->
To: NULL
Date: 12/2/2004 8:45:00 AM
Thanks Neil

The xhtml content is processed in a xsl:copy-of statement.

I've managed to get my line breaks in using the xsl below

<xsl:template name="break">
		<xsl:param name="text" />
		<xsl:choose>
			<xsl:when test="contains($text, '&#xd;')">
				<xsl:copy-of select="substring-before($text, '&#xd;')"/><br />
				<xsl:call-template name="break">
					<xsl:with-param name="text" select="substring-after($text,'&#xd;')"/>
				</xsl:call-template>
			</xsl:when>
			<xsl:otherwise>
				<xsl:copy-of select="$text" />
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>

However because I an reading the inner text I am losing all markup! I need a way of retaining markup and inserting <br />s in place of &#xd;

Wole


Neil Smith [MVP Digital Media] wrote:

>Wouldn't you usually have a template which specifically processes <td>
>elements in the XHTML and does your insertion of <br /> -- so it gets
>used only inside <td> elements ?
>
>Cheers - Neil
>
>On Wed, 01 Dec 2004 23:24:36 GMT, "Wole Ogunremi"
><wole.ogunremiNO@S...> wrote:
>
>>I've got xhtml content in a xml document and I'm using xsl to output html.
>>I need a way of getting the output throw in breaks where they occur rather 
>>than one continous piece of text
>>I know I could use <PRE> tags but it is awful when you have really long 
>>paragraphs...
>>I tried replacing crlf with <br/> which is OK for text but not so good when 
>>the content includes html tags! (<table><br/><tr><br/>...)
>>
>>I've tried using xml:space="preserve", tried <xsl:preserve-space 
>>elements="elementName"> with no luck.
>>
>>Could anyone advise on how to go about doing this?
>>
>>I am using system.xml.xsl.xsltransform.
>>
>>Many thanks
>>Wole 
>>
>
>
>==========
Posted at http://www.exemell.com/


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent