Additions:
stax:writeStartElement $w foo
stax:writeAttribute $w a1 value1
Result
<foo a1="value1">Some Characters</foo>
stax:writeAttribute $w a1 value1
Result
<foo a1="value1">Some Characters</foo>
Deletions:
stax:writeNamespace $w xmlsh2 http://www.xmlsh.org/test2
stax:writeAttribute $w QName( xmlsh2 http://www.xmlsh.org/test2 a1) value1
stax:writeComment $w "This is a comment"
stax:writeStartElement $w inner
stax:writeCData $w "This is CData"
Additions:
Note that unlike many of the ""StAX"" functions this is a command not a function. You use the Command syntax to invoke it.
Deletions:
Additions:
[[FunctionStAXnewStreamWriter newStreamWriter]]
Deletions:
Additions:
closeWriter closes the writer created with [[FunctionStAXnewStreamWriter 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.
Deletions:
Additions:
**closeReader** Closes a ""StAX Writer"" created with [[FunctionStAXnewStreamWriter newStreamWriter]]
closeWritercloses the writercreated with [[FunctionStAXnewStreamWriter newStreamWriter]]. If you do not close the writerwhen you are through it may cause open file handles to stay open until the shell exits the current scope and garbage collection occurs.
w=stax:newStreamWriter()
stax:writeStartDocument $w
stax:writeStartElement $w QName( xmlsh http://www.xmlsh.org/test1 test )
stax:writeNamespace $w xmlsh2 http://www.xmlsh.org/test2
stax:writeAttribute $w QName( xmlsh2 http://www.xmlsh.org/test2 a1) value1
stax:writeCharacters $w "Some Characters"
stax:writeComment $w "This is a comment"
stax:writeStartElement $w inner
stax:writeCData $w "This is CData"
stax:writeEndElement $w
stax:writeEndElement $w
stax:writeEndDocument $w
stax:closeWriter $w
closeWritercloses the writercreated with [[FunctionStAXnewStreamWriter newStreamWriter]]. If you do not close the writerwhen you are through it may cause open file handles to stay open until the shell exits the current scope and garbage collection occurs.
w=stax:newStreamWriter()
stax:writeStartDocument $w
stax:writeStartElement $w QName( xmlsh http://www.xmlsh.org/test1 test )
stax:writeNamespace $w xmlsh2 http://www.xmlsh.org/test2
stax:writeAttribute $w QName( xmlsh2 http://www.xmlsh.org/test2 a1) value1
stax:writeCharacters $w "Some Characters"
stax:writeComment $w "This is a comment"
stax:writeStartElement $w inner
stax:writeCData $w "This is CData"
stax:writeEndElement $w
stax:writeEndElement $w
stax:writeEndDocument $w
stax:closeWriter $w
Deletions:
closeWritercloses the writercreated with [[FunctionStAXnewEventWriter newEventWriter]]. If you do not close the writerwhen you are through it may cause open file handles to stay open until the shell exits the current scope and garbage collection occurs.
reader=stax:newEventReader( file.xml )
while [ stax:hasNext( $reader ) ] ; do
event=stax:nextEvent( $reader ) ;
done
stax:closeReader $reader