2012-03-02 45 views
1
<xsl:template match="book"> 
    <html> 
    <head> 
     <style type="text/css"> 
      hr{height:1px;border:0;color: #ed1b2d;background-color: #ed1b2d;} 
     </style> 
    </head> 
     <body><table cellpadding="0" cellspacing="0" width="786" align="center"><tr><td><xsl:apply-templates/></td></tr></table></body> 
    </html> 
</xsl:template> 
<xsl:template match="booktable"> 
    <table cellpadding="2" cellspacing="2"><xsl:apply-templates/></table> 
</xsl:template> 
<xsl:template match="bookrow"> 
    <tr><xsl:apply-templates/></tr> 
</xsl:template> 

- >在這裏,我需要添加id屬性匹配,因爲它在它的內容...是在java中有可能XSL解析用java

+0

這不是一個明確定義和有意義的問題。請編輯問題並添加:1.示例(小)源XML文檔。 2.樣本(完整和小型)XSLT轉換。 3.確切的想要的結果。 4.你從你的轉變中得到的結果。 5.描述轉換必須執行的所有要求。 – 2012-03-02 14:46:16

回答

3

XSL是XML,所以任何XML解析器API可用過的。在Google上搜索JAXP和DOM。

+0

Pangea:謝謝你的幫助 – 2012-03-02 06:12:44

+0

CAn你可以看到任何樣品親愛的..這個新的.. – 2012-03-02 06:13:25

+0

@HarishSaran - 閱讀本教程http://dcm.uhcl.edu/yue/courses/xml/notes/xmlparser/ IntroDOM.asp – 2012-03-02 06:16:29