示例#1
0
  public XmlElement createLastChild(String ns, String name) throws MbException {
    MbElement parent = getMbElement();
    MbElement elm =
        parent.createElementAsLastChild(XmlUtil.getFolderElementType(parent), name, null);

    if (ns != null) {
      elm.setNamespace(ns);
    }

    return new XmlElement(elm, isReadOnly());
  }
示例#2
0
	private void setProperty(String area, String name, Object value) throws MbException {
		checkReadOnly();
		
		MbElement areaElm = getMbElement().getFirstElementByPath(area);
		if (areaElm == null) {
			areaElm = getMbElement().createElementAsLastChild(MbElement.TYPE_NAME);
			areaElm.setName(area);
		}
		
		MbElement valueElm = areaElm.getFirstElementByPath(name);
		
		if (valueElm == null) {
			areaElm.createElementAsLastChild(MbElement.TYPE_NAME, name, value);
		} else {
			valueElm.setValue(value);
		}
	}