From 4d495175043c399fdca6e1bb4c74ef176fc76fb4 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Wed, 6 Aug 2025 11:29:57 +0900 Subject: Replace TRUE/FALSE with boolean values true/false - part 4 Signed-off-by: Michele Calgaro --- doc/html/xml.html | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'doc/html/xml.html') diff --git a/doc/html/xml.html b/doc/html/xml.html index a165654b9..0ba798f0c 100644 --- a/doc/html/xml.html +++ b/doc/html/xml.html @@ -286,30 +286,30 @@ attributes starting with xmlns:) are reported. name="Eris Kallisti"/> -With http://xml.org/sax/features/namespace-prefixes set to TRUE -the reader will report four attributes; but with the namespace-prefixes feature set to FALSE only three, with the xmlns:fnord attribute defining a namespace being "invisible" to the +With http://xml.org/sax/features/namespace-prefixes set to true +the reader will report four attributes; but with the namespace-prefixes feature set to false only three, with the xmlns:fnord attribute defining a namespace being "invisible" to the reader.

The http://xml.org/sax/features/namespaces feature is responsible -for reporting local names, namespace prefixes and URIs. With http://xml.org/sax/features/namespaces set to TRUE the parser will +for reporting local names, namespace prefixes and URIs. With http://xml.org/sax/features/namespaces set to true the parser will report title as the local name of the fnord:title attribute, fnord being the namespace prefix and http://trolltech.com/fnord/ as the namespace URI. When http://xml.org/sax/features/namespaces is -FALSE none of them are reported. +false none of them are reported.

In the current implementation the TQt XML classes follow the definition that the prefix xmlns itself isn't associated with any namespace at all (see http://www.w3.org/TR/1999/REC-xml-names-19990114/#ns-using). Therefore even with http://xml.org/sax/features/namespaces and -http://xml.org/sax/features/namespace-prefixes both set to TRUE +http://xml.org/sax/features/namespace-prefixes both set to true the reader won't return either a local name, a namespace prefix or a namespace URI for xmlns:fnord.

This might be changed in the future following the W3C suggestion http://www.w3.org/2000/xmlns/ to associate xmlns with the namespace http://www.w3.org/2000/xmlns.

As the SAX2 standard suggests, TQXmlSimpleReader defaults to having -http://xml.org/sax/features/namespaces set to TRUE and -http://xml.org/sax/features/namespace-prefixes set to FALSE. +http://xml.org/sax/features/namespaces set to true and +http://xml.org/sax/features/namespace-prefixes set to false. When changing this behavior using TQXmlSimpleReader::setFeature() note that the combination of both features set to -FALSE is illegal. +false is illegal.

For a practical demonstration of how the two features affect the output of the reader run the tagreader with features example.

@@ -322,10 +322,10 @@ output of the reader run the tagr Qualified names Prefix mapping xmlns attributes - (TRUE, FALSE) Yes Yes* Yes No - (TRUE, TRUE) Yes Yes Yes Yes - (FALSE, TRUE) No* Yes No* Yes - (FALSE, FALSE) Illegal + (true, false) Yes Yes* Yes No + (true, true) Yes Yes Yes Yes + (false, true) No* Yes No* Yes + (false, false) Illegal

* The behavior of these entries is not specified by SAX.

-- cgit v1.2.3