Class $k.XMLWriter
SAX interface for writing XML. An XMLWriter is created by sending xmlWriter() to a document.
- Defined in: XMLWriter.js
Constructor Attributes | Constructor Name and Description |
---|---|
Method Summary
Class Detail
$k.XMLWriter()
Method Detail
-
attribute(localName, value, prefix)Writes an attribute of a tag to the document
- Parameters:
- {string} localName
- Local name of the attribute
- {string} value
- Value of the attribute
- {string} prefix Optional
- Namespace prefix. The writer does not check if it is bound to a namespace
- Throws:
- {$k.exception.XMLError}
- If writing the attribute is not possible
-
cdata(characters)Writes a CDATA section to the document
- Parameters:
- {string} characters
- Throws:
- {$k.exception.XMLError}
- If writing the CData is not possible
-
characters(characters)Writes a string to the document
- Parameters:
- {string} characters
- Throws:
- {$k.exception.XMLError}
- If writing the string is not possible
-
comment(comment)Writes a comment to the document
- Parameters:
- {string} comment
- Throws:
- {$k.exception.XMLError}
- If writing the comment is not possible
-
defaultNamespace(namespace)Write the default namespace of the current tag and its children
- Parameters:
- {string} namespace
- Throws:
- {$k.exception.XMLError}
- If writing the namespace is not possible
-
endElement()Closes the currently opened tag
- Throws:
- {$k.exception.XMLError}
- If closing the tag is not possible
-
print(characters)Writes a string to the document without any escaping
- Parameters:
- {string} characters
- Throws:
- {$k.exception.XMLError}
- If writing the string is not possible
-
processingInstruction(target, data)Writes a processing instruction to the document
- Parameters:
- {string} target
- {string} data
- Throws:
- {$k.exception.XMLError}
- If writing the comment is not possible
-
setIndent(enableIndentation)Enable/disable automatic indentation of the XML tags. Default is true
- Parameters:
- {boolean} enableIndentation
-
setPrefix(prefix, namespace)Sets the prefix the uri is bound to
- Parameters:
- {string} prefix
- {string} namespace
-
startElement(localName, prefix)Writes a start tag to the document
- Parameters:
- {string} localName
- Local name of the tag
- {string} prefix Optional
- Namespace prefix. The writer does not check if it is bound to a namespace
- Throws:
- {$k.exception.XMLError}
- If writing the tag is not possible