9.0 C:\blink\XPathTest.java:47: cannot resolve symbol symbol : variable e1 location: class XPathTest if (e1.hasChildren()){System.out.print("dfdfdf");} ^ 1 error
Element el = (Element)iterator.next(); System.out.print("<"+el.getName()+">"); System.out.println(el.getText()); //加了这一句为什么会出错 if (e1.hasChildren()){System.out.print("dfdfdf");}JDOM中Element 是没有hasChildren()方法地,你能够编译通过??
编译通过但有提示:Note: C:\blink\XPathTest.java uses or overrides a deprecated API. Note: Recompile with -deprecation for details. 我想判断是否有孩子,有则取孩子值(特定或逐个取出都行)
C:\blink\XPathTest.java:47: cannot resolve symbol
symbol : variable e1
location: class XPathTest
if (e1.hasChildren()){System.out.print("dfdfdf");}
^
1 error
不能这样用的:要先匹配到他的命名空间我只在dom4j中用过xpath.一般的做法是先匹配Package xpdl Namespace的父接点
然后xpath变成"/Package/WorkflowProcesses/WorkflowProcess/Activities/Activity
你所说的每一句
对我来说都有难度
msn:[email protected]
谢谢
运行没有问题
if (e1.hasChildren()){System.out.print("dfdfdf");}
我们还年轻牛奶会有的奶牛也会有的
可天天在 csdn 混这些会有吗 ??
你用了Eone(本来是EL)
System.out.print("<"+el.getName()+">");
System.out.println(el.getText());
//加了这一句为什么会出错
if (e1.hasChildren()){System.out.print("dfdfdf");}JDOM中Element 是没有hasChildren()方法地,你能够编译通过??
Note: Recompile with -deprecation for details.
我想判断是否有孩子,有则取孩子值(特定或逐个取出都行)
才会找不到方法
一般老版本中的方法如果在新版本中有更好的实现的话
为了兼容性,也会保留老的方法,只是把它作为deprecated
我是做notes的,java方面是零
经过半个月拼命看资料,加上大家的帮助(特别sirc(一毛) )
我基本实现读取xml文件信息并存到domino库中
if (e1.hasChildren()){System.out.print(el.getChild("Description",xpdl).getText());}
是由于命名空间的