| 1 | // | 
|---|
| 2 | // ProcessingInstruction.cpp | 
|---|
| 3 | // | 
|---|
| 4 | // Library: XML | 
|---|
| 5 | // Package: DOM | 
|---|
| 6 | // Module:  DOM | 
|---|
| 7 | // | 
|---|
| 8 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. | 
|---|
| 9 | // and Contributors. | 
|---|
| 10 | // | 
|---|
| 11 | // SPDX-License-Identifier:	BSL-1.0 | 
|---|
| 12 | // | 
|---|
| 13 |  | 
|---|
| 14 |  | 
|---|
| 15 | #include "Poco/DOM/ProcessingInstruction.h" | 
|---|
| 16 |  | 
|---|
| 17 |  | 
|---|
| 18 | namespace Poco { | 
|---|
| 19 | namespace XML { | 
|---|
| 20 |  | 
|---|
| 21 |  | 
|---|
| 22 | ProcessingInstruction::ProcessingInstruction(Document* pOwnerDocument, const XMLString& target, const XMLString& data): | 
|---|
| 23 | AbstractNode(pOwnerDocument), | 
|---|
| 24 | _target(target), | 
|---|
| 25 | _data(data) | 
|---|
| 26 | { | 
|---|
| 27 | } | 
|---|
| 28 |  | 
|---|
| 29 |  | 
|---|
| 30 | ProcessingInstruction::ProcessingInstruction(Document* pOwnerDocument, const ProcessingInstruction& processingInstruction): | 
|---|
| 31 | AbstractNode(pOwnerDocument, processingInstruction), | 
|---|
| 32 | _target(processingInstruction._target), | 
|---|
| 33 | _data(processingInstruction._data) | 
|---|
| 34 | { | 
|---|
| 35 | } | 
|---|
| 36 |  | 
|---|
| 37 |  | 
|---|
| 38 | ProcessingInstruction::~ProcessingInstruction() | 
|---|
| 39 | { | 
|---|
| 40 | } | 
|---|
| 41 |  | 
|---|
| 42 |  | 
|---|
| 43 | void ProcessingInstruction::setData(const XMLString& data) | 
|---|
| 44 | { | 
|---|
| 45 | _data = data; | 
|---|
| 46 | } | 
|---|
| 47 |  | 
|---|
| 48 |  | 
|---|
| 49 | const XMLString& ProcessingInstruction::nodeName() const | 
|---|
| 50 | { | 
|---|
| 51 | return _target; | 
|---|
| 52 | } | 
|---|
| 53 |  | 
|---|
| 54 |  | 
|---|
| 55 | const XMLString& ProcessingInstruction::getNodeValue() const | 
|---|
| 56 | { | 
|---|
| 57 | return _data; | 
|---|
| 58 | } | 
|---|
| 59 |  | 
|---|
| 60 |  | 
|---|
| 61 | void ProcessingInstruction::setNodeValue(const XMLString& data) | 
|---|
| 62 | { | 
|---|
| 63 | setData(data); | 
|---|
| 64 | } | 
|---|
| 65 |  | 
|---|
| 66 |  | 
|---|
| 67 | unsigned short ProcessingInstruction::nodeType() const | 
|---|
| 68 | { | 
|---|
| 69 | return Node::PROCESSING_INSTRUCTION_NODE; | 
|---|
| 70 | } | 
|---|
| 71 |  | 
|---|
| 72 |  | 
|---|
| 73 | Node* ProcessingInstruction::copyNode(bool deep, Document* pOwnerDocument) const | 
|---|
| 74 | { | 
|---|
| 75 | return new ProcessingInstruction(pOwnerDocument, *this); | 
|---|
| 76 | } | 
|---|
| 77 |  | 
|---|
| 78 |  | 
|---|
| 79 | } } // namespace Poco::XML | 
|---|
| 80 |  | 
|---|