1
我想讀取我的xml文件中的根元素。 當我從XPath "beans/bean/......"
中讀取它時,它工作正常。 XML輸入文件的開頭:xpath讀取根元素
<?xml version="1.0" encoding="UTF-8"?>
<!-- The file defines all the configurations of the SemanticServer -->
<beans>
<bean class="org.spr
但是當我的根元素使用的<beans>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
,而不是它不工作。
我如何讀取根元素時,空<beans>
,而不是<beans xmlns="http
......
謝謝!
你想讀的根元素豆或它的孩子豆?哦,我們需要你使用的代碼/ xpath語句。我在猜測命名空間,但這是一個猜測。 –
例如,我有bean