Hi;
I need to be able to create a single xml node in utf-8 and do it efficiently
as this is called a lot (reason below).
What is the best way to do this? I need to end up with a string like "<node
attr1='dave'>hi there</node>" where &"<>' are all encoded and chars > 127 are
turned into utf-8. I then write this to a file (and what is the best way to
do that)?
Now as to why for the curious. This is for an audit trail and therefore each
node must be written and flushed to disk and the file is opened in append
mode where the permissions on the file allow appending, but not overwriting.
The app can stop and re-start in the middle of the day so when it starts and
we have no audit file, we write <root>. We then add nodes as actions occur.
On the first write after midnight, we write </root>, clode & rename the file,
then open another.
So we can't use XmlWriter as we are not writing a complete xml file and we
need to be able to flush.
--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com