Command closeWriter


This command is part of the StAX support.

Name

closeReader Closes a StAX Writer created with newStreamWriter


Synopsis

closeReader $reader


Description

closeWriter closes the writer created with newStreamWriter. If you do not close the writer when you are through it may cause open file handles to stay open until the shell exits the current scope and garbage collection occurs.

Note that unlike many of the StAX functions this is a command not a function. You use the Command syntax to invoke it.


Example
import commands stax=stax

w=stax:newStreamWriter()
stax:writeStartDocument $w
stax:writeStartElement $w foo
stax:writeAttribute $w a1 value1
stax:writeCharacters $w "Some Characters"
stax:writeEndElement $w
stax:writeEndDocument $w


stax:closeWriter $w


Result
<foo a1="value1">Some Characters</foo>




Commands
StAX Functions
newStreamWriter

Java Objects
There are no comments on this page.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki