以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 XSL/XSLT/XSL-FO/CSS 』  (http://bbs.xml.org.cn/list.asp?boardid=8)
----  [讨论][求助]想用xslt转换香xml中把十六进制RGB转换为十进制该如何做?  (http://bbs.xml.org.cn/dispbbs.asp?boardid=8&rootid=&id=64901)


--  作者:lylyjiejie
--  发布时间:7/24/2008 11:42:00 AM

--  [讨论][求助]想用xslt转换香xml中把十六进制RGB转换为十进制该如何做?
源xml中
<color val="FF0000"/>
通过xslt转为
<color>RGB(255,0,0)</color>

想知道有什么办法可以做到,想不出,谢谢


--  作者:lylyjiejie
--  发布时间:7/24/2008 2:05:00 PM

--  
自己顶一下
在xsl中写一个进制转换的函数?xsl:function?
用模版应该不行吧,糊涂中...
有办法吗?谢拉
--  作者:Qr
--  发布时间:7/24/2008 2:11:00 PM

--  
似乎没有函数直接转换,手工写XSL代码进行计算吧

假设有一个十六进数 2AF5, 那么如何换算成10进制呢?
用竖式计算:
2AF5换算成10进制:

第0位:  5 * 160 = 5

第1位:  F * 161 = 240

第2位:  A * 162 = 2560

第3位:  2 * 163 = 8192  +

-------------------------------------

                 10997  

直接计算就是:

5 * 160  + F * 161 + A * 162 + 2 * 163 = 10997

(别忘了,在上面的计算中,A表示10,而F表示15)

注意:160-163的第3位数实为上标,即16的0次方-16的3次方


--  作者:Qr
--  发布时间:7/24/2008 2:30:00 PM

--  
<xsl:template match="/">
<color>
    RGB(
 <xsl:value-of select="number(substring(color/@val,1,1))*16+number(substring

(color/@val,2,1))"/>,
 <xsl:value-of select="number(substring(color/@val,3,1))*16+number(substring

(color/@val,4,1))"/>,
 <xsl:value-of select="number(substring(color/@val,5,1))*16+number(substring

(color/@val,6,1))"/>
 )
</color>
</xsl:template>
大概就是这样子啦,但因为val可能有A-F的字母,须要转换为相应的数字(即10-15)才能运算,否则就得到NaN。转换这一步你自己来处理吧,纯粹给个思路,可不是答案哦...呵呵


--  作者:lylyjiejie
--  发布时间:7/25/2008 10:09:00 AM

--  
多谢Qr!
刚看到你回的帖子,我又想了一下,思路大概和你一致,今早已搞定。只是需要加入对字母(A-F)的判断,不知是不是我的方法比较笨,有没有改进的可能。颜色转换模版文件代码大致如下:
文件名:TransColor.xsl
<xsl:template name="transColor">
      <xsl:call-template name="redA">
          <xsl:with-param name="red1" select="substring(./@w:val,1,1)"/>
          <xsl:with-param name="red2" select="substring(./@w:val,2,1)"/>
          <xsl:with-param name="gre1" select="substring(./@w:val,3,1)"/>
          <xsl:with-param name="gre2" select="substring(./@w:val,4,1)"/>
          <xsl:with-param name="blu1" select="substring(./@w:val,5,1)"/>
          <xsl:with-param name="blu2" select="substring(./@w:val,6,1)"/>
      </xsl:call-template>
</xsl:template>

<xsl:template name="redA">
      <xsl:param name="red1"/>
      <xsl:param name="red2"/>
      <xsl:param name="gre1"/>
      <xsl:param name="gre2"/>
      <xsl:param name="blu1"/>
      <xsl:param name="blu2"/>
      
      <xsl:choose>
          <xsl:when test="$red1='A'">
              <xsl:call-template name="redB">
                  <xsl:with-param name="R1" select="10*16"/>
                  <xsl:with-param name="red2" select="$red2"/>
                  <xsl:with-param name="gre1" select="$gre1"/>
                  <xsl:with-param name="gre2" select="$gre2"/>
                  <xsl:with-param name="blu1" select="$blu1"/>
                  <xsl:with-param name="blu2" select="$blu2"/>
              </xsl:call-template>
          </xsl:when>
          <xsl:when test="$red1='B'">
              <xsl:call-template name="redB">
                  <xsl:with-param name="R1" select="11*16"/>
                  <xsl:with-param name="red2" select="$red2"/>
                  <xsl:with-param name="gre1" select="$gre1"/>
                  <xsl:with-param name="gre2" select="$gre2"/>
                  <xsl:with-param name="blu1" select="$blu1"/>
                  <xsl:with-param name="blu2" select="$blu2"/>
              </xsl:call-template>
          </xsl:when>
          <xsl:when test="$red1='C'">
              <xsl:call-template name="redB">
                  <xsl:with-param name="R1" select="12*16"/>
                  <xsl:with-param name="red2" select="$red2"/>
                  <xsl:with-param name="gre1" select="$gre1"/>
                  <xsl:with-param name="gre2" select="$gre2"/>
                  <xsl:with-param name="blu1" select="$blu1"/>
                  <xsl:with-param name="blu2" select="$blu2"/>
              </xsl:call-template>
          </xsl:when>
          <xsl:when test="$red1='D'">
              <xsl:call-template name="redB">
                  <xsl:with-param name="R1" select="13*16"/>
                  <xsl:with-param name="red2" select="$red2"/>
                  <xsl:with-param name="gre1" select="$gre1"/>
                  <xsl:with-param name="gre2" select="$gre2"/>
                  <xsl:with-param name="blu1" select="$blu1"/>
                  <xsl:with-param name="blu2" select="$blu2"/>
              </xsl:call-template>
          </xsl:when>
          <xsl:when test="$red1='E'">
              <xsl:call-template name="redB">
                  <xsl:with-param name="R1" select="14*16"/>
                  <xsl:with-param name="red2" select="$red2"/>
                  <xsl:with-param name="gre1" select="$gre1"/>
                  <xsl:with-param name="gre2" select="$gre2"/>
                  <xsl:with-param name="blu1" select="$blu1"/>
                  <xsl:with-param name="blu2" select="$blu2"/>
              </xsl:call-template>
          </xsl:when>
          <xsl:when test="$red1='F'">
              <xsl:call-template name="redB">
                  <xsl:with-param name="R1" select="15*16"/>
                  <xsl:with-param name="red2" select="$red2"/>
                  <xsl:with-param name="gre1" select="$gre1"/>
                  <xsl:with-param name="gre2" select="$gre2"/>
                  <xsl:with-param name="blu1" select="$blu1"/>
                  <xsl:with-param name="blu2" select="$blu2"/>
              </xsl:call-template>
          </xsl:when>
          <xsl:otherwise>
                <xsl:call-template name="redB">
                  <xsl:with-param name="R1" select="number($red1)*16"/>
                  <xsl:with-param name="red2" select="$red2"/>
                  <xsl:with-param name="gre1" select="$gre1"/>
                  <xsl:with-param name="gre2" select="$gre2"/>
                  <xsl:with-param name="blu1" select="$blu1"/>
                  <xsl:with-param name="blu2" select="$blu2"/>
              </xsl:call-template>
          </xsl:otherwise>
      </xsl:choose>
</xsl:template>

<xsl:template name="redB">
      <xsl:param name="R1"/>
      <xsl:param name="red2"/>
      <xsl:param name="gre1"/>
      <xsl:param name="gre2"/>
      <xsl:param name="blu1"/>
      <xsl:param name="blu2"/>
          
          <xsl:choose>
     <xsl:when test="$red2='A'">
         <xsl:call-template name="greA">
             <xsl:with-param name="R" select="$R1+10"/>
             <xsl:with-param name="gre1" select="$gre1"/>
             <xsl:with-param name="gre2" select="$gre2"/>
                                                          <xsl:with-param name="blu1" select="$blu1"/>
                                                          <xsl:with-param name="blu2" select="$blu2"/>
         </xsl:call-template>
     </xsl:when>
     <xsl:when test="$red2='B'">
         <xsl:call-template name="greA">
             <xsl:with-param name="R" select="$R1+11"/>
             <xsl:with-param name="gre1" select="$gre1"/>
             <xsl:with-param name="gre2" select="$gre2"/>
                                                          <xsl:with-param name="blu1" select="$blu1"/>
                                                          <xsl:with-param name="blu2" select="$blu2"/>
         </xsl:call-template>
     </xsl:when>
     <xsl:when test="$red2='C'">
         <xsl:call-template name="greA">
             <xsl:with-param name="R" select="$R1+12"/>
             <xsl:with-param name="gre1" select="$gre1"/>
             <xsl:with-param name="gre2" select="$gre2"/>
                                                          <xsl:with-param name="blu1" select="$blu1"/>
                                                          <xsl:with-param name="blu2" select="$blu2"/>
         </xsl:call-template>
     </xsl:when>
     <xsl:when test="$red2='D'">
         <xsl:call-template name="greA">
             <xsl:with-param name="R" select="$R1+13"/>
             <xsl:with-param name="gre1" select="$gre1"/>
             <xsl:with-param name="gre2" select="$gre2"/>
                                                          <xsl:with-param name="blu1" select="$blu1"/>
                                                          <xsl:with-param name="blu2" select="$blu2"/>
         </xsl:call-template>
     </xsl:when>
     <xsl:when test="$red2='E'">
         <xsl:call-template name="greA">
             <xsl:with-param name="R" select="$R1+14"/>
             <xsl:with-param name="gre1" select="$gre1"/>
             <xsl:with-param name="gre2" select="$gre2"/>
                                                          <xsl:with-param name="blu1" select="$blu1"/>
                                                          <xsl:with-param name="blu2" select="$blu2"/>
         </xsl:call-template>
     </xsl:when>
     <xsl:when test="$red2='F'">
         <xsl:call-template name="greA">
             <xsl:with-param name="R" select="$R1+15"/>
             <xsl:with-param name="gre1" select="$gre1"/>
             <xsl:with-param name="gre2" select="$gre2"/>
                                                          <xsl:with-param name="blu1" select="$blu1"/>
                                                          <xsl:with-param name="blu2" select="$blu2"/>
         </xsl:call-template>
     </xsl:when>
     <xsl:otherwise>
          <xsl:call-template name="greA">
             <xsl:with-param name="R"select="$R1+number ($red2)"/>
             <xsl:with-param name="gre1" select="$gre1"/>
             <xsl:with-param name="gre2" select="$gre2"/>
                                                          <xsl:with-param name="blu1" select="$blu1"/>
                                                          <xsl:with-param name="blu2" select="$blu2"/>
         </xsl:call-template>
     </xsl:otherwise>
    </xsl:choose>
</xsl:template>


--  作者:lylyjiejie
--  发布时间:7/25/2008 10:11:00 AM

--  
以上是对R的判断,接上贴:对G的判断
<xsl:template name="greA">
      <xsl:param name="R"/>
      <xsl:param name="gre1"/>
      <xsl:param name="gre2"/>
      <xsl:param name="blu1"/>
      <xsl:param name="blu2"/>
      
      <xsl:choose>
       <xsl:when test="$gre1='A'">
          <xsl:call-template name="greB">
             <xsl:with-param name="R" select="$R"/>
             <xsl:with-param name="G1" select="10*16"/>
             <xsl:with-param name="gre2" select="$gre2"/>
                                  <xsl:with-param name="blu1" select="$blu1"/>
                                  <xsl:with-param name="blu2" select="$blu2"/>
          </xsl:call-template>
       </xsl:when>
       <xsl:when test="$gre1='B'">
          <xsl:call-template name="greB">
             <xsl:with-param name="R" select="$R"/>
             <xsl:with-param name="G1" select="11*16"/>
             <xsl:with-param name="gre2" select="$gre2"/>
                                  <xsl:with-param name="blu1" select="$blu1"/>
                                  <xsl:with-param name="blu2" select="$blu2"/>
          </xsl:call-template>
       </xsl:when>
       <xsl:when test="$gre1='C'">
          <xsl:call-template name="greB">
             <xsl:with-param name="R" select="$R"/>
             <xsl:with-param name="G1" select="12*16"/>
             <xsl:with-param name="gre2" select="$gre2"/>
                                  <xsl:with-param name="blu1" select="$blu1"/>
                                  <xsl:with-param name="blu2" select="$blu2"/>
          </xsl:call-template>
       </xsl:when>
       <xsl:when test="$gre1='D'">
          <xsl:call-template name="greB">
             <xsl:with-param name="R" select="$R"/>
             <xsl:with-param name="G1" select="13*16"/>
             <xsl:with-param name="gre2" select="$gre2"/>
                                  <xsl:with-param name="blu1" select="$blu1"/>
                                  <xsl:with-param name="blu2" select="$blu2"/>
          </xsl:call-template>
       </xsl:when>
       <xsl:when test="$gre1='E'">
          <xsl:call-template name="greB">
             <xsl:with-param name="R" select="$R"/>
             <xsl:with-param name="G1" select="14*16"/>
             <xsl:with-param name="gre2" select="$gre2"/>
                                  <xsl:with-param name="blu1" select="$blu1"/>
                                  <xsl:with-param name="blu2" select="$blu2"/>
          </xsl:call-template>
       </xsl:when>
       <xsl:when test="$gre1='F'">
          <xsl:call-template name="greB">
             <xsl:with-param name="R" select="$R"/>
             <xsl:with-param name="G1" select="15*16"/>
             <xsl:with-param name="gre2" select="$gre2"/>
                                  <xsl:with-param name="blu1" select="$blu1"/>
                                  <xsl:with-param name="blu2" select="$blu2"/>
          </xsl:call-template>
       </xsl:when>
       <xsl:otherwise>
          <xsl:call-template name="greB">
             <xsl:with-param name="R" select="$R"/>
             <xsl:with-param name="G1" select="number($gre1)*16"/>
             <xsl:with-param name="gre2" select="$gre2"/>
                                  <xsl:with-param name="blu1" select="$blu1"/>
                                  <xsl:with-param name="blu2" select="$blu2"/>
          </xsl:call-template>
       </xsl:otherwise>
   </xsl:choose>
</xsl:template>

<xsl:template name="greB">
      <xsl:param name="R"/>
      <xsl:param name="G1"/>
      <xsl:param name="gre2"/>
      <xsl:param name="blu1"/>
      <xsl:param name="blu2"/>
      
      <xsl:choose>
       <xsl:when test="$gre2='A'">
          <xsl:call-template name="bluA">
              <xsl:with-param name="R" select="$R"/>
              <xsl:with-param name="G" select="$G1+10"/>
              <xsl:with-param name="blu1" select="$blu1"/>
                                   <xsl:with-param name="blu2" select="$blu2"/>
                            </xsl:call-template>
       </xsl:when>
       <xsl:when test="$gre2='B'">
          <xsl:call-template name="bluA">
              <xsl:with-param name="R" select="$R"/>
              <xsl:with-param name="G" select="$G1+11"/>
              <xsl:with-param name="blu1" select="$blu1"/>
                                   <xsl:with-param name="blu2" select="$blu2"/>
                            </xsl:call-template>
       </xsl:when>
       <xsl:when test="$gre2='C'">
          <xsl:call-template name="bluA">
              <xsl:with-param name="R" select="$R"/>
              <xsl:with-param name="G" select="$G1+12"/>
              <xsl:with-param name="blu1" select="$blu1"/>
                                   <xsl:with-param name="blu2" select="$blu2"/>
                            </xsl:call-template>
       </xsl:when>
       <xsl:when test="$gre2='D'">
          <xsl:call-template name="bluA">
              <xsl:with-param name="R" select="$R"/>
              <xsl:with-param name="G" select="$G1+13"/>
              <xsl:with-param name="blu1" select="$blu1"/>
                                   <xsl:with-param name="blu2" select="$blu2"/>
                            </xsl:call-template>
       </xsl:when>
       <xsl:when test="$gre2='E'">
          <xsl:call-template name="bluA">
              <xsl:with-param name="R" select="$R"/>
              <xsl:with-param name="G" select="$G1+14"/>
              <xsl:with-param name="blu1" select="$blu1"/>
                                   <xsl:with-param name="blu2" select="$blu2"/>
                            </xsl:call-template>
       </xsl:when>
       <xsl:when test="$gre2='F'">
          <xsl:call-template name="bluA">
              <xsl:with-param name="R" select="$R"/>
              <xsl:with-param name="G" select="$G1+15"/>
              <xsl:with-param name="blu1" select="$blu1"/>
                                   <xsl:with-param name="blu2" select="$blu2"/>
                               </xsl:call-template>
       </xsl:when>
       <xsl:otherwise>
          <xsl:call-template name="bluA">
              <xsl:with-param name="R" select="$R"/>
              <xsl:with-param name="G" select="$G1+number($gre2)"/>
              <xsl:with-param name="blu1" select="$blu1"/>
                                   <xsl:with-param name="blu2" select="$blu2"/>
                               </xsl:call-template>
       </xsl:otherwise>
   </xsl:choose>
</xsl:template>


--  作者:lylyjiejie
--  发布时间:7/25/2008 10:13:00 AM

--  
再接帖:对B的判断
<xsl:template name="bluA">
      <xsl:param name="R"/>
      <xsl:param name="G"/>
      <xsl:param name="blu1"/>
      <xsl:param name="blu2"/>
      
      <xsl:choose>
       <xsl:when test="$blu1='A'">
          <xsl:call-template name="bluB">
             <xsl:with-param name="R" select="$R"/>
             <xsl:with-param name="G" select="$G"/>
             <xsl:with-param name="B1" select="10*16"/>
             <xsl:with-param name="blu2" select="$blu2"/>
          </xsl:call-template>
       </xsl:when>
       <xsl:when test="$blu1='B'">
          <xsl:call-template name="bluB">
             <xsl:with-param name="R" select="$R"/>
             <xsl:with-param name="G" select="$G"/>
             <xsl:with-param name="B1" select="11*16"/>
             <xsl:with-param name="blu2" select="$blu2"/>
          </xsl:call-template>
       </xsl:when>
       <xsl:when test="$blu1='C'">
          <xsl:call-template name="bluB">
             <xsl:with-param name="R" select="$R"/>
             <xsl:with-param name="G" select="$G"/>
             <xsl:with-param name="B1" select="12*16"/>
             <xsl:with-param name="blu2" select="$blu2"/>
          </xsl:call-template>
       </xsl:when>
       <xsl:when test="$blu1='D'">
          <xsl:call-template name="bluB">
             <xsl:with-param name="R" select="$R"/>
             <xsl:with-param name="G" select="$G"/>
             <xsl:with-param name="B1" select="13*16"/>
             <xsl:with-param name="blu2" select="$blu2"/>
          </xsl:call-template>
       </xsl:when>
       <xsl:when test="$blu1='E'">
          <xsl:call-template name="bluB">
             <xsl:with-param name="R" select="$R"/>
             <xsl:with-param name="G" select="$G"/>
             <xsl:with-param name="B1" select="14*16"/>
             <xsl:with-param name="blu2" select="$blu2"/>
          </xsl:call-template>
       </xsl:when>
       <xsl:when test="$blu1='F'">
          <xsl:call-template name="bluB">
             <xsl:with-param name="R" select="$R"/>
             <xsl:with-param name="G" select="$G"/>
             <xsl:with-param name="B1" select="15*16"/>
             <xsl:with-param name="blu2" select="$blu2"/>
          </xsl:call-template>
       </xsl:when>
       <xsl:otherwise>
          <xsl:call-template name="bluB">
             <xsl:with-param name="R" select="$R"/>
             <xsl:with-param name="G" select="$G"/>
             <xsl:with-param name="B1" select="number($blu1)*16"/>
             <xsl:with-param name="blu2" select="$blu2"/>
          </xsl:call-template>
       </xsl:otherwise>
   </xsl:choose>
      
</xsl:template>

<xsl:template name="bluB">
      <xsl:param name="R"/>
      <xsl:param name="G"/>
      <xsl:param name="B1"/>
      <xsl:param name="blu2"/>
      
      <xsl:choose>
       <xsl:when test="$blu2='A'">
          <xsl:call-template name="RGB">
              <xsl:with-param name="R" select="$R"/>
              <xsl:with-param name="G" select="$G"/>
              <xsl:with-param name="B" select="$B1+10"/>
          </xsl:call-template>
       </xsl:when>
       <xsl:when test="$blu2='B'">
          <xsl:call-template name="RGB">
              <xsl:with-param name="R" select="$R"/>
              <xsl:with-param name="G" select="$G"/>
              <xsl:with-param name="B" select="$B1+11"/>
          </xsl:call-template>
       </xsl:when>
       <xsl:when test="$blu2='C'">
          <xsl:call-template name="RGB">
              <xsl:with-param name="R" select="$R"/>
              <xsl:with-param name="G" select="$G"/>
              <xsl:with-param name="B" select="$B1+12"/>
          </xsl:call-template>
       </xsl:when>
       <xsl:when test="$blu2='D'">
          <xsl:call-template name="RGB">
              <xsl:with-param name="R" select="$R"/>
              <xsl:with-param name="G" select="$G"/>
              <xsl:with-param name="B" select="$B1+13"/>
          </xsl:call-template>
       </xsl:when>
       <xsl:when test="$blu2='E'">
          <xsl:call-template name="RGB">
              <xsl:with-param name="R" select="$R"/>
              <xsl:with-param name="G" select="$G"/>
              <xsl:with-param name="B" select="$B1+14"/>
          </xsl:call-template>
       </xsl:when>
       <xsl:when test="$blu2='F'">
          <xsl:call-template name="RGB">
              <xsl:with-param name="R" select="$R"/>
              <xsl:with-param name="G" select="$G"/>
              <xsl:with-param name="B" select="$B1+15"/>
          </xsl:call-template>
       </xsl:when>
       <xsl:otherwise>
          <xsl:call-template name="RGB">
              <xsl:with-param name="R" select="$R"/>
              <xsl:with-param name="G" select="$G"/>
              <xsl:with-param name="B" select="$B1+number($blu2)"/>
          </xsl:call-template>
       </xsl:otherwise>
   </xsl:choose>
</xsl:template>

<xsl:template name="RGB">
       <xsl:param name="R"/>
       <xsl:param name="G"/>
       <xsl:param name="B"/>
       
       <color>
          <xsl:attribute name="value">
              <xsl:text>RGB(</xsl:text><xsl:value-of select="$R"/><xsl:text>,</xsl:text><xsl:value-of select="$G"/><xsl:text>,</xsl:text><xsl:value-of select="$G"/><xsl:text>)</xsl:text>
          </xsl:attribute>
       </color>
</xsl:template>
</xsl:stylesheet>


--  作者:lylyjiejie
--  发布时间:7/25/2008 10:18:00 AM

--  
对以上代码的解释;
因为RGB十六进制表示为:aabbcc,其中aa-R,bb-G,cc-B;
我把aabbcc中的每一个字符取出来为:red1,red2,gre1,gre2,blu1,blu2
然后调用模版redA,redB,greA,greB,bluA,bluB,对每个字符判断,并计算,最后输出RGB( , , ,)的形式
虽然能用,但是比较繁琐,不知有更好的办法没,谢谢
--  作者:Qr
--  发布时间:7/27/2008 12:28:00 PM

--  
晕,用命名模板去递归,你可真有耐心去调试。
<xsl:template match="//color">
<xsl:variable name="n1" select="number(substring(@val,1,1))"/>
<xsl:variable name="n2" select="number(substring(@val,2,1))"/>
<xsl:variable name="n3" select="number(substring(@val,3,1))"/>
<xsl:variable name="n4" select="number(substring(@val,4,1))"/>
<xsl:variable name="n5" select="number(substring(@val,5,1))"/>
<xsl:variable name="n6" select="number(substring(@val,6,1))"/>
<color>
    RGB(
 <xsl:value-of select="$n1*16+$n2"/>,
 <xsl:value-of select="$n3*16+$n4"/>,
 <xsl:value-of select="$n5*16+$n6"/>
 )
</color>
</xsl:template>
这样不就搞掂了吗?
只须在xsl:variable用<xsl:when>进行判断和处理A-F就可以了。
--  作者:lylyjiejie
--  发布时间:7/28/2008 4:29:00 PM

--  
不好意思,请问在varible处怎么用choose判断,每个字符都是A-F,变量又不能重新赋值,这样该如何判断?能否给个例子,谢谢
--  作者:Qr
--  发布时间:7/28/2008 5:55:00 PM

--  
我在9楼的回贴要实现的话,要将A-F转换成10-15,还要写一个命名模板来专门处理,同时还要用到比较多的XSL&XPath相关方法函数,最后才能用xsl:choose来判断处理。对于初涉XSL的人来说可能有点太深了,因为使用了相当多的hack写法。
你的方法虽然显得有点烦,但必竟已经测试通过了。

不再讨论这个问题了,免得误导你。


--  作者:lylyjiejie
--  发布时间:7/28/2008 6:14:00 PM

--  
哦,这样啊,看来我要学的东西还很多啊,谢谢你了,我在做这方面的工作,也是刚开始学习xsl、xml等,你的博客我也去看过了,学了不少东西,谢谢,这个论坛很好,以后要经常来,学习中...
结帖。
--  作者:Qr
--  发布时间:8/2/2008 7:36:00 AM

--  
你的这个问题,我已经用三种方法来实现,当然这三种方法均是后法对前法的重构。我也没有更好更简单更短小的代码来实现突破了。你可以到我的blog上看看:http://blogger.org.cn/blog/more.asp?name=Qr&id=38306
包括10楼的问题,也已经在其中回答了。
--  作者:lylyjiejie
--  发布时间:8/4/2008 2:06:00 PM

--  
我已经去看过帖子,很好,最后一种方法不用递归,很好,谢谢!比我的方法好多了!你代码已经少了,实现起来
W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
328.125ms