English 中文(简体)
使用消化器将元素的属性设定在动物体内的变异物上的模式
原标题:what is the pattern used to set the attributes of an element to a variable to acess it in the javabean using digester
  • 时间:2010-08-03 06:55:35
  •  标签:
  • xml

i) 使用消化器对Xml文档进行分类,其中一使用模型将子子子对海底变量进行分类

诸如“根ube子”,“xyz”;

×yz是信标的变数,以及如何将元件的属性确定为像样的变数,

我指的是,为了做到这一点,需要什么样的模式和方法?

<student name="JavaGirl" division="B">
                <course>
                     <id>C3</id>
                    <name>EJB</name>
                 </course>
         </student>

在这里,如何将名称和区分放在星号中的变数上?

最佳回答

i am parsing an xml file using the digester , where i set the subelements to the variables of the bean using the pattern

like (" rootsubelementssubsubelements ","xyz");

我不熟悉文摘社,但如果你看着XPath地图,可以很容易地用

@XmlPath("root/subelements/subelements")
private SomeClass xyz;

实例见:

例如,你可以很容易地利用日本宇宙航空研究开发机构:

import javax.xml.bind.annotation.*;

@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
public class Student {
    @XmlAttribute
    private String name;

    @XmlAttribute
    private String division;

    private Course course;
}

以及

import javax.xml.bind.annotation.*;

@XmlAccessorType(XmlAccessType.FIELD)
public class Course {
   private String name;
   private String id;
}
问题回答

暂无回答




相关问题
how to represent it in dtd?

I have two element action and guid. guid is a required field when action is add. but when action is del it will not appear in file. How to represent this in dtd ?

.Net application configuration add xml-data

I need to add xml-content to my application configuration file. Is there a way to add it directly to the appSettings section or do I need to implement a configSection? Is it possible to add the xml ...

XStream serializing collections

I have a class structure that I would like to serialize with Xstream. The root class contains a collection of other objects (of varying types). I would like to only serialize part of the objects that ...

MS Word splits words in its XML format

I have a Word 2003 document saved as a XML in WordProcessingML format. It contains few placeholders which will be dynamically replaced by an appropriate content. But, the problem is that Word ...

Merging an XML file with a list of changes

I have two XML files that are generated by another application I have no control over. The first is a settings file, and the second is a list of changes that should be applied to the first. Main ...

How do I check if a node has no siblings?

I have a org.w3c.dom.Node object. I would like to see if it has any other siblings. Here s what I have tried: Node sibling = node.getNextSibling(); if(sibling == null) return true; else ...

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

热门标签