小编dus*_*nka的帖子

如何获取具有特定属性值的特定XML元素?

我试图通过取所有" <Type>"元素来解析URL中的XML文件,其中参数type_id ="4218"??

XML文档:

<BSQCUBS Version="0.04" Date="Fri Dec 9 11:43:29 GMT 2011" MachineDate="Fri, 09 Dec 2011 11:43:29 +0000">
  <Class class_id="385">
    <Title>Football Matches</Title>
    <Type type_id="4264" type_minbet="0.1" type_maxbet="2000.0">
      ...
    </Type>
    <Type type_id="5873" type_minbet="0" type_maxbet="0">
      ...
    </Type>
    <Type type_id="4725" type_minbet="0.1" type_maxbet="2000.0">
      ...
    </Type>
    <Type type_id="4218" type_minbet="0.1" type_maxbet="2000.0">
      ...
    </Type>
    <Type type_id="4221" type_minbet="0.1" type_maxbet="2000.0">
      ...
    </Type>
    <Type type_id="4218" type_minbet="0.1" type_maxbet="2000.0">
      ...
    </Type>
    <Type type_id="4299" type_minbet="0.1" type_maxbet="2000.0">
      ...
    </Type>
  </Class>
</BSQCUBS>
Run Code Online (Sandbox Code Playgroud)

这是我的Java代码:

 DocumentBuilder db = dbf.newDocumentBuilder();
 Document doc = db.parse(new URL("http://cubs.bluesq.com/cubs/cubs.php?action=getpage&thepage=385.xml").openStream());

 doc.getDocumentElement().normalize();

 NodeList nodeList …
Run Code Online (Sandbox Code Playgroud)

java xml-parsing

29
推荐指数
3
解决办法
7万
查看次数

如何使用tapestry组件t:loop绘制钻石

对于我的Tapestry作业,我必须在字符串数组的桌子上显示一个钻石.这是我到目前为止所拥有的:

代码Index.java

  public class Index
    {
        @Property
        private Integer number;

        @Property
        private String [] table; 

        public Index() {
            number = 9;
            int temp = 0;

            String tmp = "-";
            table = new String[number * number];

            if(singleCell == null)
                singleCell="";

            for (int i = 0; i <  number; i++) {
                for (int j = 0; j <  number; j++) {
                    table[temp] = tmp;
                    temp++;
                }               
            }
        }

        @OnEvent(component="diamond")
        Object onDiamondLink() {
            String swapValue = "*";

            int  sum = number / 2 …
Run Code Online (Sandbox Code Playgroud)

java algorithm math tapestry

6
推荐指数
1
解决办法
754
查看次数

Tapestry5:没有服务实现org.springframework.context.ApplicationContext接口

我使用带有spring和hibernate的tapestry 5,我尝试构建我的应用程序抛出我的这个异常??? !!! ???什么是问题,任何建议都会是这样的relif ????

[WARNING] Some problems were encountered while building the effective model for com.fit:rent-a-car:war:1.0.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 194, column 18
[WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-surefire-plugin is missing. @ line 235, column 17
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
.....
.....

[ERROR] ioc.Registry No service implements …
Run Code Online (Sandbox Code Playgroud)

java tapestry spring-mvc maven-plugin

-2
推荐指数
1
解决办法
2775
查看次数