public void addAttribute(String name, String value) { Attribute attr = new Attribute(name, value); addAttribute(attr); }
public void setAttribute(String name, String value) { Attribute attr = getAttribute(name); if (attr != null) { attr.setValue(value); return; } attr = new Attribute(name, value); addAttribute(attr); }
public Service(){ this(new Node(ELEM_NAME)); Node sp = new Node(SPEC_VERSION); Node M =new Node(MAJOR); M.setValue(MAJOR_VALUE); sp.addNode(M); Node m =new Node(MINOR); m.setValue(MINOR_VALUE); sp.addNode(m); //Node scpd = new Node(SCPD_ROOTNODE,SCPD_ROOTNODE_NS); wrong! Node scpd = new Node(SCPD_ROOTNODE); scpd.addAttribute("xmlns",SCPD_ROOTNODE_NS); scpd.addNode(sp); getServiceData().setSCPDNode(scpd); }
public boolean set(Node otherNode) { if (otherNode == null) return false; setName(otherNode.getName()); setValue(otherNode.getValue()); removeAllAttributes(); int nOtherAttributes = otherNode.getNAttributes(); for (int n=0; n<nOtherAttributes; n++) { Attribute otherAttr = otherNode.getAttribute(n); Attribute thisAttr = new Attribute(otherAttr); addAttribute(thisAttr); } removeAllNodes(); int nOtherChildNodes = otherNode.getNNodes(); for (int n=0; n<nOtherChildNodes; n++) { Node otherChildNode = otherNode.getNode(n); Node thisChildNode = new Node(); thisChildNode.set(otherChildNode); addNode(thisChildNode); } return true; }
public void addAttribute(String name, String value) { Attribute attr = new Attribute(name, value); addAttribute(attr); }
public void addAttribute(String name, String value) { Attribute attr = new Attribute(name, value); addAttribute(attr); }
public void setAttribute(String name, String value) { Attribute attr = getAttribute(name); if (attr != null) { attr.setValue(value); return; } attr = new Attribute(name, value); addAttribute(attr); }
public void setAttribute(String name, String value) { Attribute attr = getAttribute(name); if (attr != null) { attr.setValue(value); return; } attr = new Attribute(name, value); addAttribute(attr); }
public Service(){ this(new Node(ELEM_NAME)); Node sp = new Node(SPEC_VERSION); Node M =new Node(MAJOR); M.setValue(MAJOR_VALUE); sp.addNode(M); Node m =new Node(MINOR); m.setValue(MINOR_VALUE); sp.addNode(m); //Node scpd = new Node(SCPD_ROOTNODE,SCPD_ROOTNODE_NS); wrong! Node scpd = new Node(SCPD_ROOTNODE); scpd.addAttribute("xmlns",SCPD_ROOTNODE_NS); scpd.addNode(sp); getServiceData().setSCPDNode(scpd); }
public Service(){ this(new Node(ELEM_NAME)); Node sp = new Node(SPEC_VERSION); Node M =new Node(MAJOR); M.setValue(MAJOR_VALUE); sp.addNode(M); Node m =new Node(MINOR); m.setValue(MINOR_VALUE); sp.addNode(m); //Node scpd = new Node(SCPD_ROOTNODE,SCPD_ROOTNODE_NS); wrong! Node scpd = new Node(SCPD_ROOTNODE); scpd.addAttribute("xmlns",SCPD_ROOTNODE_NS); scpd.addNode(sp); getServiceData().setSCPDNode(scpd); }
public boolean set(Node otherNode) { if (otherNode == null) return false; setName(otherNode.getName()); setValue(otherNode.getValue()); removeAllAttributes(); int nOtherAttributes = otherNode.getNAttributes(); for (int n=0; n<nOtherAttributes; n++) { Attribute otherAttr = otherNode.getAttribute(n); Attribute thisAttr = new Attribute(otherAttr); addAttribute(thisAttr); } removeAllNodes(); int nOtherChildNodes = otherNode.getNNodes(); for (int n=0; n<nOtherChildNodes; n++) { Node otherChildNode = otherNode.getNode(n); Node thisChildNode = new Node(); thisChildNode.set(otherChildNode); addNode(thisChildNode); } return true; }
public boolean set(Node otherNode) { if (otherNode == null) return false; setName(otherNode.getName()); setValue(otherNode.getValue()); removeAllAttributes(); int nOtherAttributes = otherNode.getNAttributes(); for (int n=0; n<nOtherAttributes; n++) { Attribute otherAttr = otherNode.getAttribute(n); Attribute thisAttr = new Attribute(otherAttr); addAttribute(thisAttr); } removeAllNodes(); int nOtherChildNodes = otherNode.getNNodes(); for (int n=0; n<nOtherChildNodes; n++) { Node otherChildNode = otherNode.getNode(n); Node thisChildNode = new Node(); thisChildNode.set(otherChildNode); addNode(thisChildNode); } return true; }