From: Makoto O. <on...@ac...> - 2002-10-04 00:46:48
|
Hi Steffi, It took around three days to become a xmltk-dev ML member. Now I can post the answers. I summarize all our mails for future reference. 1. filter" out certain subtrees So, you need to get the subtree when you receive the context event. I know why TJ implements the CTSAX2XML::startElement in above way. That may be one of our fault that we divided a startElement event and its attribute events. Think about such a case: <bib owner="makoto"> <book>.... </book> ... </bib> When you receive START context 2, the CTSAX2XML can not close the bib start element, because users can invoke attribute() events for the output bib element. The CTSAX2XML needs to know there will be no attribute for the last startElement. We need to modify the CTSAX2XML to have a such function. There is some a simple solution: modify the CTSAX2XML::_CloseBracketIfNeeded() as a public function and you invoke it to let the TSAX2XML know it can close the bracket. In addition, if you use the TSAX2BIN, there is no bracket in our binary format and there is no such problem like TSAX2XML. 2. about the IMemoryStream for output Two function - CreateTSAX2Bin(RCLIID riid, void **ppvObj); - CreateTSAX2XML(RCLIID riid, void **ppvObj, FILE *pfOut, int iIndent = 0); are encapslated under the ITSAXContentHandler *CreateStdoutStream(bool bBinary). Once you construct a ITSAXContentHandler using the above funtions, you don't need to pay any attention about its output XML type (plain or binary). Like above, maybe, we need to implement ITSAXContentHandler *CreateStdoutMemoryStream(bool bBinary). 3. IFileStream -> CopyTo. Steffi found that "one has to rewind streams before one can copy their contents. So it was implemented." 4. IMemoryStream: SetSize, setGrowSize You can set the buffer size with SetSize(). But the buffer size automatically grows. If you invoke setGrowSize(0), then it will leads an system error. I think it is easy to modify the MemoryStream to receive getGrowSize(0) not to extend its buffer size. makoto |