blob: 462be5292e279a500764fc6edb30fa90d694fdbf (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
//
// DocumentFragment.cpp
//
// Library: XML
// Package: DOM
// Module: DOM
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "Poco/DOM/DocumentFragment.h"
namespace Poco {
namespace XML {
const XMLString DocumentFragment::NODE_NAME = toXMLString("#document-fragment");
DocumentFragment::DocumentFragment(Document* pOwnerDocument):
AbstractContainerNode(pOwnerDocument)
{
}
DocumentFragment::DocumentFragment( Document* pOwnerDocument, const DocumentFragment& fragment):
AbstractContainerNode(pOwnerDocument, fragment)
{
}
DocumentFragment::~DocumentFragment()
{
}
const XMLString& DocumentFragment::nodeName() const
{
return NODE_NAME;
}
unsigned short DocumentFragment::nodeType() const
{
return Node::DOCUMENT_FRAGMENT_NODE;
}
Node* DocumentFragment::copyNode(bool deep, Document* pOwnerDocument) const
{
DocumentFragment* pClone = new DocumentFragment(pOwnerDocument, *this);
if (deep)
{
Node* pCur = firstChild();
while (pCur)
{
pClone->appendChild(static_cast<AbstractNode*>(pCur)->copyNode(deep, pOwnerDocument))->release();
pCur = pCur->nextSibling();
}
}
return pClone;
}
} } // namespace Poco::XML
|