Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
2 * Copyright (c) 2004-2006 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Namespace node functions
24 #ifndef XMLENGINE_NAMESPACE_H_INCLUDED
25 #define XMLENGINE_NAMESPACE_H_INCLUDED
27 #include "xmlengnode.h"
30 * Represents existing namespace declaration in DOM tree <b>OR</b> namespace node returned
31 * in RXmlEngNodeSet as a result of some XPath expression.
33 * All elements and attributes may have a namespace instance associated.
34 * Once put in element, a namespace declaration (instance of TXmlEngNamespace) may be
35 * referred to by all attributes and descentants of the element (unless
36 * prefix that this namespace-to-prefix binding uses is overriden somewhere below in the document tree)
38 * <b>General rules of namespace handling:</b>
40 * - <b>NULL</b> prefix in namespace node means NO PREFIX. ""(empty string '\\0') can be used for specifying
41 * absense of prefix when setting it, however <b>NULL</b> will be stored and returned.
43 * - <b>NULL</b> value of namespace URI is legal only with <b>NULL</b> prefix and only met in
44 * undeclaration of namespace (<i>xmlns=""</i>). <b>""</b> (empty string) can be used too, however it
45 * will be returned as <b>NULL</b>.
47 * - <b>NULL</b> or <b>""</b> namespace <b>URI</b> with non-<b>NULL</b> prefix is illegal acording to the XML specification.
49 * - Namespace of a element is <b>default</b> if it is associated with some namespace declaration with <b>NULL</b> prefix.
51 * - Elements are never associated with namespace undeclarations (<b>xmlns=""</b>), instead, such elements have no
52 * namespace declaration referred to.
54 * - Attributes do not have <i>default</i> namespace. Even if it is effective at element scope,
55 * default namespace declaration is not applied to element's attributes (according to the XML specification)
57 * - Namespace of a node (element or attribute) is <b>undefined</b> if no namespace declaration is
60 * - Node with <i>undefined</i> namespace is serialized as having no prefix. In general,
61 * DOM API handles the complexity of namespace declaration handling and creates neccessary
62 * namespace declarations and undeclares default namespace. However, some node-creation methods (e.g. TXmlEngElement::AddNewElementL())
63 * do not ensure that created node with undefined namespace (thus, without a prefix) will
64 * actually treated after serialization as having some <i>default</i> namespace
67 * Namespace nodes that are result of XPath expression have following restrictions:
68 * - they cannot be used as namespace definitions, because they are not part of
69 * the DOM tree, but copies of existing namespace definitions.
70 * - namespace prefix is not available because it is not mandated by DOM Level 3 XPath module API,
71 * so in returned copies of DOM tree, namespaces prefix strings are not preserved
72 * and Prefix() returns NULL.
74 * @lib XmlEngineDOM.lib
77 class TXmlEngNamespace: public TXmlEngNode
85 inline TXmlEngNamespace();
92 * @return Namespace URI string
93 * @note "" is never returned - it is replaced with NULL
95 * For TXmlEngNamespace(NULL) or namespace undeclaration (xmlns=""), which are
96 * treatet as <i>undefined namespace</i> returns NULL,
97 * otherwise result is not a NULL string and not a "" (empty string).
99 IMPORT_C TPtrC8 Uri() const;
102 * Get namespace prefix.
105 * @return prefix that is bound in the namespace declaration
106 * or NULL string for default namespace or if no binding exist
108 IMPORT_C TPtrC8 Prefix() const;
111 * Check if namespace is default.
114 * @return Whether it is a definition of default namespace
115 * TRUE -- is a default namespace (no prefix)
116 * FALSE -- not a default namespace (bound to prefix) or empty TXmlEngNamespace(NULL) instance
118 IMPORT_C TBool IsDefault() const;
121 * Check if namespace is undefined
124 * @return Whether the namespace is undefined
126 * A node's namespace is undefined if no namespace declaration associated with it.
127 * @note Same as TXmlEngNode::IsNull()
129 IMPORT_C TBool IsUndefined() const;
133 * Workaround to avoid misuse of TXmlEngNode::NamespaceUri() method, which should not be
134 * applied to TXmlEngNamespace node. Since the name of the inherited method from TXmlEngNode
135 * is too similar to TXmlEngNamespace::Uri(), NamespaceUri() is disabled for direct
137 * If NamespaceUri() is called on the TXmlEngNamespace object that is downcasted to TXmlEngNode, then
138 * NamespaceUri()'s result equals to result of Uri() method.
143 inline TPtrC8 NamespaceUri();
150 * @param aPtr Namespace pointer
152 inline TXmlEngNamespace(void* aPtr);
154 friend class TXmlEngElement;
155 friend class TXmlEngNode;
158 #include "xmlengnamespace.inl"
160 #endif /* XMLENGINE_NAMESPACE_H_INCLUDED */