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