Package ghidra.util.xml
Class XmlWriter
java.lang.Object
ghidra.util.xml.XmlWriter
A class for creating XML files.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes this XML writer.voidendElement(String name) Writes the specified end element.ghidra.util.xml.CounterReturns the XML summary string.voidstartElement(String name) Writes the specified start element.voidstartElement(String name, XmlAttributes attrs) Writes the specified start element with the attributes.voidWrites the specified DTD into the file.voidwriteElement(String name, XmlAttributes attrs) Writes the specified element with the attributes.voidwriteElement(String name, XmlAttributes attrs, String text) Writes the specified element with the attributes and text.
-
Constructor Details
-
XmlWriter
Constructs a new XML writer.- Parameters:
file- the name of the output XML filedtdName- the name of the DTD- Throws:
IOException- if an i/o error occurs
-
XmlWriter
Constructs a new XML writer.- Parameters:
out- the output streamdtdName- the name of the DTD- Throws:
IOException- if an i/o error occurs
-
-
Method Details
-
getCounter
public ghidra.util.xml.Counter getCounter()Returns the XML summary string.- Returns:
- the XML summary string
-
close
public void close()Closes this XML writer. -
writeDTD
Writes the specified DTD into the file.- Parameters:
dtdName- the name of the DTD- Throws:
IOException- if an i/o error occurs
-
startElement
Writes the specified start element.- Parameters:
name- the name of the start element
-
startElement
Writes the specified start element with the attributes.- Parameters:
name- the name of the start elementattrs- the attributes of the start element
-
endElement
Writes the specified end element.- Parameters:
name- the name of the end element
-
writeElement
Writes the specified element with the attributes.- Parameters:
name- the name of the start elementattrs- the attributes of the start element
-
writeElement
Writes the specified element with the attributes and text.- Parameters:
name- the name of the elementattrs- the attributes of the elementtext- the text of the element
-