public interface IXMLWriter
| Modifier and Type | Method and Description |
|---|---|
void |
addAttribute(int index,
String name,
String value)
Add attribute to current open start tag.
|
void |
close()
Close document output.
|
void |
closeEmptyTag()
Close the current open start tag as an empty element.
|
void |
closeStartTag()
Close the current open start tag.
|
void |
endTag(int index,
String name)
Generate end tag.
|
void |
flush()
Flush document output.
|
String[][] |
getExtensionNamespaces()
Get extension namespace URIs added to those in mapping.
|
int |
getNamespaceCount()
Get the number of namespaces currently defined.
|
String |
getNamespacePrefix(int index)
Get current prefix defined for namespace.
|
String[] |
getNamespaces()
Get namespace URIs for mapping.
|
String |
getNamespaceUri(int index)
Get URI for namespace.
|
int |
getNestingDepth()
Get the current element nesting depth.
|
int |
getPrefixIndex(String prefix)
Get index of namespace mapped to prefix.
|
void |
indent()
Request output indent.
|
void |
init()
Initialize writer.
|
int[] |
openNamespaces(int[] nums,
String[] prefs)
Open the specified namespaces for use.
|
void |
popExtensionNamespaces()
Remove extension namespace URIs.
|
void |
popTranslationTable()
Pop a translation table used for converting namespace index numbers to
values matching the internal lookup.
|
void |
pushExtensionNamespaces(String[] uris)
Append extension namespace URIs to those in mapping.
|
void |
pushTranslationTable(int[] table)
Push a translation table to be used for converting namespace index
numbers passed as arguments to values used for internal lookup.
|
void |
reset()
Reset to initial state for reuse.
|
void |
setIndentSpaces(int count,
String newline,
char indent)
Set nesting indentation.
|
void |
startTagClosed(int index,
String name)
Generate closed start tag.
|
void |
startTagNamespaces(int index,
String name,
int[] nums,
String[] prefs)
Generate start tag for element with namespaces.
|
void |
startTagOpen(int index,
String name)
Generate open start tag.
|
void |
writeCData(String text)
Write CDATA text to document.
|
void |
writeComment(String text)
Write comment to document.
|
void |
writeDocType(String name,
String sys,
String pub,
String subset)
Write DOCTYPE declaration to document.
|
void |
writeEntityRef(String name)
Write entity reference to document.
|
void |
writePI(String target,
String data)
Write processing instruction to document.
|
void |
writeTextContent(String text)
Write ordinary character data text content to document.
|
void |
writeXMLDecl(String version,
String encoding,
String standalone)
Write XML declaration to document.
|
void init()
throws IOException
IOExceptionint getNestingDepth()
int getNamespaceCount()
void setIndentSpaces(int count,
String newline,
char indent)
count - number of character to indent per level, or disable
indentation if negative (zero means new line only)newline - sequence of characters used for a line ending
(null means use the single character '\n')indent - whitespace character used for indentationvoid writeXMLDecl(String version, String encoding, String standalone) throws IOException
version - XML version textencoding - text for encoding attribute (unspecified if
null)standalone - text for standalone attribute (unspecified if
null)IOException - on error writing to documentvoid startTagOpen(int index,
String name)
throws IOException
closeStartTag() call.index - namespace URI index numbername - unqualified element nameIOException - on error writing to documentvoid startTagNamespaces(int index,
String name,
int[] nums,
String[] prefs)
throws IOException
index - namespace URI index numbername - element namenums - array of namespace indexes defined by this element (must
be constant, reference is kept until end of element)prefs - array of namespace prefixes mapped by this element (no
null values, use "" for default namespace declaration)IOException - on error writing to documentvoid addAttribute(int index,
String name,
String value)
throws IOException
startTagOpen(int, java.lang.String) and before the corresponding call to closeStartTag().index - namespace URI index numbername - unqualified attribute namevalue - text value for attributeIOException - on error writing to documentvoid closeStartTag()
throws IOException
startTagOpen(int, java.lang.String).IOException - on error writing to documentvoid closeEmptyTag()
throws IOException
startTagOpen(int, java.lang.String).IOException - on error writing to documentvoid startTagClosed(int index,
String name)
throws IOException
index - namespace URI index numbername - unqualified element nameIOException - on error writing to documentvoid endTag(int index,
String name)
throws IOException
index - namespace URI index numbername - unqualified element nameIOException - on error writing to documentvoid writeTextContent(String text) throws IOException
text - content value text (must not be null)IOException - on error writing to documentvoid writeCData(String text) throws IOException
text - content value text (must not be null)IOException - on error writing to documentvoid writeComment(String text) throws IOException
text - comment text (must not be null)IOException - on error writing to documentvoid writeEntityRef(String name) throws IOException
name - entity name (must not be null)IOException - on error writing to documentvoid writeDocType(String name, String sys, String pub, String subset) throws IOException
name - root element namesys - system ID (null if none, must be
non-null for public ID to be used)pub - public ID (null if none)subset - internal subset (null if none)IOException - on error writing to documentvoid writePI(String target, String data) throws IOException
target - processing instruction target name (must not be
null)data - processing instruction data (must not be null)IOException - on error writing to documentvoid indent()
throws IOException
IOException - on error writing to documentvoid flush()
throws IOException
IOException - on error writing to documentvoid close()
throws IOException
IOException - on error writing to documentvoid reset()
String[] getNamespaces()
String getNamespaceUri(int index)
index - namespace URI index numbernull if the namespace index
is invalidString getNamespacePrefix(int index)
index - namespace URI index numbernull if the namespace is not
currently mappedint getPrefixIndex(String prefix)
prefix - text to match (non-null, use "" for default
prefix)void pushExtensionNamespaces(String[] uris)
uris - namespace URIs to extend those in mappingvoid popExtensionNamespaces()
pushExtensionNamespaces(java.lang.String[]).String[][] getExtensionNamespaces()
null if
none)int[] openNamespaces(int[] nums,
String[] prefs)
throws IOException
nums - array of namespace indexes defined by this element (reference
kept until namespaces are closed, values may be modified by this method)prefs - array of namespace prefixes mapped by this element (no
null values, use "" for default namespace declaration)IOException - on error writing to documentvoid pushTranslationTable(int[] table)
table - translation table to be used (null if no
change)void popTranslationTable()
Copyright © 2005-2013 jibx.org. All Rights Reserved.