diff options
Diffstat (limited to 'doc/html/xml-sax-walkthrough.html')
| -rw-r--r-- | doc/html/xml-sax-walkthrough.html | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/doc/html/xml-sax-walkthrough.html b/doc/html/xml-sax-walkthrough.html index 4703e6cba..be4aa2572 100644 --- a/doc/html/xml-sax-walkthrough.html +++ b/doc/html/xml-sax-walkthrough.html @@ -100,13 +100,13 @@ get indentation right, there is nothing special about our new <p> <pre> <a name="x2137"></a>bool StructureParser::<a href="qxmlcontenthandler.html#startDocument">startDocument</a>() { indent = ""; - return TRUE; + return true; } </pre> <p> At the beginning of the document we simply set <em>indent</em> to an empty string because we want to print out the root element without any indentation. -Also we return TRUE so that the parser continues without +Also we return true so that the parser continues without reporting an error. <p> Because we want to be informed when the parser comes accross a start tag of an element and subsequently print it out, we @@ -117,7 +117,7 @@ have to overload <a href="qxmlcontenthandler.html#startElement">TQXmlContentHand { printf( "%s%s\n", (const char*)indent, (const char*)qName ); indent += " "; - return TRUE; + return true; } </pre> <p> This is what the implementation does: The name of the element with @@ -127,14 +127,14 @@ without an eventual prefix denoting the <a href="xml.html#namespaces">namespace. <p> If another element follows before the current element's end tag it should be indented. Therefore we add four spaces to the <em>indent</em> string. -<p> Finally we return TRUE in order to let the parser continue without +<p> Finally we return true in order to let the parser continue without errors. <p> The last functionality we need to add is the parser's behaviour when an end tag occurs. This means overloading <a href="qxmlcontenthandler.html#endElement">TQXmlContentHandler::endElement</a>(). <p> <pre> <a name="x2136"></a>bool StructureParser::<a href="qxmlcontenthandler.html#endElement">endElement</a>( const <a href="ntqstring.html">TQString</a>&, const <a href="ntqstring.html">TQString</a>&, const <a href="ntqstring.html">TQString</a>& ) { indent.remove( (uint)0, 4 ); - return TRUE; + return true; } </pre> <p> Obviously we then should shorten the <em>indent</em> string by the four |
