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: Inline functions specyfic for element node
25 // -------------------------------------------------------------------------------------
26 // Default constructor
27 // -------------------------------------------------------------------------------------
29 inline TXmlEngElement::TXmlEngElement():TXmlEngNode(NULL) {}
31 // -------------------------------------------------------------------------------------
33 // -------------------------------------------------------------------------------------
35 inline TXmlEngElement::TXmlEngElement(void* aInternal): TXmlEngNode(aInternal) {}
38 // -------------------------------------------------------------------------------------
39 // Creates new attribute node using namespace of its parent element (this element),
40 // sets attribute's value and links it as the last attribute of the element
42 // @param aName - Local name of attribute
43 // @param aValue - Value to set for new attribute or NULL (sets value to "")
44 // @return A handler to the newly created attribute node;
46 // For more hints how to use it refer to AddNewAttributeL(const TDesC8&,const TDesC8&)
49 // - No checks are made that attribute with such name exists
50 // - if namespace of the parent element is default (i.e. bound prefix is NULL),
51 // then temporary prefix will be used and bound to the same namespace URI as elements
52 // (It is due to the fact that default namespaces do not spread on unprefixed attributes,
53 // see http://w3.org/TR/REC-xml-names/#defaulting)
54 // -------------------------------------------------------------------------------------
56 inline TXmlEngAttr TXmlEngElement::AddNewAttributeSameNsL(const TDesC8& aName, const TDesC8& aValue)
58 return AddNewAttributeL(aName, aValue, NamespaceDeclaration());
61 // -------------------------------------------------------------------------------------
62 // @return Default namespace in the scope of the element
64 // NULL TXmlEngNamespace means that element with no prefix have no namespace associated
65 // because no default namespace was declared or default namespace was undeclared with <b>xmlns=""</b>
67 // Equivalent to LookupNamespaceByPrefixL() with NULL (or "") prefix provided
68 // -------------------------------------------------------------------------------------
70 inline TXmlEngNamespace TXmlEngElement::DefaultNamespaceL() const
72 return LookupNamespaceByPrefixL(KNullDesC8);
75 // -------------------------------------------------------------------------------------
76 // Specialized version of TXmlEngNode::CopyL()
78 // @return Deep copy of the element.
79 // -------------------------------------------------------------------------------------
81 inline TXmlEngElement TXmlEngElement::CopyL() const
82 {return TXmlEngNode::CopyL().AsElement();}
84 // -------------------------------------------------------------------------------------
85 // Removes all element contents: child nodes, attributes and namespace declarations
87 // @see RemoveChildren(), RemoveAttributes(), RemoveNamespaceDeclarations();
88 // -------------------------------------------------------------------------------------
90 inline void TXmlEngElement::ClearElement()
94 RemoveNamespaceDeclarations();
97 // -------------------------------------------------------------------------------------
98 // -------------------------------------------------------------------------------------
102 // -------------------------------------------------------------------------------------
103 // Returns TRUE if the element holds an attribute with such namespace URI and name.
105 // Same result gives AttributeNodeL(uri,name).NotNull()
106 // -------------------------------------------------------------------------------------
108 inline TBool TXmlEngElement::HasAttributeL(const TDesC8& aLocalName, const TDesC8& aNamespaceUri) const
109 {return AttributeNodeL(aLocalName, aNamespaceUri).NotNull();}