1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | import { IStringOptions } from "../options";
|
17 | import XmlComment, { IXmlCommentOptions } from "./XmlComment";
|
18 | import XmlDtdAttlist, { IXmlDtdAttlistOptions } from "./XmlDtdAttlist";
|
19 | import XmlDtdElement, { IXmlDtdElementOptions } from "./XmlDtdElement";
|
20 | import XmlDtdEntity, { IXmlDtdEntityOptions } from "./XmlDtdEntity";
|
21 | import XmlDtdNotation, { IXmlDtdNotationOptions } from "./XmlDtdNotation";
|
22 | import { default as XmlDtdParamEntityRef, IXmlDtdParamEntityRefOptions } from "./XmlDtdParamEntityRef";
|
23 | import XmlProcInst, { IXmlProcInstOptions } from "./XmlProcInst";
|
24 |
|
25 |
|
26 |
|
27 | export interface IXmlDtdOptions {
|
28 | |
29 |
|
30 |
|
31 | name: string;
|
32 | |
33 |
|
34 |
|
35 |
|
36 | sysId?: string;
|
37 | |
38 |
|
39 |
|
40 |
|
41 |
|
42 | pubId?: string;
|
43 | }
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 |
|
57 |
|
58 |
|
59 |
|
60 |
|
61 |
|
62 | export default class XmlDtd<Parent> {
|
63 | private readonly _children;
|
64 | private readonly _parent;
|
65 | private _name;
|
66 | private readonly _validation;
|
67 | private _pubId;
|
68 | private _sysId;
|
69 | constructor(parent: Parent, validation: boolean, options: IXmlDtdOptions);
|
70 | /**
|
71 | * Gets the name of the DTD.
|
72 | */
|
73 | get name(): string;
|
74 | /**
|
75 | * Sets the name of the DTD.
|
76 | */
|
77 | set name(name: string);
|
78 | /**
|
79 | * Gets the public identifier of the DTD.
|
80 | */
|
81 | get pubId(): string | undefined;
|
82 | /**
|
83 | * Sets the public identifier of the DTD.
|
84 | */
|
85 | set pubId(pubId: string | undefined);
|
86 | /**
|
87 | * Gets the system identifier of the DTD.
|
88 | */
|
89 | get sysId(): string | undefined;
|
90 | /**
|
91 | * Sets the system identifier of the DTD.
|
92 | */
|
93 | set sysId(sysId: string | undefined);
|
94 | /**
|
95 | * Adds an attribute-list declaration to this document type declaration
|
96 | * and returns the new attribute-list declaration.
|
97 | */
|
98 | attlist(options: IXmlDtdAttlistOptions): XmlDtdAttlist<this>;
|
99 | /**
|
100 | * Adds a comment to this document type declaration and returns the
|
101 | * new comment.
|
102 | */
|
103 | comment(options: IXmlCommentOptions): XmlComment<this>;
|
104 | /**
|
105 | * Adds an element declaration to this document type declaration
|
106 | * and returns the new element declaration.
|
107 | */
|
108 | element(options: IXmlDtdElementOptions): XmlDtdElement<this>;
|
109 | /**
|
110 | * Adds an entity declaration to this document type declaration
|
111 | * and returns the new entity declaration.
|
112 | */
|
113 | entity(options: IXmlDtdEntityOptions): XmlDtdEntity<this>;
|
114 | /**
|
115 | * Adds a notation declaration to this document type declaration
|
116 | * and returns the new notation declaration.
|
117 | */
|
118 | notation(options: IXmlDtdNotationOptions): XmlDtdNotation<this>;
|
119 | /**
|
120 | * Adds a parameter entity reference to this document type declaration
|
121 | * and returns the new parameter entity reference.
|
122 | */
|
123 | paramEntityRef(options: IXmlDtdParamEntityRefOptions): XmlDtdParamEntityRef<this>;
|
124 | /**
|
125 | * Adds a processing instruction to this document type declaration
|
126 | * and returns the new processing instruction.
|
127 | */
|
128 | procInst(options: IXmlProcInstOptions): XmlProcInst<this>;
|
129 | /**
|
130 | * Returns an XML string representation of this document type declaration.
|
131 | */
|
132 | toString(options?: IStringOptions): string;
|
133 | /**
|
134 | * Returns the parent of this attribute.
|
135 | */
|
136 | up(): Parent;
|
137 | /**
|
138 | * Appends the XML string representation of a public or system identifier
|
139 | * to an existing string.
|
140 | */
|
141 | private appendId;
|
142 | }
|
143 | /**
|
144 | * Returns true if the specified public identifier only contains characters
|
145 | * permitted by the XML specification.
|
146 | */
|
147 | export declare function validatePubId(str: string): boolean;
|