2009-07-27 160 views
0

我用什么XPath查询xml中的信息节点?我在XMLSpy中尝试了不同的表达式,但没有任何效果。空名称空间的XPath查询xmlns =“”

<root xmlns="tempuri.org" xmlns:p="http://nonamespace.org/std/Name/2006-10-18/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
<item xmlns=""> 
    <info>blah blah</info> 
    <date>2009-07-27 00:00:00</date> 
</item> 

回答

0

,你可以做这样的

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="tempuri.org"> 

<xsl:template match="/"> 
    <xsl:value-of select="a:root/item/info"/> 
</xsl:template> 
+0

我不能让那个代号啄在IE8工作。所以我不得不逃脱evertthing – Tommy 2009-07-27 08:44:26