以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 DOM/SAX/XPath 』  (http://bbs.xml.org.cn/list.asp?boardid=11)
----  如何得到一个节点内的文本内容(分有没有子节点的通用写法)  (http://bbs.xml.org.cn/dispbbs.asp?boardid=11&rootid=&id=43950)


--  作者:pope3618
--  发布时间:3/15/2007 2:07:00 PM

--  如何得到一个节点内的文本内容(分有没有子节点的通用写法)
<td width="100%" colspan="2" height="60" valign="middle" bordercolorlight="#FFFFFF" bordercolordark="#C0C0C0">
              <p align="center" style="margin-left: 5; margin-top: 5; margin-bottom: 10"><font size="4">深圳市地方税务局福利企业残疾</font></p>
              <p align="center" style="margin-left: 5; margin-top: 5; margin-bottom: 10"><font size="4">人员税收优惠登记卡(式样)</font></p></td>

下面的
如这个代码  <td width="33%" height="30">残疾人证编码:  </td>
            <td width="67%" height="30">dioo#1</td>
如何分这2种情况判断取到节点的文本内容
<xsl:template  match="td">

<xsl:variable name="yuankey">
<xsl:value-of select="."/>
</xsl:variable>

<xsl:value-of select="."/> 这个好像不行
比如这个还有有子节点<P></P> "><font size="4">"></font >
<td width="100%" colspan="2" height="60" valign="middle" bordercolorlight="#FFFFFF" bordercolordark="#C0C0C0">
              <p align="center" style="margin-left: 5; margin-top: 5; margin-bottom: 10"><font size="4">深圳市地方税务局福利企业残疾</font></p>
              <p align="center" style="margin-left: 5; margin-top: 5; margin-bottom: 10"><font size="4">人员税收优惠登记卡(式样)</font></p></td>


只能是没有<p></p>或者其他子节点的情况 有没有通用写法


--  作者:flyfoxs
--  发布时间:3/19/2007 3:36:00 PM

--  
很想帮你,但你能不能把问题提练一下,都看不明白你的问题。
W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
9,187.500ms