1 | // |
2 | // DocumentType.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/DocumentType.h" |
16 | #include "Poco/DOM/Document.h" |
17 | #include "Poco/DOM/DTDMap.h" |
18 | #include "Poco/DOM/DOMException.h" |
19 | |
20 | |
21 | namespace Poco { |
22 | namespace XML { |
23 | |
24 | |
25 | DocumentType::DocumentType(Document* pOwner, const XMLString& name, const XMLString& publicId, const XMLString& systemId): |
26 | AbstractContainerNode(pOwner), |
27 | _name(name), |
28 | _publicId(publicId), |
29 | _systemId(systemId) |
30 | { |
31 | } |
32 | |
33 | |
34 | DocumentType::DocumentType(Document* pOwner, const DocumentType& doctype): |
35 | AbstractContainerNode(pOwner, doctype), |
36 | _name(doctype._name), |
37 | _publicId(doctype._publicId), |
38 | _systemId(doctype._systemId) |
39 | { |
40 | } |
41 | |
42 | |
43 | DocumentType::~DocumentType() |
44 | { |
45 | } |
46 | |
47 | |
48 | NamedNodeMap* DocumentType::entities() const |
49 | { |
50 | return new DTDMap(this, Node::ENTITY_NODE); |
51 | } |
52 | |
53 | |
54 | NamedNodeMap* DocumentType::notations() const |
55 | { |
56 | return new DTDMap(this, Node::NOTATION_NODE); |
57 | } |
58 | |
59 | |
60 | const XMLString& DocumentType::nodeName() const |
61 | { |
62 | return _name; |
63 | } |
64 | |
65 | |
66 | unsigned short DocumentType::nodeType() const |
67 | { |
68 | return Node::DOCUMENT_TYPE_NODE; |
69 | } |
70 | |
71 | |
72 | const XMLString& DocumentType::internalSubset() const |
73 | { |
74 | return EMPTY_STRING; |
75 | } |
76 | |
77 | |
78 | Node* DocumentType::copyNode(bool deep, Document* pOwnerDocument) const |
79 | { |
80 | return new DocumentType(pOwnerDocument, *this); |
81 | } |
82 | |
83 | |
84 | } } // namespace Poco::XML |
85 | |