OmXmlWriter
IntroductionWrites formatted XML to an OmIByteStream, streaming as it goes (mostly) Member Functions
addAttribute(const char *, const char *)Adds an attribute to an element, like <element attr="value"> public addAttribute(const char *, long long int)Adds an attribute to an element from an integer public addAttributeFAdds an attribute to an element, using printf semantics public addAttributeFBigHandle oversized attribute. :-/ public addAttributeUrlFAdds an attribute to an element, using printf semantics, and %20 escapes. public addContentAdds text to an element, like <element>content</element> public addContentFAdds text to an element, using printf semantics public addContentRawAdds text to the document ignoring XML rules But also needed things like rendering DOCTYPE at the start. Caution. public addElement(const char *)Adds an element with no attributes or content (no need for endElement()) like <hr/> public addElement(const char *, const char *)Adds an element with content (no need for endElement()) like <h1>Content</h1> public addElementFAdds an element with content (no need for endElement()) like <h1>Content</h1> public beginElement(const char *)Begins a new XML element, like <elementName> public beginElement(const char *, const char *, const char *)Begins a new XML element with one attribute already in it, like <elementName attr="value"> public endElement()Ends the most recent beginElement(). Caps them with either <element/> or </element>. public endElement(const char *)Ends most recent beginElement, and prints error message if element name does not match. public endElementsEnds any remaining elements. public getByteCountBytes written. public getErrorCountReturns nonzero of any errors occurred, usually buffer overruns leading to missing portions. public OmXmlWriterInstantiate an XML writer to write into the specified buffer public putpublic DiscussionOur own put. OmXmlWriter needs to know what context it's in, to manage escapes correctly. also relies upon some new concepts like beginAttribute, <stream a big attribute value>, endAttribute. setIndentingEnables primitive formatting. Uses more bytes of buffer. public |