williamr@4: // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@4: // All rights reserved. williamr@4: // This component and the accompanying materials are made available williamr@4: // under the terms of "Eclipse Public License v1.0" williamr@4: // which accompanies this distribution, and is available williamr@4: // at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@4: // williamr@4: // Initial Contributors: williamr@4: // Nokia Corporation - initial contribution. williamr@4: // williamr@4: // Contributors: williamr@4: // williamr@4: // Description: williamr@4: // Text node functions williamr@4: // williamr@2: williamr@2: williamr@2: williamr@2: /** williamr@4: @file williamr@4: @publishedAll williamr@4: @released williamr@4: */ williamr@4: #ifndef XMLENGTEXT_H williamr@4: #define XMLENGTEXT_H williamr@4: williamr@4: #include williamr@4: williamr@4: williamr@4: /** williamr@4: The TXmlEngTextNode class inherits from TXmlEngCharacterData and represents the williamr@4: textual content (termed "character data" in XML) of an Element or TXmlEngAttr. williamr@4: williamr@4: If there is no markup inside an element's content, the text is contained in a williamr@4: single TXmlEngTextNode that is the only child of the element. If there is williamr@4: markup, it is parsed into the information items (elements, comments, etc.) and williamr@4: the TXmlEngTextNode nodes that form the list of children of the element. williamr@4: williamr@4: When a document is first made available via the DOM, there is only one williamr@4: TXmlEngTextNode node for each block of text. Users may create adjacent williamr@4: TXmlEngTextNode nodes that represent the contents of a given element without williamr@4: any intervening markup, but should be aware that there is no way to represent williamr@4: the separations between these nodes in XML or HTML, so they will not (in williamr@4: general) persist between DOM editing sessions. williamr@4: williamr@4: No lexical check is done on the content of a TXmlEngTextNode node and depending williamr@4: on its position in the document, some characters must be escaped during williamr@4: serialization using character references. For example, the characters "<&" if williamr@4: the textual content is part of an element or an attribute, the character williamr@4: sequence "]]>" when part of an element, the quotation mark character " or the williamr@4: apostrophe character ' when part of an attribute. williamr@4: williamr@4: @see http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#ID-1312295772 williamr@4: */ williamr@2: class TXmlEngTextNode : public TXmlEngCharacterData williamr@2: { williamr@2: public: williamr@4: /** Default constructor */ williamr@2: inline TXmlEngTextNode(); williamr@2: williamr@2: /** williamr@4: Check if the element content is whitespace. Whitespace may be an empty element, williamr@4: or the characters space, tab, LF, or CR. williamr@4: @return ETrue if the element content only contains whitespace, EFalse otherwise williamr@4: */ williamr@2: IMPORT_C TBool IsElementContentWhitespace() const; williamr@2: williamr@2: protected: williamr@2: /** williamr@4: Constructor williamr@4: @param aInternal Text node pointer williamr@4: */ williamr@2: inline TXmlEngTextNode(void* aInternal); williamr@2: }; williamr@2: williamr@2: williamr@4: #include williamr@2: williamr@4: #endif /* XMLENGTEXT_H */ williamr@2: