2011-01-21 69 views
-1
<w:p w:rsidR="00EF034A" w:rsidRDefault="004165FE"> 
<w:proofErr w:type="gramStart"/> 
<w:r> 
<w:t>one</w:t> 
</w:r> 
<w:proofErr w:type="gramEnd"/> 
<w:r> 
<w:t xml:space="preserve">   11  8    15</w:t> 
</w:r> 
</w:p> 
<w:p w:rsidR="004165FE" w:rsidRDefault="004165FE"> 
<w:r> 
<w:t>two        31</w:t> 
</w:r> 
</w:p> 

大家好, 我需要一个指导编写XSLT模板重现节点相同的内容(W:T)在我的HTML输出(之间空格) 。当我拿这个节点(w:t)的内容时,输出html中缺少空格。请帮助我。提前感谢需要处理空格在XML到HTML

+0

可能的相关/重复问题:http://stackoverflow.com/questions/3839730/xsl-output-method-text-including-whitespaces-in-xsl http://stackoverflow.com/questions/2724522/xsl-忽略-my-whitespace-even-the-xsltext-tag http://stackoverflow.com/questions/3570280/question-about-xmlelement-innertext-and-whitespace – carols10cents 2011-01-21 14:31:24

回答

0

您需要提供更多详细信息,我想你想要

<xsl:template match="w:t"> 
    <span style="white-space: pre;"> 
    <xsl:value-of select="."/> 
    </span> 
</xsl:template> 

确保HTML不会折叠之间的任何空格。