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