Line breaks in XSLT formatting documentation (xml)

Our WinForms-based application accepts documentation files created by Visual Studio (Xml documentation), performs some XSLT conversion, and displays the result in a WebBrowser control inside our form.

The problem is that we cannot display line breaks, for example for tags in xml documentation.

For instance:

        <member name="T:Genesys.AgentLoginData">
            <summary>
            This is some test summary <br />
            New line here
            </summary>
        </member>

When used with an XSL transform, the summary text will be truncated into one line.

To simplify, the conversion does this to select the summary text:

<xsl:template match="member" >
<xsl:value-of select="summary" disable-output-escaping="yes" />
</xsl:template>

How can we correctly display newlines in a WebBrowser control inside our application?

EDIT: " " WebBrowser. , , - " " .. .

<?xml version="1.0" encoding="utf-8"?><html xmlns="http://www.w3.org/1999/xhtml"><head><title>Action Help</title><style type="text/css">
          p  {text-indent:200px;}
          li {text-indent:180px;}
          h1 {color:navy;}
          h2 {color:blueviolet}
          h4 {color:navy;}
        </style></head><body><H2 xmlns="">AgentLogin</H2><H1 xmlns=""></H1><h3 xmlns="">
            This is a method 
            And its parameter 
            Check this out
            name</P></body></html>
+5
3

, xml:space="preserve". . http://msdn.microsoft.com/en-us/library/aa468566.aspx , XSL .net.

, -, , HTML. , , .

, , , xsl: value-of, node xsl: copy-of, node <br/>. :

<xsl:value-of select="summary" disable-output-escaping="yes" />

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

- <br/>, , node, disable-output-escaping.

+4

<xsl:value-of> <xsl:copy-of>.

<xsl:value-of> , select. ( <br/> ).

`<xsl:copy-of> node -set, select.

:

<xsl:template match="member" >
  <xsl:value-of select="summary" disable-output-escaping="yes" />
</xsl:template>

<xsl:template match="member" >
  <xsl:copy-of select="summary/node()"/>
</xsl:template>
+2

, xml, html .

http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references

to try

    <member name="T:Genesys.AgentLoginData">
        <summary>
        This is some test summary &lt;br /&gt;
        New line here
        </summary>
    </member>
+1
source

All Articles