开发者

Issue with XSLT line-break

I'm having a problem. How can I instruct my XSLT to insert a new line?

Here's an example of my XML:

<message>Hello World!!! \r\n How You G开发者_如何学Cuys Doing?!?</message>

or:

<message>Hello World!!! <br /> How You Guys Doing?!?</message>

and here's the XSL:

<html><body><xsl:valeof select="message"/></body></html>


Assuming the input

<message>Hello World!!! <br /> How You Guys Doing?!?</message>

it should suffice to use

<xsl:copy-of select="message/node()"/>

in your XSLT. Replacing \r\n is more difficult, at least in XSLT 1.0. See http://www.dpawson.co.uk/xsl/sect2/N7240.html#d10122e406 for a possible approach.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜