2011-01-21 74 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不會摺疊之間的任何空格。