williamr@4
|
1 |
// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@4
|
2 |
// All rights reserved.
|
williamr@4
|
3 |
// This component and the accompanying materials are made available
|
williamr@4
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
williamr@4
|
5 |
// which accompanies this distribution, and is available
|
williamr@4
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
williamr@4
|
7 |
//
|
williamr@4
|
8 |
// Initial Contributors:
|
williamr@4
|
9 |
// Nokia Corporation - initial contribution.
|
williamr@4
|
10 |
//
|
williamr@4
|
11 |
// Contributors:
|
williamr@4
|
12 |
//
|
williamr@4
|
13 |
// Description:
|
williamr@4
|
14 |
// Text node functions
|
williamr@4
|
15 |
//
|
williamr@2
|
16 |
|
williamr@2
|
17 |
|
williamr@2
|
18 |
|
williamr@2
|
19 |
/**
|
williamr@4
|
20 |
@file
|
williamr@4
|
21 |
@publishedAll
|
williamr@4
|
22 |
@released
|
williamr@4
|
23 |
*/
|
williamr@4
|
24 |
#ifndef XMLENGTEXT_H
|
williamr@4
|
25 |
#define XMLENGTEXT_H
|
williamr@4
|
26 |
|
williamr@4
|
27 |
#include <xml/dom/xmlengcharacterdata.h>
|
williamr@4
|
28 |
|
williamr@4
|
29 |
|
williamr@4
|
30 |
/**
|
williamr@4
|
31 |
The TXmlEngTextNode class inherits from TXmlEngCharacterData and represents the
|
williamr@4
|
32 |
textual content (termed "character data" in XML) of an Element or TXmlEngAttr.
|
williamr@4
|
33 |
|
williamr@4
|
34 |
If there is no markup inside an element's content, the text is contained in a
|
williamr@4
|
35 |
single TXmlEngTextNode that is the only child of the element. If there is
|
williamr@4
|
36 |
markup, it is parsed into the information items (elements, comments, etc.) and
|
williamr@4
|
37 |
the TXmlEngTextNode nodes that form the list of children of the element.
|
williamr@4
|
38 |
|
williamr@4
|
39 |
When a document is first made available via the DOM, there is only one
|
williamr@4
|
40 |
TXmlEngTextNode node for each block of text. Users may create adjacent
|
williamr@4
|
41 |
TXmlEngTextNode nodes that represent the contents of a given element without
|
williamr@4
|
42 |
any intervening markup, but should be aware that there is no way to represent
|
williamr@4
|
43 |
the separations between these nodes in XML or HTML, so they will not (in
|
williamr@4
|
44 |
general) persist between DOM editing sessions.
|
williamr@4
|
45 |
|
williamr@4
|
46 |
No lexical check is done on the content of a TXmlEngTextNode node and depending
|
williamr@4
|
47 |
on its position in the document, some characters must be escaped during
|
williamr@4
|
48 |
serialization using character references. For example, the characters "<&" if
|
williamr@4
|
49 |
the textual content is part of an element or an attribute, the character
|
williamr@4
|
50 |
sequence "]]>" when part of an element, the quotation mark character " or the
|
williamr@4
|
51 |
apostrophe character ' when part of an attribute.
|
williamr@4
|
52 |
|
williamr@4
|
53 |
@see http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#ID-1312295772
|
williamr@4
|
54 |
*/
|
williamr@2
|
55 |
class TXmlEngTextNode : public TXmlEngCharacterData
|
williamr@2
|
56 |
{
|
williamr@2
|
57 |
public:
|
williamr@4
|
58 |
/** Default constructor */
|
williamr@2
|
59 |
inline TXmlEngTextNode();
|
williamr@2
|
60 |
|
williamr@2
|
61 |
/**
|
williamr@4
|
62 |
Check if the element content is whitespace. Whitespace may be an empty element,
|
williamr@4
|
63 |
or the characters space, tab, LF, or CR.
|
williamr@4
|
64 |
@return ETrue if the element content only contains whitespace, EFalse otherwise
|
williamr@4
|
65 |
*/
|
williamr@2
|
66 |
IMPORT_C TBool IsElementContentWhitespace() const;
|
williamr@2
|
67 |
|
williamr@2
|
68 |
protected:
|
williamr@2
|
69 |
/**
|
williamr@4
|
70 |
Constructor
|
williamr@4
|
71 |
@param aInternal Text node pointer
|
williamr@4
|
72 |
*/
|
williamr@2
|
73 |
inline TXmlEngTextNode(void* aInternal);
|
williamr@2
|
74 |
};
|
williamr@2
|
75 |
|
williamr@2
|
76 |
|
williamr@4
|
77 |
#include <xml/dom/xmlengtext.inl>
|
williamr@2
|
78 |
|
williamr@4
|
79 |
#endif /* XMLENGTEXT_H */
|
williamr@2
|
80 |
|