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
18namespace Poco {
19namespace XML {
20
21
22ProcessingInstruction::ProcessingInstruction(Document* pOwnerDocument, const XMLString& target, const XMLString& data):
23 AbstractNode(pOwnerDocument),
24 _target(target),
25 _data(data)
26{
27}
28
29
30ProcessingInstruction::ProcessingInstruction(Document* pOwnerDocument, const ProcessingInstruction& processingInstruction):
31 AbstractNode(pOwnerDocument, processingInstruction),
32 _target(processingInstruction._target),
33 _data(processingInstruction._data)
34{
35}
36
37
38ProcessingInstruction::~ProcessingInstruction()
39{
40}
41
42
43void ProcessingInstruction::setData(const XMLString& data)
44{
45 _data = data;
46}
47
48
49const XMLString& ProcessingInstruction::nodeName() const
50{
51 return _target;
52}
53
54
55const XMLString& ProcessingInstruction::getNodeValue() const
56{
57 return _data;
58}
59
60
61void ProcessingInstruction::setNodeValue(const XMLString& data)
62{
63 setData(data);
64}
65
66
67unsigned short ProcessingInstruction::nodeType() const
68{
69 return Node::PROCESSING_INSTRUCTION_NODE;
70}
71
72
73Node* ProcessingInstruction::copyNode(bool deep, Document* pOwnerDocument) const
74{
75 return new ProcessingInstruction(pOwnerDocument, *this);
76}
77
78
79} } // namespace Poco::XML
80