Пример #1
0
 /**
  * Makes an XML text representation.
  *
  * @param buffer
  */
 public void makeTextElement(PrintWriter buffer) {
   int size;
   buffer.print("<legal");
   if (id_ != null) {
     buffer.print(" id=\"");
     buffer.print(URelaxer.escapeAttrQuot(URelaxer.getString(getId())));
     buffer.print("\"");
   }
   if (xmlLang_ != null) {
     buffer.print(" xml:lang=\"");
     buffer.print(URelaxer.escapeAttrQuot(URelaxer.getString(getXmlLang())));
     buffer.print("\"");
   }
   size = this.content_.size();
   for (int i = 0; i < size; i++) {
     IFtContentMixMixed value = (IFtContentMixMixed) this.content_.get(i);
     value.makeTextAttribute(buffer);
   }
   buffer.print(">");
   size = this.content_.size();
   for (int i = 0; i < size; i++) {
     IFtContentMixMixed value = (IFtContentMixMixed) this.content_.get(i);
     value.makeTextElement(buffer);
   }
   buffer.print("</legal>");
 }
Пример #2
0
 /**
  * Creates a DOM representation of the object. Result is appended to the Node <code>parent</code>.
  *
  * @param parent
  */
 public void makeElement(Node parent) {
   Document doc;
   if (parent instanceof Document) {
     doc = (Document) parent;
   } else {
     doc = parent.getOwnerDocument();
   }
   Element element = doc.createElement("legal");
   int size;
   if (this.id_ != null) {
     URelaxer.setAttributePropertyByString(element, "id", this.id_);
   }
   if (this.xmlLang_ != null) {
     URelaxer.setAttributePropertyByString(element, "xml:lang", this.xmlLang_);
   }
   size = this.content_.size();
   for (int i = 0; i < size; i++) {
     IFtContentMixMixed value = (IFtContentMixMixed) this.content_.get(i);
     value.makeElement(element);
   }
   parent.appendChild(element);
 }