以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 XML基础 』  (http://bbs.xml.org.cn/list.asp?boardid=1)
----  求助!!怎样把Xpath跟XML文件进行匹配???  (http://bbs.xml.org.cn/dispbbs.asp?boardid=1&rootid=&id=18526)


--  作者:121998491
--  发布时间:5/19/2005 3:24:00 PM

--  求助!!怎样把Xpath跟XML文件进行匹配???
下面是out.xml
<file>
<function_definition name="func(int a,int b)" type="int"><function_body><compound_statement><if_statement>
<test_part><greaterequality_relational_expr><left>a</left><right>b</right></greaterequality_relational_expr>
</test_part>
<then_part><return_statement>a</return_statement>
</then_part>
<else_part><return_statement>b</return_statement>
</else_part>
</if_statement>
</compound_statement>
</function_body>
</function_definition>
</file>

现在有一条Xpath路径"/file/function_definition/function_body/compound_statement"

请问通过什么方法实现把这条路径跟上面的out.xml进行匹配,如过匹配成功返回1,不成功则返回0,最好能给出具体的实现过程,在此,我万分感谢???


W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
31.250ms