MCPcopy Create free account
hub / github.com/NaturalIntelligence/fast-xml-parser / addEntity

Method addEntity

src/v6/XMLParser.js:67–77  ·  view source on GitHub ↗

* Add Entity which is not by default supported by this library * @param {string} key * @param {string} value

(key, value)

Source from the content-addressed store, hash-verified

65 * @param {string} value
66 */
67 addEntity(key, value) {
68 if (value.indexOf("&") !== -1) {
69 throw new Error("Entity value can't have '&'")
70 } else if (key.indexOf("&") !== -1 || key.indexOf(";") !== -1) {
71 throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'")
72 } else if (value === "&") {
73 throw new Error("An entity with value '&' is not permitted");
74 } else {
75 this.externalEntities[key] = value;
76 }
77 }
78}
79
80function isStream(stream) {

Callers 1

entities_spec.jsFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected