Revision [1735]

This is an old revision of FunctionStAXwrite made by DavidLee on 2011-05-31 13:23:17.

 

Command write


This command is part of the StAX support.

Name

write writes an XML node or characters to a StAX Writer created with newStreamWriter


Synopsis

write writer value [value ...]


Description

write writes XML nodes or charactor dta to a writer created with newStreamWriter.

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

Typically the write command is used instead of the other StAX write commands when you want to write an XML node which was previously created instead of constructing the XML manually using individual StAX commands.


The writer paramter is an writer created with newStreamWriter.
The value parameters are one or more XML objects or character data.



Example
import commands stax=stax


w=stax:newStreamWriter()
stax:writeStartDocument $w
stax:writeStartElement $w foo
stax:write $w <[ <bar>spam</bar> ]> "Text"
stax:writeEndElement $w
stax:writeEndDocument $w
stax:closeWriter $w


Result
<foo>
   <bar>spam</bar>Text</foo>




Commands
StAX Functions
newStreamWriter

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