|
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 // Processing instruction node functions |
|
15 // |
|
16 |
|
17 #include <xml/dom/xmlengprocessinginstruction.h> |
|
18 #include <xml/dom/xmlengcomment.h> |
|
19 #include "xmlengdomdefs.h" |
|
20 #include <xml/utils/xmlengxestrings.h> //pjj18 |
|
21 |
|
22 // --------------------------------------------------------------- |
|
23 // @return "Target" part of a processing instruction |
|
24 // |
|
25 // @code |
|
26 // <?target data?> |
|
27 // @endcode |
|
28 // |
|
29 // @see http://www.w3.org/TR/2004/REC-xml-20040204/#sec-pi |
|
30 // --------------------------------------------------------------- |
|
31 // |
|
32 EXPORT_C TPtrC8 TXmlEngProcessingInstruction::Target() const |
|
33 { |
|
34 XE_ASSERT_DEBUG(LIBXML_NODE); |
|
35 // |
|
36 return ((TXmlEngConstString)CAST_XMLCHAR_TO_DOMSTRING(LIBXML_NODE->name)).PtrC8(); |
|
37 } |
|
38 |
|
39 // --------------------------------------------------------------- |
|
40 // @return "Data" part of a processing instruction |
|
41 // |
|
42 // @code |
|
43 // <?target data?> |
|
44 // @endcode |
|
45 // |
|
46 // @see http://www.w3.org/TR/2004/REC-xml-20040204/#sec-pi |
|
47 // --------------------------------------------------------------- |
|
48 // |
|
49 EXPORT_C TPtrC8 TXmlEngProcessingInstruction::Data() const |
|
50 { |
|
51 XE_ASSERT_DEBUG(LIBXML_NODE); |
|
52 // |
|
53 return ((TXmlEngConstString)CAST_XMLCHAR_TO_DOMSTRING(LIBXML_NODE->content)).PtrC8(); |
|
54 } |
|
55 |
|
56 // --------------------------------------------------------------- |
|
57 // Sets data part of processing instruction |
|
58 // |
|
59 // @note PI contents should not contain "?>" sequence |
|
60 // --------------------------------------------------------------- |
|
61 // |
|
62 EXPORT_C void TXmlEngProcessingInstruction::SetDataL(const TDesC8& aData) |
|
63 { |
|
64 AsComment().SetContentsL(aData); |
|
65 } |
|
66 |