[問題] 有關於xsl的程式

看板Web_Design作者 (ROLL)時間17年前 (2009/02/25 11:52), 編輯推噓0(0010)
留言10則, 4人參與, 最新討論串1/1
最近我在修改別人的程式碼,突然看到一種檔名叫做xsl 後來有稍微在w3c查一下 但是還是不是很懂這個的用處,不過好像是可以用來處理文件的樣子 然後我就照著這個檔案加一些自己的東西 結果遇到一個問題 <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="" rel="nofollow">http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <table id="list_table"> <tr><th>姓名</th><th>修改資料</th><th>刪除</th></tr> <xsl:for-each select="root/user"> <tr> <td><xsl:value-of select="name" /></td> <td> <xsl:element name="a"> <xsl:attribute name="href"> #<xsl:value-of select="uid"/> </xsl:attribute> <xsl:attribute name="onclick"> edit_usr('<xsl:value-of select="uid"/>') </xsl:attribute> <xsl:attribute name="id"> <xsl:value-of select="uid"/> </xsl:attribute> 修改資料 </xsl:element> </td> <td> <xsl:element name="a"> <xsl:attribute name="href"> #<xsl:value-of select="uid"/> </xsl:attribute> <xsl:attribute name="onclick"> delete_user('<xsl:value-of select="uid"/>') </xsl:attribute> <xsl:attribute name="id"> <xsl:value-of select="uid"/> </xsl:attribute> 刪除 </xsl:element> </td> <td> <xsl:element name="input"> ^^^^^^^^^^^^^^^^^^^^^^^^^ <xsl:attribute name="type"> ^^^^^^^^^^^^^^^^^^^^^^^^^^ </xsl:attribute> </xsl:element> </td> </tr> </xsl:for-each> </table> </xsl:template> </xsl:stylesheet> 我想要在後面在那之後增加一個checkbox 但是...請問一下要怎麼加阿.... 前面兩個都是用select的...但是現在沒有值可以select的話咧?? 先謝謝大家了! -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 218.174.35.132 ※ 編輯: ROCKIT 來自: 218.174.35.132 (02/25 11:53)

02/25 23:20, , 1F
直接用<input type="checkbox"....就可以了吧?既然沒值需
02/25 23:20, 1F

02/25 23:20, , 2F
要select,那應該直接加就好了吧?
02/25 23:20, 2F

02/26 03:07, , 3F
XSL是用來排版的,必須有一個HTML與它搭配,所以改HTML
02/26 03:07, 3F

02/26 03:07, , 4F
不是改XSL!
02/26 03:07, 4F

02/26 07:59, , 5F
那麼我想要做判斷的動作,要在哪裡做啊?這個程式碼
02/26 07:59, 5F

02/26 08:00, , 6F
還有另外一個PHP檔是用來從資料庫抓取資料的,像我想要
02/26 08:00, 6F

02/26 08:01, , 7F
利用其中的資料來判斷原本的CHECKBOX要不要打勾...這要
02/26 08:01, 7F

02/26 08:01, , 8F
怎麼用啊?
02/26 08:01, 8F

02/26 11:11, , 9F
是XML跟XSL搭配吧?
02/26 11:11, 9F

02/26 17:44, , 10F
恩他echo 的內容我看的確是XML
02/26 17:44, 10F
文章代碼(AID): #19fC27kl (Web_Design)