Package ghidra.util.xml
Class XmlWriter
java.lang.Object
ghidra.util.xml.XmlWriter
A class for creating XML files.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes this XML writer.void
endElement
(String name) Writes the specified end element.ghidra.util.xml.Counter
Returns the XML summary string.void
startElement
(String name) Writes the specified start element.void
startElement
(String name, XmlAttributes attrs) Writes the specified start element with the attributes.void
Writes the specified DTD into the file.void
writeElement
(String name, XmlAttributes attrs) Writes the specified element with the attributes.void
writeElement
(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
-