Exemple #1
0
 /**
  * Makes an XML text representation.
  *
  * @param buffer
  */
 public void makeTextElement(PrintWriter buffer) {
   int size;
   buffer.print("<fixme");
   if (author_ != null) {
     buffer.print(" author=\"");
     buffer.print(URelaxer.escapeAttrQuot(URelaxer.getString(getAuthor())));
     buffer.print("\"");
   }
   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++) {
     IFdContentMixMixed value = (IFdContentMixMixed) this.content_.get(i);
     value.makeTextAttribute(buffer);
   }
   buffer.print(">");
   size = this.content_.size();
   for (int i = 0; i < size; i++) {
     IFdContentMixMixed value = (IFdContentMixMixed) this.content_.get(i);
     value.makeTextElement(buffer);
   }
   buffer.print("</fixme>");
 }
Exemple #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("fixme");
   int size;
   if (this.author_ != null) {
     URelaxer.setAttributePropertyByString(element, "author", this.author_);
   }
   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++) {
     IFdContentMixMixed value = (IFdContentMixMixed) this.content_.get(i);
     value.makeElement(element);
   }
   parent.appendChild(element);
 }