Class XmlElement

java.lang.Object
org.ujorm.tools.xml.model.XmlModel
org.ujorm.tools.xml.dom.XmlElement
All Implemented Interfaces:
Closeable, Serializable, AutoCloseable, ApiElement<XmlModel>

@Deprecated public class XmlElement extends XmlModel
Deprecated.
Use the XmlModel rather.
XML element model to rendering a XML file. The main benefits are:
  • secure building well-formed XML documents by the Java code
  • a simple API built on a single XmlElement class
  • creating XML components by a subclass is possible
  • great performance and small memory footprint
ยจ

How to use the class:

  XmlElement root = new XmlElement("root");
  root.addElement("childA")
          .setAttrib("x", 1)
          .setAttrib("y", 2);
  root.addElement("childB")
          .setAttrib("x", 3)
          .setAttrib("y", 4)
          .addText("A text message.");
  root.addRawText("\n<rawXml/>\n");
  root.addCDATA("A character data <rawXml/>");
  String result = root.toString();
 
Since:
1.86
Author:
Pavel Ponec
See Also:
  • Constructor Details

    • XmlElement

      public XmlElement(String name)
      Deprecated.
    • XmlElement

      public XmlElement(String name, XmlModel parent)
      Deprecated.