diff options
Diffstat (limited to 'doc/html/xml-sax-features-walkthrough.html')
-rw-r--r-- | doc/html/xml-sax-features-walkthrough.html | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/doc/html/xml-sax-features-walkthrough.html b/doc/html/xml-sax-features-walkthrough.html index 7b8241de0..1cdf7720a 100644 --- a/doc/html/xml-sax-features-walkthrough.html +++ b/doc/html/xml-sax-features-walkthrough.html @@ -88,17 +88,17 @@ and thus influence how the XML data are read. <p> Now let's think about presenting the output: As described in the <a href="xml.html#sax2Features">TQt SAX2 documentation</a> there are three valid combinations of <em>http://xml.org/sax/features/namespace-prefixes</em> -and <em>http://xml.org/sax/features/namespaces</em>: TRUE/TRUE, TRUE/FALSE and -FALSE/TRUE. To show the relevant output side by side of each other +and <em>http://xml.org/sax/features/namespaces</em>: true/true, true/false and +false/true. To show the relevant output side by side of each other and mark them with three labels makes up for a grid layout consisting of three columns (and thus two lines). <p> <pre> <a href="tqlistview.html">TQListView</a> * nameSpace = new <a href="tqlistview.html">TQListView</a>( container, "table_namespace" ); </pre> <p> The most natural way of presenting XML elements is in a tree. Thus we use a listview. Its name <em>nameSpace</em> indicates that this -one will be used to present the combination of <em>http://xml.org/sax/features/namespaces</em> being TRUE and +one will be used to present the combination of <em>http://xml.org/sax/features/namespaces</em> being true and <em>http://xml.org/sax/features/namespace-prefixes</em> -being FALSE -- the default configuration of a <a href="tqxmlsimplereader.html">TQXmlSimpleReader</a>. +being false -- the default configuration of a <a href="tqxmlsimplereader.html">TQXmlSimpleReader</a>. <p> Being the first grid entry the <em>nameSpace</em> listview will appear in the upper left corner of the virtual grid. <p> <pre> StructureParser * handler = new StructureParser( nameSpace ); @@ -130,12 +130,12 @@ the upper grid row. <p> Then we ask the <em>handler</em> to present the data in the <em>namespacePrefix</em> listview. <p> <pre> <a name="x2125"></a> reader.<a href="tqxmlsimplereader.html#setFeature">setFeature</a>( "http://xml.org/sax/features/namespace-prefixes", - TRUE ); + true ); </pre> <p> Now we modify the behaviour of the <em>reader</em> and change -<em>http://xml.org/sax/features/namespace-prefixes</em> from the default FALSE -to TRUE. The <em>http://xml.org/sax/features/namespaces</em> feature has -still its default setting TRUE. +<em>http://xml.org/sax/features/namespace-prefixes</em> from the default false +to true. The <em>http://xml.org/sax/features/namespaces</em> feature has +still its default setting true. <p> <pre> source.<a href="tqxmlinputsource.html#reset">reset</a>(); </pre> <p> We have to reset the input source to make the new parsing start from the @@ -143,35 +143,35 @@ beginning of the document again. <p> <pre> reader.<a href="tqxmlsimplereader.html#parse">parse</a>( source ); </pre> <p> Finally we parse the XML file a second time with the changed reader -settings (TRUE/TRUE). +settings (true/true). <p> <pre> <a href="tqlistview.html">TQListView</a> * prefix = new <a href="tqlistview.html">TQListView</a>( container, "table_prefix"); handler->setListView( prefix ); - reader.<a href="tqxmlsimplereader.html#setFeature">setFeature</a>( "http://xml.org/sax/features/namespaces", FALSE ); + reader.<a href="tqxmlsimplereader.html#setFeature">setFeature</a>( "http://xml.org/sax/features/namespaces", false ); source.<a href="tqxmlinputsource.html#reset">reset</a>(); reader.<a href="tqxmlsimplereader.html#parse">parse</a>( source ); </pre> <p> Next we prepare and use the upper right listview to show the reader results with the feature setting <em>http://xml.org/sax/features/namespaces</em> -FALSE and <em>http://xml.org/sax/features/namespace-prefixes</em> TRUE. +false and <em>http://xml.org/sax/features/namespace-prefixes</em> true. <p> <pre> // namespace label (void) new <a href="tqlabel.html">TQLabel</a>( "Default:\n" - "http://xml.org/sax/features/namespaces: TRUE\n" - "http://xml.org/sax/features/namespace-prefixes: FALSE\n", + "http://xml.org/sax/features/namespaces: true\n" + "http://xml.org/sax/features/namespace-prefixes: false\n", container ); // namespace prefix label (void) new <a href="tqlabel.html">TQLabel</a>( "\n" - "http://xml.org/sax/features/namespaces: TRUE\n" - "http://xml.org/sax/features/namespace-prefixes: TRUE\n", + "http://xml.org/sax/features/namespaces: true\n" + "http://xml.org/sax/features/namespace-prefixes: true\n", container ); // prefix label (void) new <a href="tqlabel.html">TQLabel</a>( "\n" - "http://xml.org/sax/features/namespaces: FALSE\n" - "http://xml.org/sax/features/namespace-prefixes: TRUE\n", + "http://xml.org/sax/features/namespaces: false\n" + "http://xml.org/sax/features/namespace-prefixes: true\n", container ); </pre> <p> The second row of the <em>container</em> grid is filled with three labels @@ -328,7 +328,7 @@ Its listview item is therefore a direct child of the <p> <pre> stack.push( element ); </pre> <p> Now we put the element's listview item on top of the stack. -<p> <pre> element-><a href="tqlistviewitem.html#setOpen">setOpen</a>( TRUE ); +<p> <pre> element-><a href="tqlistviewitem.html#setOpen">setOpen</a>( true ); </pre> <p> By default a <a href="tqlistview.html">TQListView</a> presents all of its nodes closed. The user may then click on the <em>+</em> icon to see the child @@ -348,11 +348,11 @@ Therefore we open each listview item manually. qualified name and the relevant namespace URI (or nothing). Obviously <em>attribute</em> is a child of the current <em>element</em>. -<p> <pre> return TRUE; +<p> <pre> return true; } </pre> <p> To prevent the reader from throwing an error we have to -return TRUE when we successfully dealt with an +return true when we successfully dealt with an element's start tag. <p> <pre> bool StructureParser::<a href="tqxmlcontenthandler.html#endElement">endElement</a>( const <a href="tqstring.html">TQString</a>&, const <a href="tqstring.html">TQString</a>&, const <a href="tqstring.html">TQString</a>& ) @@ -362,7 +362,7 @@ element's start tag. <p> Whenever we come across an element's closing tag we have to remove its listview item from the stack as it can't have children any longer. -<p> <pre> return TRUE; +<p> <pre> return true; } </pre> <p> And so we're done. |