summaryrefslogtreecommitdiff
path: root/school/node_modules/saxes
diff options
context:
space:
mode:
Diffstat (limited to 'school/node_modules/saxes')
-rw-r--r--school/node_modules/saxes/README.md323
-rw-r--r--school/node_modules/saxes/package.json70
-rw-r--r--school/node_modules/saxes/saxes.d.ts635
-rw-r--r--school/node_modules/saxes/saxes.js2064
-rw-r--r--school/node_modules/saxes/saxes.js.map1
5 files changed, 3093 insertions, 0 deletions
diff --git a/school/node_modules/saxes/README.md b/school/node_modules/saxes/README.md
new file mode 100644
index 0000000..f863763
--- /dev/null
+++ b/school/node_modules/saxes/README.md
@@ -0,0 +1,323 @@
+# saxes
+
+A sax-style non-validating parser for XML.
+
+Saxes is a fork of [sax](https://github.com/isaacs/sax-js) 1.2.4. All mentions
+of sax in this project's documentation are references to sax 1.2.4.
+
+Designed with [node](http://nodejs.org/) in mind, but should work fine in the
+browser or other CommonJS implementations.
+
+Saxes does not support Node versions older than 10.
+
+## Notable Differences from Sax.
+
+* Saxes aims to be much stricter than sax with regards to XML
+ well-formedness. Sax, even in its so-called "strict mode", is not strict. It
+ silently accepts structures that are not well-formed XML. Projects that need
+ better compliance with well-formedness constraints cannot use sax as-is.
+
+ Consequently, saxes does not support HTML, or pseudo-XML, or bad XML. Saxes
+ will report well-formedness errors in all these cases but it won't try to
+ extract data from malformed documents like sax does.
+
+* Saxes is much much faster than sax, mostly because of a substantial redesign
+ of the internal parsing logic. The speed improvement is not merely due to
+ removing features that were supported by sax. That helped a bit, but saxes
+ adds some expensive checks in its aim for conformance with the XML
+ specification. Redesigning the parsing logic is what accounts for most of the
+ performance improvement.
+
+* Saxes does not aim to support antiquated platforms. We will not pollute the
+ source or the default build with support for antiquated platforms. If you want
+ support for IE 11, you are welcome to produce a PR that adds a *new build*
+ transpiled to ES5.
+
+* Saxes handles errors differently from sax: it provides a default onerror
+ handler which throws. You can replace it with your own handler if you want. If
+ your handler does nothing, there is no `resume` method to call.
+
+* There's no `Stream` API. A revamped API may be introduced later. (It is still
+ a "streaming parser" in the general sense that you write a character stream to
+ it.)
+
+* Saxes does not have facilities for limiting the size the data chunks passed to
+ event handlers. See the FAQ entry for more details.
+
+## Conformance
+
+Saxes supports:
+
+* [XML 1.0 fifth edition](https://www.w3.org/TR/2008/REC-xml-20081126/)
+* [XML 1.1 second edition](https://www.w3.org/TR/2006/REC-xml11-20060816/)
+* [Namespaces in XML 1.0 (Third Edition)](https://www.w3.org/TR/2009/REC-xml-names-20091208/).
+* [Namespaces in XML 1.1 (Second Edition)](https://www.w3.org/TR/2006/REC-xml-names11-20060816/).
+
+## Limitations
+
+This is a non-validating parser so it only verifies whether the document is
+well-formed. We do aim to raise errors for all malformed constructs
+encountered. However, this parser does not thorougly parse the contents of
+DTDs. So most malformedness errors caused by errors **in DTDs** cannot be
+reported.
+
+## Regarding `<!DOCTYPE` and `<!ENTITY`
+
+The parser will handle the basic XML entities in text nodes and attribute
+values: `&amp; &lt; &gt; &apos; &quot;`. It's possible to define additional
+entities in XML by putting them in the DTD. This parser doesn't do anything with
+that. If you want to listen to the `doctype` event, and then fetch the
+doctypes, and read the entities and add them to `parser.ENTITIES`, then be my
+guest.
+
+## Documentation
+
+The source code contains JSDOC comments. Use them. What follows is a brief
+summary of what is available. The final authority is the source code.
+
+**PAY CLOSE ATTENTION TO WHAT IS PUBLIC AND WHAT IS PRIVATE.**
+
+The move to TypeScript makes it so that everything is now formally private,
+protected, or public.
+
+If you use anything not public, that's at your own peril.
+
+If there's a mistake in the documentation, raise an issue. If you just assume,
+you may assume incorrectly.
+
+## Summary Usage Information
+
+### Example
+
+```javascript
+var saxes = require("./lib/saxes"),
+ parser = new saxes.SaxesParser();
+
+parser.on("error", function (e) {
+ // an error happened.
+});
+parser.on("text", function (t) {
+ // got some text. t is the string of text.
+});
+parser.on("opentag", function (node) {
+ // opened a tag. node has "name" and "attributes"
+});
+parser.on("end", function () {
+ // parser stream is done, and ready to have more stuff written to it.
+});
+
+parser.write('<xml>Hello, <who name="world">world</who>!</xml>').close();
+```
+
+### Constructor Arguments
+
+Settings supported:
+
+* `xmlns` - Boolean. If `true`, then namespaces are supported. Default
+ is `false`.
+
+* `position` - Boolean. If `false`, then don't track line/col/position. Unset is
+ treated as `true`. Default is unset. Currently, setting this to `false` only
+ results in a cosmetic change: the errors reported do not contain position
+ information. sax-js would literally turn off the position-computing logic if
+ this flag was set to false. The notion was that it would optimize
+ execution. In saxes at least it turns out that continually testing this flag
+ causes a cost that offsets the benefits of turning off this logic.
+
+* `fileName` - String. Set a file name for error reporting. This is useful only
+ when tracking positions. You may leave it unset.
+
+* `fragment` - Boolean. If `true`, parse the XML as an XML fragment. Default is
+ `false`.
+
+* `additionalNamespaces` - A plain object whose key, value pairs define
+ namespaces known before parsing the XML file. It is not legal to pass
+ bindings for the namespaces `"xml"` or `"xmlns"`.
+
+* `defaultXMLVersion` - The default version of the XML specification to use if
+ the document contains no XML declaration. If the document does contain an XML
+ declaration, then this setting is ignored. Must be `"1.0"` or `"1.1"`. The
+ default is `"1.0"`.
+
+* `forceXMLVersion` - Boolean. A flag indicating whether to force the XML
+ version used for parsing to the value of ``defaultXMLVersion``. When this flag
+ is ``true``, ``defaultXMLVersion`` must be specified. If unspecified, the
+ default value of this flag is ``false``.
+
+ Example: suppose you are parsing a document that has an XML declaration
+ specifying XML version 1.1.
+
+ If you set ``defaultXMLVersion`` to ``"1.0"`` without setting
+ ``forceXMLVersion`` then the XML declaration will override the value of
+ ``defaultXMLVersion`` and the document will be parsed according to XML 1.1.
+
+ If you set ``defaultXMLVersion`` to ``"1.0"`` and set ``forceXMLVersion`` to
+ ``true``, then the XML declaration will be ignored and the document will be
+ parsed according to XML 1.0.
+
+### Methods
+
+`write` - Write bytes onto the stream. You don't have to pass the whole document
+in one `write` call. You can read your source chunk by chunk and call `write`
+with each chunk.
+
+`close` - Close the stream. Once closed, no more data may be written until it is
+done processing the buffer, which is signaled by the `end` event.
+
+### Properties
+
+The parser has the following properties:
+
+`line`, `column`, `columnIndex`, `position` - Indications of the position in the
+XML document where the parser currently is looking. The `columnIndex` property
+counts columns as if indexing into a JavaScript string, whereas the `column`
+property counts Unicode characters.
+
+`closed` - Boolean indicating whether or not the parser can be written to. If
+it's `true`, then wait for the `ready` event to write again.
+
+`opt` - Any options passed into the constructor.
+
+`xmlDecl` - The XML declaration for this document. It contains the fields
+`version`, `encoding` and `standalone`. They are all `undefined` before
+encountering the XML declaration. If they are undefined after the XML
+declaration, the corresponding value was not set by the declaration. There is no
+event associated with the XML declaration. In a well-formed document, the XML
+declaration may be preceded only by an optional BOM. So by the time any event
+generated by the parser happens, the declaration has been processed if present
+at all. Otherwise, you have a malformed document, and as stated above, you
+cannot rely on the parser data!
+
+### Error Handling
+
+The parser continues to parse even upon encountering errors, and does its best
+to continue reporting errors. You should heed all errors reported. After an
+error, however, saxes may interpret your document incorrectly. For instance
+``<foo a=bc="d"/>`` is invalid XML. Did you mean to have ``<foo a="bc=d"/>`` or
+``<foo a="b" c="d"/>`` or some other variation? For the sake of continuing to
+provide errors, saxes will continue parsing the document, but the structure it
+reports may be incorrect. It is only after the errors are fixed in the document
+that saxes can provide a reliable interpretation of the document.
+
+That leaves you with two rules of thumb when using saxes:
+
+* Pay attention to the errors that saxes report. The default `onerror` handler
+ throws, so by default, you cannot miss errors.
+
+* **ONCE AN ERROR HAS BEEN ENCOUNTERED, STOP RELYING ON THE EVENT HANDLERS OTHER
+ THAN `onerror`.** As explained above, when saxes runs into a well-formedness
+ problem, it makes a guess in order to continue reporting more errors. The guess
+ may be wrong.
+
+### Events
+
+To listen to an event, override `on<eventname>`. The list of supported events
+are also in the exported `EVENTS` array.
+
+See the JSDOC comments in the source code for a description of each supported
+event.
+
+### Parsing XML Fragments
+
+The XML specification does not define any method by which to parse XML
+fragments. However, there are usage scenarios in which it is desirable to parse
+fragments. In order to allow this, saxes provides three initialization options.
+
+If you pass the option `fragment: true` to the parser constructor, the parser
+will expect an XML fragment. It essentially starts with a parsing state
+equivalent to the one it would be in if `parser.write("<foo">)` had been called
+right after initialization. In other words, it expects content which is
+acceptable inside an element. This also turns off well-formedness checks that
+are inappropriate when parsing a fragment.
+
+The option `additionalNamespaces` allows you to define additional prefix-to-URI
+bindings known before parsing starts. You would use this over `resolvePrefix` if
+you have at the ready a series of namespaces bindings to use.
+
+The option `resolvePrefix` allows you to pass a function which saxes will use if
+it is unable to resolve a namespace prefix by itself. You would use this over
+`additionalNamespaces` in a context where getting a complete list of defined
+namespaces is onerous.
+
+Note that you can use `additionalNamespaces` and `resolvePrefix` together if you
+want. `additionalNamespaces` applies before `resolvePrefix`.
+
+The options `additionalNamespaces` and `resolvePrefix` are really meant to be
+used for parsing fragments. However, saxes won't prevent you from using them
+with `fragment: false`. Note that if you do this, your document may parse
+without errors and yet be malformed because the document can refer to namespaces
+which are not defined *in* the document.
+
+Of course, `additionalNamespaces` and `resolvePrefix` are used only if `xmlns`
+is `true`. If you are parsing a fragment that does not use namespaces, there's
+no point in setting these options.
+
+### Performance Tips
+
+* saxes works faster on files that use newlines (``\u000A``) as end of line
+ markers than files that use other end of line markers (like ``\r`` or
+ ``\r\n``). The XML specification requires that conformant applications behave
+ as if all characters that are to be treated as end of line characters are
+ converted to ``\u000A`` prior to parsing. The optimal code path for saxes is a
+ file in which all end of line characters are already ``\u000A``.
+
+* Don't split Unicode strings you feed to saxes across surrogates. When you
+ naively split a string in JavaScript, you run the risk of splitting a Unicode
+ character into two surrogates. e.g. In the following example ``a`` and ``b``
+ each contain half of a single Unicode character: ``const a = "\u{1F4A9}"[0];
+ const b = "\u{1F4A9}"[1]`` If you feed such split surrogates to versions of
+ saxes prior to 4, you'd get errors. Saxes version 4 and over are able to
+ detect when a chunk of data ends with a surrogate and carry over the surrogate
+ to the next chunk. However this operation entails slicing and concatenating
+ strings. If you can feed your data in a way that does not split surrogates,
+ you should do it. (Obviously, feeding all the data at once with a single write
+ is fastest.)
+
+* Don't set event handlers you don't need. Saxes has always aimed to avoid doing
+ work that will just be tossed away but future improvements hope to do this
+ more aggressively. One way saxes knows whether or not some data is needed is
+ by checking whether a handler has been set for a specific event.
+
+## FAQ
+
+Q. Why has saxes dropped support for limiting the size of data chunks passed to
+event handlers?
+
+A. With sax you could set ``MAX_BUFFER_LENGTH`` to cause the parser to limit the
+size of data chunks passed to event handlers. So if you ran into a span of text
+above the limit, multiple ``text`` events with smaller data chunks were fired
+instead of a single event with a large chunk.
+
+However, that functionality had some problematic characteristics. It had an
+arbitrary default value. It was library-wide so all parsers created from a
+single instance of the ``sax`` library shared it. This could potentially cause
+conflicts among libraries running in the same VM but using sax for different
+purposes.
+
+These issues could have been easily fixed, but there were larger issues. The
+buffer limit arbitrarily applied to some events but not others. It would split
+``text``, ``cdata`` and ``script`` events. However, if a ``comment``,
+``doctype``, ``attribute`` or ``processing instruction`` were more than the
+limit, the parser would generate an error and you were left picking up the
+pieces.
+
+It was not intuitive to use. You'd think setting the limit to 1K would prevent
+chunks bigger than 1K to be passed to event handlers. But that was not the
+case. A comment in the source code told you that you might go over the limit if
+you passed large chunks to ``write``. So if you want a 1K limit, don't pass 64K
+chunks to ``write``. Fair enough. You know what limit you want so you can
+control the size of the data you pass to ``write``. So you limit the chunks to
+``write`` to 1K at a time. Even if you do this, your event handlers may get data
+chunks that are 2K in size. Suppose on the previous ``write`` the parser has
+just finished processing an open tag, so it is ready for text. Your ``write``
+passes 1K of text. You are not above the limit yet, so no event is generated
+yet. The next ``write`` passes another 1K of text. It so happens that sax checks
+buffer limits only once per ``write``, after the chunk of data has been
+processed. Now you've hit the limit and you get a ``text`` event with 2K of
+data. So even if you limit your ``write`` calls to the buffer limit you've set,
+you may still get events with chunks at twice the buffer size limit you've
+specified.
+
+We may consider reinstating an equivalent functionality, provided that it
+addresses the issues above and does not cause a huge performance drop for
+use-case scenarios that don't need it.
diff --git a/school/node_modules/saxes/package.json b/school/node_modules/saxes/package.json
new file mode 100644
index 0000000..ac987e7
--- /dev/null
+++ b/school/node_modules/saxes/package.json
@@ -0,0 +1,70 @@
+{
+ "name": "saxes",
+ "description": "An evented streaming XML parser in JavaScript",
+ "author": "Louis-Dominique Dubeau <ldd@lddubeau.com>",
+ "version": "5.0.1",
+ "main": "saxes.js",
+ "types": "saxes.d.ts",
+ "license": "ISC",
+ "engines": {
+ "node": ">=10"
+ },
+ "scripts": {
+ "tsc": "tsc",
+ "copy": "cp -p README.md build/dist && sed -e'/\"private\": true/d' package.json > build/dist/package.json",
+ "build": "npm run tsc && npm run copy",
+ "test": "npm run build && mocha --delay",
+ "lint": "eslint --ignore-path .gitignore '**/*.ts' '**/*.js'",
+ "lint-fix": "npm run lint -- --fix",
+ "posttest": "npm run lint",
+ "typedoc": "typedoc --tsconfig tsconfig.json --name saxes --out build/docs/ --listInvalidSymbolLinks --excludePrivate --excludeNotExported",
+ "build-docs": "npm run typedoc",
+ "gh-pages": "npm run build-docs && mkdir -p build && (cd build; rm -rf gh-pages; git clone .. --branch gh-pages gh-pages) && mkdir -p build/gh-pages/latest && find build/gh-pages/latest -type f -delete && cp -rp build/docs/* build/gh-pages/latest && find build/gh-pages -type d -empty -delete",
+ "self:publish": "cd build/dist && npm_config_tag=`simple-dist-tag` npm publish",
+ "version": "conventional-changelog -p angular -i CHANGELOG.md -s && git add CHANGELOG.md",
+ "postversion": "npm run test && npm run self:publish",
+ "postpublish": "git push origin --follow-tags"
+ },
+ "repository": "https://github.com/lddubeau/saxes.git",
+ "devDependencies": {
+ "@commitlint/cli": "^8.3.5",
+ "@commitlint/config-angular": "^8.3.4",
+ "@types/chai": "^4.2.11",
+ "@types/mocha": "^7.0.2",
+ "@typescript-eslint/eslint-plugin": "^2.27.0",
+ "@typescript-eslint/eslint-plugin-tslint": "^2.27.0",
+ "@typescript-eslint/parser": "^2.27.0",
+ "@xml-conformance-suite/js": "^2.0.0",
+ "@xml-conformance-suite/mocha": "^2.0.0",
+ "@xml-conformance-suite/test-data": "^2.0.0",
+ "chai": "^4.2.0",
+ "conventional-changelog-cli": "^2.0.31",
+ "eslint": "^6.8.0",
+ "eslint-config-lddubeau-base": "^5.2.0",
+ "eslint-config-lddubeau-ts": "^1.1.7",
+ "eslint-import-resolver-typescript": "^2.0.0",
+ "eslint-plugin-import": "^2.20.2",
+ "eslint-plugin-jsx-a11y": "^6.2.3",
+ "eslint-plugin-prefer-arrow": "^1.2.0",
+ "eslint-plugin-react": "^7.19.0",
+ "eslint-plugin-simple-import-sort": "^5.0.2",
+ "husky": "^4.2.5",
+ "mocha": "^7.1.1",
+ "renovate-config-lddubeau": "^1.0.0",
+ "simple-dist-tag": "^1.0.2",
+ "ts-node": "^8.8.2",
+ "tsd": "^0.11.0",
+ "tslint": "^6.1.1",
+ "tslint-microsoft-contrib": "^6.2.0",
+ "typedoc": "^0.17.4",
+ "typescript": "^3.8.3"
+ },
+ "dependencies": {
+ "xmlchars": "^2.2.0"
+ },
+ "husky": {
+ "hooks": {
+ "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
+ }
+ }
+}
diff --git a/school/node_modules/saxes/saxes.d.ts b/school/node_modules/saxes/saxes.d.ts
new file mode 100644
index 0000000..41c101f
--- /dev/null
+++ b/school/node_modules/saxes/saxes.d.ts
@@ -0,0 +1,635 @@
+/**
+ * The list of supported events.
+ */
+export declare const EVENTS: readonly ["xmldecl", "text", "processinginstruction", "doctype", "comment", "opentagstart", "attribute", "opentag", "closetag", "cdata", "error", "end", "ready"];
+/**
+ * Event handler for the
+ *
+ * @param text The text data encountered by the parser.
+ *
+ */
+export declare type XMLDeclHandler = (decl: XMLDecl) => void;
+/**
+ * Event handler for text data.
+ *
+ * @param text The text data encountered by the parser.
+ *
+ */
+export declare type TextHandler = (text: string) => void;
+/**
+ * Event handler for processing instructions.
+ *
+ * @param data The target and body of the processing instruction.
+ */
+export declare type PIHandler = (data: {
+ target: string;
+ body: string;
+}) => void;
+/**
+ * Event handler for doctype.
+ *
+ * @param doctype The doctype contents.
+ */
+export declare type DoctypeHandler = (doctype: string) => void;
+/**
+ * Event handler for comments.
+ *
+ * @param comment The comment contents.
+ */
+export declare type CommentHandler = (comment: string) => void;
+/**
+ * Event handler for the start of an open tag. This is called as soon as we
+ * have a tag name.
+ *
+ * @param tag The tag.
+ */
+export declare type OpenTagStartHandler<O> = (tag: StartTagForOptions<O>) => void;
+export declare type AttributeEventForOptions<O extends SaxesOptions> = O extends {
+ xmlns: true;
+} ? SaxesAttributeNSIncomplete : O extends {
+ xmlns?: false | undefined;
+} ? SaxesAttributePlain : SaxesAttribute;
+/**
+ * Event handler for attributes.
+ */
+export declare type AttributeHandler<O> = (attribute: AttributeEventForOptions<O>) => void;
+/**
+ * Event handler for an open tag. This is called when the open tag is
+ * complete. (We've encountered the ">" that ends the open tag.)
+ *
+ * @param tag The tag.
+ */
+export declare type OpenTagHandler<O> = (tag: TagForOptions<O>) => void;
+/**
+ * Event handler for a close tag. Note that for self-closing tags, this is
+ * called right after ``opentag``.
+ *
+ * @param tag The tag.
+ */
+export declare type CloseTagHandler<O> = (tag: TagForOptions<O>) => void;
+/**
+ * Event handler for a CDATA section. This is called when ending the
+ * CDATA section.
+ *
+ * @param cdata The contents of the CDATA section.
+ */
+export declare type CDataHandler = (cdata: string) => void;
+/**
+ * Event handler for the stream end. This is called when the stream has been
+ * closed with ``close`` or by passing ``null`` to ``write``.
+ */
+export declare type EndHandler = () => void;
+/**
+ * Event handler indicating parser readiness . This is called when the parser
+ * is ready to parse a new document.
+ */
+export declare type ReadyHandler = () => void;
+/**
+ * Event handler indicating an error.
+ *
+ * @param err The error that occurred.
+ */
+export declare type ErrorHandler = (err: Error) => void;
+export declare type EventName = (typeof EVENTS)[number];
+export declare type EventNameToHandler<O, N extends EventName> = {
+ "xmldecl": XMLDeclHandler;
+ "text": TextHandler;
+ "processinginstruction": PIHandler;
+ "doctype": DoctypeHandler;
+ "comment": CommentHandler;
+ "opentagstart": OpenTagStartHandler<O>;
+ "attribute": AttributeHandler<O>;
+ "opentag": OpenTagHandler<O>;
+ "closetag": CloseTagHandler<O>;
+ "cdata": CDataHandler;
+ "error": ErrorHandler;
+ "end": EndHandler;
+ "ready": ReadyHandler;
+}[N];
+/**
+ * This interface defines the structure of attributes when the parser is
+ * processing namespaces (created with ``xmlns: true``).
+ */
+export interface SaxesAttributeNS {
+ /**
+ * The attribute's name. This is the combination of prefix and local name.
+ * For instance ``a:b="c"`` would have ``a:b`` for name.
+ */
+ name: string;
+ /**
+ * The attribute's prefix. For instance ``a:b="c"`` would have ``"a"`` for
+ * ``prefix``.
+ */
+ prefix: string;
+ /**
+ * The attribute's local name. For instance ``a:b="c"`` would have ``"b"`` for
+ * ``local``.
+ */
+ local: string;
+ /** The namespace URI of this attribute. */
+ uri: string;
+ /** The attribute's value. */
+ value: string;
+}
+/**
+ * This is an attribute, as recorded by a parser which parses namespaces but
+ * prior to the URI being resolvable. This is what is passed to the attribute
+ * event handler.
+ */
+export declare type SaxesAttributeNSIncomplete = Exclude<SaxesAttributeNS, "uri">;
+/**
+ * This interface defines the structure of attributes when the parser is
+ * NOT processing namespaces (created with ``xmlns: false``).
+ */
+export interface SaxesAttributePlain {
+ /**
+ * The attribute's name.
+ */
+ name: string;
+ /** The attribute's value. */
+ value: string;
+}
+/**
+ * A saxes attribute, with or without namespace information.
+ */
+export declare type SaxesAttribute = SaxesAttributeNS | SaxesAttributePlain;
+/**
+ * This are the fields that MAY be present on a complete tag.
+ */
+export interface SaxesTag {
+ /**
+ * The tag's name. This is the combination of prefix and global name. For
+ * instance ``<a:b>`` would have ``"a:b"`` for ``name``.
+ */
+ name: string;
+ /**
+ * A map of attribute name to attributes. If namespaces are tracked, the
+ * values in the map are attribute objects. Otherwise, they are strings.
+ */
+ attributes: Record<string, SaxesAttributeNS> | Record<string, string>;
+ /**
+ * The namespace bindings in effect.
+ */
+ ns?: Record<string, string>;
+ /**
+ * The tag's prefix. For instance ``<a:b>`` would have ``"a"`` for
+ * ``prefix``. Undefined if we do not track namespaces.
+ */
+ prefix?: string;
+ /**
+ * The tag's local name. For instance ``<a:b>`` would
+ * have ``"b"`` for ``local``. Undefined if we do not track namespaces.
+ */
+ local?: string;
+ /**
+ * The namespace URI of this tag. Undefined if we do not track namespaces.
+ */
+ uri?: string;
+ /** Whether the tag is self-closing (e.g. ``<foo/>``). */
+ isSelfClosing: boolean;
+}
+/**
+ * This type defines the fields that are present on a tag object when
+ * ``onopentagstart`` is called. This interface is namespace-agnostic.
+ */
+export declare type SaxesStartTag = Pick<SaxesTag, "name" | "attributes" | "ns">;
+/**
+ * This type defines the fields that are present on a tag object when
+ * ``onopentagstart`` is called on a parser that does not processes namespaces.
+ */
+export declare type SaxesStartTagPlain = Pick<SaxesStartTag, "name" | "attributes">;
+/**
+ * This type defines the fields that are present on a tag object when
+ * ``onopentagstart`` is called on a parser that does process namespaces.
+ */
+export declare type SaxesStartTagNS = Required<SaxesStartTag>;
+/**
+ * This are the fields that are present on a complete tag produced by a parser
+ * that does process namespaces.
+ */
+export declare type SaxesTagNS = Required<SaxesTag> & {
+ attributes: Record<string, SaxesAttributeNS>;
+};
+/**
+ * This are the fields that are present on a complete tag produced by a parser
+ * that does not process namespaces.
+ */
+export declare type SaxesTagPlain = Pick<SaxesTag, "name" | "attributes" | "isSelfClosing"> & {
+ attributes: Record<string, string>;
+};
+/**
+ * An XML declaration.
+ */
+export interface XMLDecl {
+ /** The version specified by the XML declaration. */
+ version?: string;
+ /** The encoding specified by the XML declaration. */
+ encoding?: string;
+ /** The value of the standalone parameter */
+ standalone?: string;
+}
+/**
+ * A callback for resolving name prefixes.
+ *
+ * @param prefix The prefix to check.
+ *
+ * @returns The URI corresponding to the prefix, if any.
+ */
+export declare type ResolvePrefix = (prefix: string) => string | undefined;
+export interface CommonOptions {
+ /** Whether to accept XML fragments. Unset means ``false``. */
+ fragment?: boolean;
+ /** Whether to track positions. Unset means ``true``. */
+ position?: boolean;
+ /**
+ * A file name to use for error reporting. "File name" is a loose concept. You
+ * could use a URL to some resource, or any descriptive name you like.
+ */
+ fileName?: string;
+}
+export interface NSOptions {
+ /** Whether to track namespaces. Unset means ``false``. */
+ xmlns?: boolean;
+ /**
+ * A plain object whose key, value pairs define namespaces known before
+ * parsing the XML file. It is not legal to pass bindings for the namespaces
+ * ``"xml"`` or ``"xmlns"``.
+ */
+ additionalNamespaces?: Record<string, string>;
+ /**
+ * A function that will be used if the parser cannot resolve a namespace
+ * prefix on its own.
+ */
+ resolvePrefix?: ResolvePrefix;
+}
+export interface NSOptionsWithoutNamespaces extends NSOptions {
+ xmlns?: false;
+ additionalNamespaces?: undefined;
+ resolvePrefix?: undefined;
+}
+export interface NSOptionsWithNamespaces extends NSOptions {
+ xmlns: true;
+}
+export interface XMLVersionOptions {
+ /**
+ * The default XML version to use. If unspecified, and there is no XML
+ * encoding declaration, the default version is "1.0".
+ */
+ defaultXMLVersion?: "1.0" | "1.1";
+ /**
+ * A flag indicating whether to force the XML version used for parsing to the
+ * value of ``defaultXMLVersion``. When this flag is ``true``,
+ * ``defaultXMLVersion`` must be specified. If unspecified, the default value
+ * of this flag is ``false``.
+ */
+ forceXMLVersion?: boolean;
+}
+export interface NoForcedXMLVersion extends XMLVersionOptions {
+ forceXMLVersion?: false;
+}
+export interface ForcedXMLVersion extends XMLVersionOptions {
+ forceXMLVersion: true;
+ defaultXMLVersion: Exclude<XMLVersionOptions["defaultXMLVersion"], undefined>;
+}
+/**
+ * The entire set of options supported by saxes.
+ */
+export declare type SaxesOptions = CommonOptions & NSOptions & XMLVersionOptions;
+export declare type TagForOptions<O extends SaxesOptions> = O extends {
+ xmlns: true;
+} ? SaxesTagNS : O extends {
+ xmlns?: false | undefined;
+} ? SaxesTagPlain : SaxesTag;
+export declare type StartTagForOptions<O extends SaxesOptions> = O extends {
+ xmlns: true;
+} ? SaxesStartTagNS : O extends {
+ xmlns?: false | undefined;
+} ? SaxesStartTagPlain : SaxesStartTag;
+export declare class SaxesParser<O extends SaxesOptions = {}> {
+ private readonly fragmentOpt;
+ private readonly xmlnsOpt;
+ private readonly trackPosition;
+ private readonly fileName?;
+ private readonly nameStartCheck;
+ private readonly nameCheck;
+ private readonly isName;
+ private readonly ns;
+ private openWakaBang;
+ private text;
+ private name;
+ private piTarget;
+ private entity;
+ private q;
+ private tags;
+ private tag;
+ private topNS;
+ private chunk;
+ private chunkPosition;
+ private i;
+ private prevI;
+ private carriedFromPrevious?;
+ private forbiddenState;
+ private attribList;
+ private state;
+ private reportedTextBeforeRoot;
+ private reportedTextAfterRoot;
+ private closedRoot;
+ private sawRoot;
+ private xmlDeclPossible;
+ private xmlDeclExpects;
+ private entityReturnState?;
+ private processAttribs;
+ private positionAtNewLine;
+ private doctype;
+ private getCode;
+ private isChar;
+ private pushAttrib;
+ private _closed;
+ private currentXMLVersion;
+ private readonly stateTable;
+ private xmldeclHandler?;
+ private textHandler?;
+ private piHandler?;
+ private doctypeHandler?;
+ private commentHandler?;
+ private openTagStartHandler?;
+ private openTagHandler?;
+ private closeTagHandler?;
+ private cdataHandler?;
+ private errorHandler?;
+ private endHandler?;
+ private readyHandler?;
+ private attributeHandler?;
+ /**
+ * Indicates whether or not the parser is closed. If ``true``, wait for
+ * the ``ready`` event to write again.
+ */
+ get closed(): boolean;
+ readonly opt: SaxesOptions;
+ /**
+ * The XML declaration for this document.
+ */
+ xmlDecl: XMLDecl;
+ /**
+ * The line number of the next character to be read by the parser. This field
+ * is one-based. (The first line is numbered 1.)
+ */
+ line: number;
+ /**
+ * The column number of the next character to be read by the parser. *
+ * This field is zero-based. (The first column is 0.)
+ *
+ * This field counts columns by *Unicode character*. Note that this *can*
+ * be different from the index of the character in a JavaScript string due
+ * to how JavaScript handles astral plane characters.
+ *
+ * See [[columnIndex]] for a number that corresponds to the JavaScript index.
+ */
+ column: number;
+ /**
+ * A map of entity name to expansion.
+ */
+ ENTITIES: Record<string, string>;
+ /**
+ * @param opt The parser options.
+ */
+ constructor(opt?: O);
+ _init(): void;
+ /**
+ * The stream position the parser is currently looking at. This field is
+ * zero-based.
+ *
+ * This field is not based on counting Unicode characters but is to be
+ * interpreted as a plain index into a JavaScript string.
+ */
+ get position(): number;
+ /**
+ * The column number of the next character to be read by the parser. *
+ * This field is zero-based. (The first column in a line is 0.)
+ *
+ * This field reports the index at which the next character would be in the
+ * line if the line were represented as a JavaScript string. Note that this
+ * *can* be different to a count based on the number of *Unicode characters*
+ * due to how JavaScript handles astral plane characters.
+ *
+ * See [[column]] for a number that corresponds to a count of Unicode
+ * characters.
+ */
+ get columnIndex(): number;
+ /**
+ * Set an event listener on an event. The parser supports one handler per
+ * event type. If you try to set an event handler over an existing handler,
+ * the old handler is silently overwritten.
+ *
+ * @param name The event to listen to.
+ *
+ * @param handler The handler to set.
+ */
+ on<N extends EventName>(name: N, handler: EventNameToHandler<O, N>): void;
+ /**
+ * Unset an event handler.
+ *
+ * @parma name The event to stop listening to.
+ */
+ off(name: EventName): void;
+ /**
+ * Make an error object. The error object will have a message that contains
+ * the ``fileName`` option passed at the creation of the parser. If position
+ * tracking was turned on, it will also have line and column number
+ * information.
+ *
+ * @param message The message describing the error to report.
+ *
+ * @returns An error object with a properly formatted message.
+ */
+ makeError(message: string): Error;
+ /**
+ * Report a parsing error. This method is made public so that client code may
+ * check for issues that are outside the scope of this project and can report
+ * errors.
+ *
+ * @param message The error to report.
+ *
+ * @returns this
+ */
+ fail(message: string): this;
+ /**
+ * Write a XML data to the parser.
+ *
+ * @param chunk The XML data to write.
+ *
+ * @returns this
+ */
+ write(chunk: string | {} | null): this;
+ /**
+ * Close the current stream. Perform final well-formedness checks and reset
+ * the parser tstate.
+ *
+ * @returns this
+ */
+ close(): this;
+ /**
+ * Get a single code point out of the current chunk. This updates the current
+ * position if we do position tracking.
+ *
+ * This is the algorithm to use for XML 1.0.
+ *
+ * @returns The character read.
+ */
+ private getCode10;
+ /**
+ * Get a single code point out of the current chunk. This updates the current
+ * position if we do position tracking.
+ *
+ * This is the algorithm to use for XML 1.1.
+ *
+ * @returns {number} The character read.
+ */
+ private getCode11;
+ /**
+ * Like ``getCode`` but with the return value normalized so that ``NL`` is
+ * returned for ``NL_LIKE``.
+ */
+ private getCodeNorm;
+ private unget;
+ /**
+ * Capture characters into a buffer until encountering one of a set of
+ * characters.
+ *
+ * @param chars An array of codepoints. Encountering a character in the array
+ * ends the capture. (``chars`` may safely contain ``NL``.)
+ *
+ * @return The character code that made the capture end, or ``EOC`` if we hit
+ * the end of the chunk. The return value cannot be NL_LIKE: NL is returned
+ * instead.
+ */
+ private captureTo;
+ /**
+ * Capture characters into a buffer until encountering a character.
+ *
+ * @param char The codepoint that ends the capture. **NOTE ``char`` MAY NOT
+ * CONTAIN ``NL``.** Passing ``NL`` will result in buggy behavior.
+ *
+ * @return ``true`` if we ran into the character. Otherwise, we ran into the
+ * end of the current chunk.
+ */
+ private captureToChar;
+ /**
+ * Capture characters that satisfy ``isNameChar`` into the ``name`` field of
+ * this parser.
+ *
+ * @return The character code that made the test fail, or ``EOC`` if we hit
+ * the end of the chunk. The return value cannot be NL_LIKE: NL is returned
+ * instead.
+ */
+ private captureNameChars;
+ /**
+ * Skip white spaces.
+ *
+ * @return The character that ended the skip, or ``EOC`` if we hit
+ * the end of the chunk. The return value cannot be NL_LIKE: NL is returned
+ * instead.
+ */
+ private skipSpaces;
+ private setXMLVersion;
+ private sBegin;
+ private sBeginWhitespace;
+ private sDoctype;
+ private sDoctypeQuote;
+ private sDTD;
+ private sDTDQuoted;
+ private sDTDOpenWaka;
+ private sDTDOpenWakaBang;
+ private sDTDComment;
+ private sDTDCommentEnding;
+ private sDTDCommentEnded;
+ private sDTDPI;
+ private sDTDPIEnding;
+ private sText;
+ private sEntity;
+ private sOpenWaka;
+ private sOpenWakaBang;
+ private sComment;
+ private sCommentEnding;
+ private sCommentEnded;
+ private sCData;
+ private sCDataEnding;
+ private sCDataEnding2;
+ private sPIFirstChar;
+ private sPIRest;
+ private sPIBody;
+ private sPIEnding;
+ private sXMLDeclNameStart;
+ private sXMLDeclName;
+ private sXMLDeclEq;
+ private sXMLDeclValueStart;
+ private sXMLDeclValue;
+ private sXMLDeclSeparator;
+ private sXMLDeclEnding;
+ private sOpenTag;
+ private sOpenTagSlash;
+ private sAttrib;
+ private sAttribName;
+ private sAttribNameSawWhite;
+ private sAttribValue;
+ private sAttribValueQuoted;
+ private sAttribValueClosed;
+ private sAttribValueUnquoted;
+ private sCloseTag;
+ private sCloseTagSawWhite;
+ private handleTextInRoot;
+ private handleTextOutsideRoot;
+ private pushAttribNS;
+ private pushAttribPlain;
+ /**
+ * End parsing. This performs final well-formedness checks and resets the
+ * parser to a clean state.
+ *
+ * @returns this
+ */
+ private end;
+ /**
+ * Resolve a namespace prefix.
+ *
+ * @param prefix The prefix to resolve.
+ *
+ * @returns The namespace URI or ``undefined`` if the prefix is not defined.
+ */
+ resolve(prefix: string): string | undefined;
+ /**
+ * Parse a qname into its prefix and local name parts.
+ *
+ * @param name The name to parse
+ *
+ * @returns
+ */
+ private qname;
+ private processAttribsNS;
+ private processAttribsPlain;
+ /**
+ * Handle a complete open tag. This parser code calls this once it has seen
+ * the whole tag. This method checks for well-formeness and then emits
+ * ``onopentag``.
+ */
+ private openTag;
+ /**
+ * Handle a complete self-closing tag. This parser code calls this once it has
+ * seen the whole tag. This method checks for well-formeness and then emits
+ * ``onopentag`` and ``onclosetag``.
+ */
+ private openSelfClosingTag;
+ /**
+ * Handle a complete close tag. This parser code calls this once it has seen
+ * the whole tag. This method checks for well-formeness and then emits
+ * ``onclosetag``.
+ */
+ private closeTag;
+ /**
+ * Resolves an entity. Makes any necessary well-formedness checks.
+ *
+ * @param entity The entity to resolve.
+ *
+ * @returns The parsed entity.
+ */
+ private parseEntity;
+}
diff --git a/school/node_modules/saxes/saxes.js b/school/node_modules/saxes/saxes.js
new file mode 100644
index 0000000..0436871
--- /dev/null
+++ b/school/node_modules/saxes/saxes.js
@@ -0,0 +1,2064 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const ed5 = require("xmlchars/xml/1.0/ed5");
+const ed2 = require("xmlchars/xml/1.1/ed2");
+const NSed3 = require("xmlchars/xmlns/1.0/ed3");
+var isS = ed5.isS;
+var isChar10 = ed5.isChar;
+var isNameStartChar = ed5.isNameStartChar;
+var isNameChar = ed5.isNameChar;
+var S_LIST = ed5.S_LIST;
+var NAME_RE = ed5.NAME_RE;
+var isChar11 = ed2.isChar;
+var isNCNameStartChar = NSed3.isNCNameStartChar;
+var isNCNameChar = NSed3.isNCNameChar;
+var NC_NAME_RE = NSed3.NC_NAME_RE;
+const XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace";
+const XMLNS_NAMESPACE = "http://www.w3.org/2000/xmlns/";
+const rootNS = {
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ __proto__: null,
+ xml: XML_NAMESPACE,
+ xmlns: XMLNS_NAMESPACE,
+};
+const XML_ENTITIES = {
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ __proto__: null,
+ amp: "&",
+ gt: ">",
+ lt: "<",
+ quot: "\"",
+ apos: "'",
+};
+// EOC: end-of-chunk
+const EOC = -1;
+const NL_LIKE = -2;
+const S_BEGIN = 0; // Initial state.
+const S_BEGIN_WHITESPACE = 1; // leading whitespace
+const S_DOCTYPE = 2; // <!DOCTYPE
+const S_DOCTYPE_QUOTE = 3; // <!DOCTYPE "//blah
+const S_DTD = 4; // <!DOCTYPE "//blah" [ ...
+const S_DTD_QUOTED = 5; // <!DOCTYPE "//blah" [ "foo
+const S_DTD_OPEN_WAKA = 6;
+const S_DTD_OPEN_WAKA_BANG = 7;
+const S_DTD_COMMENT = 8; // <!--
+const S_DTD_COMMENT_ENDING = 9; // <!-- blah -
+const S_DTD_COMMENT_ENDED = 10; // <!-- blah --
+const S_DTD_PI = 11; // <?
+const S_DTD_PI_ENDING = 12; // <?hi "there" ?
+const S_TEXT = 13; // general stuff
+const S_ENTITY = 14; // &amp and such
+const S_OPEN_WAKA = 15; // <
+const S_OPEN_WAKA_BANG = 16; // <!...
+const S_COMMENT = 17; // <!--
+const S_COMMENT_ENDING = 18; // <!-- blah -
+const S_COMMENT_ENDED = 19; // <!-- blah --
+const S_CDATA = 20; // <![CDATA[ something
+const S_CDATA_ENDING = 21; // ]
+const S_CDATA_ENDING_2 = 22; // ]]
+const S_PI_FIRST_CHAR = 23; // <?hi, first char
+const S_PI_REST = 24; // <?hi, rest of the name
+const S_PI_BODY = 25; // <?hi there
+const S_PI_ENDING = 26; // <?hi "there" ?
+const S_XML_DECL_NAME_START = 27; // <?xml
+const S_XML_DECL_NAME = 28; // <?xml foo
+const S_XML_DECL_EQ = 29; // <?xml foo=
+const S_XML_DECL_VALUE_START = 30; // <?xml foo=
+const S_XML_DECL_VALUE = 31; // <?xml foo="bar"
+const S_XML_DECL_SEPARATOR = 32; // <?xml foo="bar"
+const S_XML_DECL_ENDING = 33; // <?xml ... ?
+const S_OPEN_TAG = 34; // <strong
+const S_OPEN_TAG_SLASH = 35; // <strong /
+const S_ATTRIB = 36; // <a
+const S_ATTRIB_NAME = 37; // <a foo
+const S_ATTRIB_NAME_SAW_WHITE = 38; // <a foo _
+const S_ATTRIB_VALUE = 39; // <a foo=
+const S_ATTRIB_VALUE_QUOTED = 40; // <a foo="bar
+const S_ATTRIB_VALUE_CLOSED = 41; // <a foo="bar"
+const S_ATTRIB_VALUE_UNQUOTED = 42; // <a foo=bar
+const S_CLOSE_TAG = 43; // </a
+const S_CLOSE_TAG_SAW_WHITE = 44; // </a >
+const TAB = 9;
+const NL = 0xA;
+const CR = 0xD;
+const SPACE = 0x20;
+const BANG = 0x21;
+const DQUOTE = 0x22;
+const AMP = 0x26;
+const SQUOTE = 0x27;
+const MINUS = 0x2D;
+const FORWARD_SLASH = 0x2F;
+const SEMICOLON = 0x3B;
+const LESS = 0x3C;
+const EQUAL = 0x3D;
+const GREATER = 0x3E;
+const QUESTION = 0x3F;
+const OPEN_BRACKET = 0x5B;
+const CLOSE_BRACKET = 0x5D;
+const NEL = 0x85;
+const LS = 0x2028; // Line Separator
+const isQuote = (c) => c === DQUOTE || c === SQUOTE;
+const QUOTES = [DQUOTE, SQUOTE];
+const DOCTYPE_TERMINATOR = [...QUOTES, OPEN_BRACKET, GREATER];
+const DTD_TERMINATOR = [...QUOTES, LESS, CLOSE_BRACKET];
+const XML_DECL_NAME_TERMINATOR = [EQUAL, QUESTION, ...S_LIST];
+const ATTRIB_VALUE_UNQUOTED_TERMINATOR = [...S_LIST, GREATER, AMP, LESS];
+function nsPairCheck(parser, prefix, uri) {
+ switch (prefix) {
+ case "xml":
+ if (uri !== XML_NAMESPACE) {
+ parser.fail(`xml prefix must be bound to ${XML_NAMESPACE}.`);
+ }
+ break;
+ case "xmlns":
+ if (uri !== XMLNS_NAMESPACE) {
+ parser.fail(`xmlns prefix must be bound to ${XMLNS_NAMESPACE}.`);
+ }
+ break;
+ default:
+ }
+ switch (uri) {
+ case XMLNS_NAMESPACE:
+ parser.fail(prefix === "" ?
+ `the default namespace may not be set to ${uri}.` :
+ `may not assign a prefix (even "xmlns") to the URI \
+${XMLNS_NAMESPACE}.`);
+ break;
+ case XML_NAMESPACE:
+ switch (prefix) {
+ case "xml":
+ // Assinging the XML namespace to "xml" is fine.
+ break;
+ case "":
+ parser.fail(`the default namespace may not be set to ${uri}.`);
+ break;
+ default:
+ parser.fail("may not assign the xml namespace to another prefix.");
+ }
+ break;
+ default:
+ }
+}
+function nsMappingCheck(parser, mapping) {
+ for (const local of Object.keys(mapping)) {
+ nsPairCheck(parser, local, mapping[local]);
+ }
+}
+const isNCName = (name) => NC_NAME_RE.test(name);
+const isName = (name) => NAME_RE.test(name);
+const FORBIDDEN_START = 0;
+const FORBIDDEN_BRACKET = 1;
+const FORBIDDEN_BRACKET_BRACKET = 2;
+/**
+ * The list of supported events.
+ */
+exports.EVENTS = [
+ "xmldecl",
+ "text",
+ "processinginstruction",
+ "doctype",
+ "comment",
+ "opentagstart",
+ "attribute",
+ "opentag",
+ "closetag",
+ "cdata",
+ "error",
+ "end",
+ "ready",
+];
+const EVENT_NAME_TO_HANDLER_NAME = {
+ xmldecl: "xmldeclHandler",
+ text: "textHandler",
+ processinginstruction: "piHandler",
+ doctype: "doctypeHandler",
+ comment: "commentHandler",
+ opentagstart: "openTagStartHandler",
+ attribute: "attributeHandler",
+ opentag: "openTagHandler",
+ closetag: "closeTagHandler",
+ cdata: "cdataHandler",
+ error: "errorHandler",
+ end: "endHandler",
+ ready: "readyHandler",
+};
+class SaxesParser {
+ /**
+ * @param opt The parser options.
+ */
+ constructor(opt) {
+ this.opt = opt !== null && opt !== void 0 ? opt : {};
+ this.fragmentOpt = !!this.opt.fragment;
+ const xmlnsOpt = this.xmlnsOpt = !!this.opt.xmlns;
+ this.trackPosition = this.opt.position !== false;
+ this.fileName = this.opt.fileName;
+ if (xmlnsOpt) {
+ // This is the function we use to perform name checks on PIs and entities.
+ // When namespaces are used, colons are not allowed in PI target names or
+ // entity names. So the check depends on whether namespaces are used. See:
+ //
+ // https://www.w3.org/XML/xml-names-19990114-errata.html
+ // NE08
+ //
+ this.nameStartCheck = isNCNameStartChar;
+ this.nameCheck = isNCNameChar;
+ this.isName = isNCName;
+ // eslint-disable-next-line @typescript-eslint/unbound-method
+ this.processAttribs = this.processAttribsNS;
+ // eslint-disable-next-line @typescript-eslint/unbound-method
+ this.pushAttrib = this.pushAttribNS;
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ this.ns = Object.assign({ __proto__: null }, rootNS);
+ const additional = this.opt.additionalNamespaces;
+ if (additional != null) {
+ nsMappingCheck(this, additional);
+ Object.assign(this.ns, additional);
+ }
+ }
+ else {
+ this.nameStartCheck = isNameStartChar;
+ this.nameCheck = isNameChar;
+ this.isName = isName;
+ // eslint-disable-next-line @typescript-eslint/unbound-method
+ this.processAttribs = this.processAttribsPlain;
+ // eslint-disable-next-line @typescript-eslint/unbound-method
+ this.pushAttrib = this.pushAttribPlain;
+ }
+ //
+ // The order of the members in this table needs to correspond to the state
+ // numbers given to the states that correspond to the methods being recorded
+ // here.
+ //
+ this.stateTable = [
+ /* eslint-disable @typescript-eslint/unbound-method */
+ this.sBegin,
+ this.sBeginWhitespace,
+ this.sDoctype,
+ this.sDoctypeQuote,
+ this.sDTD,
+ this.sDTDQuoted,
+ this.sDTDOpenWaka,
+ this.sDTDOpenWakaBang,
+ this.sDTDComment,
+ this.sDTDCommentEnding,
+ this.sDTDCommentEnded,
+ this.sDTDPI,
+ this.sDTDPIEnding,
+ this.sText,
+ this.sEntity,
+ this.sOpenWaka,
+ this.sOpenWakaBang,
+ this.sComment,
+ this.sCommentEnding,
+ this.sCommentEnded,
+ this.sCData,
+ this.sCDataEnding,
+ this.sCDataEnding2,
+ this.sPIFirstChar,
+ this.sPIRest,
+ this.sPIBody,
+ this.sPIEnding,
+ this.sXMLDeclNameStart,
+ this.sXMLDeclName,
+ this.sXMLDeclEq,
+ this.sXMLDeclValueStart,
+ this.sXMLDeclValue,
+ this.sXMLDeclSeparator,
+ this.sXMLDeclEnding,
+ this.sOpenTag,
+ this.sOpenTagSlash,
+ this.sAttrib,
+ this.sAttribName,
+ this.sAttribNameSawWhite,
+ this.sAttribValue,
+ this.sAttribValueQuoted,
+ this.sAttribValueClosed,
+ this.sAttribValueUnquoted,
+ this.sCloseTag,
+ this.sCloseTagSawWhite,
+ ];
+ this._init();
+ }
+ /**
+ * Indicates whether or not the parser is closed. If ``true``, wait for
+ * the ``ready`` event to write again.
+ */
+ get closed() {
+ return this._closed;
+ }
+ _init() {
+ var _a;
+ this.openWakaBang = "";
+ this.text = "";
+ this.name = "";
+ this.piTarget = "";
+ this.entity = "";
+ this.q = null;
+ this.tags = [];
+ this.tag = null;
+ this.topNS = null;
+ this.chunk = "";
+ this.chunkPosition = 0;
+ this.i = 0;
+ this.prevI = 0;
+ this.carriedFromPrevious = undefined;
+ this.forbiddenState = FORBIDDEN_START;
+ this.attribList = [];
+ // The logic is organized so as to minimize the need to check
+ // this.opt.fragment while parsing.
+ const { fragmentOpt } = this;
+ this.state = fragmentOpt ? S_TEXT : S_BEGIN;
+ // We want these to be all true if we are dealing with a fragment.
+ this.reportedTextBeforeRoot = this.reportedTextAfterRoot = this.closedRoot =
+ this.sawRoot = fragmentOpt;
+ // An XML declaration is intially possible only when parsing whole
+ // documents.
+ this.xmlDeclPossible = !fragmentOpt;
+ this.xmlDeclExpects = ["version"];
+ this.entityReturnState = undefined;
+ let { defaultXMLVersion } = this.opt;
+ if (defaultXMLVersion === undefined) {
+ if (this.opt.forceXMLVersion === true) {
+ throw new Error("forceXMLVersion set but defaultXMLVersion is not set");
+ }
+ defaultXMLVersion = "1.0";
+ }
+ this.setXMLVersion(defaultXMLVersion);
+ this.positionAtNewLine = 0;
+ this.doctype = false;
+ this._closed = false;
+ this.xmlDecl = {
+ version: undefined,
+ encoding: undefined,
+ standalone: undefined,
+ };
+ this.line = 1;
+ this.column = 0;
+ this.ENTITIES = Object.create(XML_ENTITIES);
+ // eslint-disable-next-line no-unused-expressions
+ (_a = this.readyHandler) === null || _a === void 0 ? void 0 : _a.call(this);
+ }
+ /**
+ * The stream position the parser is currently looking at. This field is
+ * zero-based.
+ *
+ * This field is not based on counting Unicode characters but is to be
+ * interpreted as a plain index into a JavaScript string.
+ */
+ get position() {
+ return this.chunkPosition + this.i;
+ }
+ /**
+ * The column number of the next character to be read by the parser. *
+ * This field is zero-based. (The first column in a line is 0.)
+ *
+ * This field reports the index at which the next character would be in the
+ * line if the line were represented as a JavaScript string. Note that this
+ * *can* be different to a count based on the number of *Unicode characters*
+ * due to how JavaScript handles astral plane characters.
+ *
+ * See [[column]] for a number that corresponds to a count of Unicode
+ * characters.
+ */
+ get columnIndex() {
+ return this.position - this.positionAtNewLine;
+ }
+ /**
+ * Set an event listener on an event. The parser supports one handler per
+ * event type. If you try to set an event handler over an existing handler,
+ * the old handler is silently overwritten.
+ *
+ * @param name The event to listen to.
+ *
+ * @param handler The handler to set.
+ */
+ on(name, handler) {
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ this[EVENT_NAME_TO_HANDLER_NAME[name]] = handler;
+ }
+ /**
+ * Unset an event handler.
+ *
+ * @parma name The event to stop listening to.
+ */
+ off(name) {
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ this[EVENT_NAME_TO_HANDLER_NAME[name]] = undefined;
+ }
+ /**
+ * Make an error object. The error object will have a message that contains
+ * the ``fileName`` option passed at the creation of the parser. If position
+ * tracking was turned on, it will also have line and column number
+ * information.
+ *
+ * @param message The message describing the error to report.
+ *
+ * @returns An error object with a properly formatted message.
+ */
+ makeError(message) {
+ var _a;
+ let msg = (_a = this.fileName) !== null && _a !== void 0 ? _a : "";
+ if (this.trackPosition) {
+ if (msg.length > 0) {
+ msg += ":";
+ }
+ msg += `${this.line}:${this.column}`;
+ }
+ if (msg.length > 0) {
+ msg += ": ";
+ }
+ return new Error(msg + message);
+ }
+ /**
+ * Report a parsing error. This method is made public so that client code may
+ * check for issues that are outside the scope of this project and can report
+ * errors.
+ *
+ * @param message The error to report.
+ *
+ * @returns this
+ */
+ fail(message) {
+ const err = this.makeError(message);
+ const handler = this.errorHandler;
+ if (handler === undefined) {
+ throw err;
+ }
+ else {
+ handler(err);
+ }
+ return this;
+ }
+ /**
+ * Write a XML data to the parser.
+ *
+ * @param chunk The XML data to write.
+ *
+ * @returns this
+ */
+ write(chunk) {
+ if (this.closed) {
+ return this.fail("cannot write after close; assign an onready handler.");
+ }
+ let end = false;
+ if (chunk === null) {
+ // We cannot return immediately because carriedFromPrevious may need
+ // processing.
+ end = true;
+ chunk = "";
+ }
+ else if (typeof chunk === "object") {
+ chunk = chunk.toString();
+ }
+ // We checked if performing a pre-decomposition of the string into an array
+ // of single complete characters (``Array.from(chunk)``) would be faster
+ // than the current repeated calls to ``charCodeAt``. As of August 2018, it
+ // isn't. (There may be Node-specific code that would perform faster than
+ // ``Array.from`` but don't want to be dependent on Node.)
+ if (this.carriedFromPrevious !== undefined) {
+ // The previous chunk had char we must carry over.
+ chunk = `${this.carriedFromPrevious}${chunk}`;
+ this.carriedFromPrevious = undefined;
+ }
+ let limit = chunk.length;
+ const lastCode = chunk.charCodeAt(limit - 1);
+ if (!end &&
+ // A trailing CR or surrogate must be carried over to the next
+ // chunk.
+ (lastCode === CR || (lastCode >= 0xD800 && lastCode <= 0xDBFF))) {
+ // The chunk ends with a character that must be carried over. We cannot
+ // know how to handle it until we get the next chunk or the end of the
+ // stream. So save it for later.
+ this.carriedFromPrevious = chunk[limit - 1];
+ limit--;
+ chunk = chunk.slice(0, limit);
+ }
+ const { stateTable } = this;
+ this.chunk = chunk;
+ this.i = 0;
+ while (this.i < limit) {
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ stateTable[this.state].call(this);
+ }
+ this.chunkPosition += limit;
+ return end ? this.end() : this;
+ }
+ /**
+ * Close the current stream. Perform final well-formedness checks and reset
+ * the parser tstate.
+ *
+ * @returns this
+ */
+ close() {
+ return this.write(null);
+ }
+ /**
+ * Get a single code point out of the current chunk. This updates the current
+ * position if we do position tracking.
+ *
+ * This is the algorithm to use for XML 1.0.
+ *
+ * @returns The character read.
+ */
+ getCode10() {
+ const { chunk, i } = this;
+ this.prevI = i;
+ // Yes, we do this instead of doing this.i++. Doing it this way, we do not
+ // read this.i again, which is a bit faster.
+ this.i = i + 1;
+ if (i >= chunk.length) {
+ return EOC;
+ }
+ // Using charCodeAt and handling the surrogates ourselves is faster
+ // than using codePointAt.
+ const code = chunk.charCodeAt(i);
+ this.column++;
+ if (code < 0xD800) {
+ if (code >= SPACE || code === TAB) {
+ return code;
+ }
+ switch (code) {
+ case NL:
+ this.line++;
+ this.column = 0;
+ this.positionAtNewLine = this.position;
+ return NL;
+ case CR:
+ // We may get NaN if we read past the end of the chunk, which is fine.
+ if (chunk.charCodeAt(i + 1) === NL) {
+ // A \r\n sequence is converted to \n so we have to skip over the
+ // next character. We already know it has a size of 1 so ++ is fine
+ // here.
+ this.i = i + 2;
+ }
+ // Otherwise, a \r is just converted to \n, so we don't have to skip
+ // ahead.
+ // In either case, \r becomes \n.
+ this.line++;
+ this.column = 0;
+ this.positionAtNewLine = this.position;
+ return NL_LIKE;
+ default:
+ // If we get here, then code < SPACE and it is not NL CR or TAB.
+ this.fail("disallowed character.");
+ return code;
+ }
+ }
+ if (code > 0xDBFF) {
+ // This is a specialized version of isChar10 that takes into account
+ // that in this context code > 0xDBFF and code <= 0xFFFF. So it does not
+ // test cases that don't need testing.
+ if (!(code >= 0xE000 && code <= 0xFFFD)) {
+ this.fail("disallowed character.");
+ }
+ return code;
+ }
+ const final = 0x10000 + ((code - 0xD800) * 0x400) +
+ (chunk.charCodeAt(i + 1) - 0xDC00);
+ this.i = i + 2;
+ // This is a specialized version of isChar10 that takes into account that in
+ // this context necessarily final >= 0x10000.
+ if (final > 0x10FFFF) {
+ this.fail("disallowed character.");
+ }
+ return final;
+ }
+ /**
+ * Get a single code point out of the current chunk. This updates the current
+ * position if we do position tracking.
+ *
+ * This is the algorithm to use for XML 1.1.
+ *
+ * @returns {number} The character read.
+ */
+ getCode11() {
+ const { chunk, i } = this;
+ this.prevI = i;
+ // Yes, we do this instead of doing this.i++. Doing it this way, we do not
+ // read this.i again, which is a bit faster.
+ this.i = i + 1;
+ if (i >= chunk.length) {
+ return EOC;
+ }
+ // Using charCodeAt and handling the surrogates ourselves is faster
+ // than using codePointAt.
+ const code = chunk.charCodeAt(i);
+ this.column++;
+ if (code < 0xD800) {
+ if ((code > 0x1F && code < 0x7F) || (code > 0x9F && code !== LS) ||
+ code === TAB) {
+ return code;
+ }
+ switch (code) {
+ case NL: // 0xA
+ this.line++;
+ this.column = 0;
+ this.positionAtNewLine = this.position;
+ return NL;
+ case CR: { // 0xD
+ // We may get NaN if we read past the end of the chunk, which is
+ // fine.
+ const next = chunk.charCodeAt(i + 1);
+ if (next === NL || next === NEL) {
+ // A CR NL or CR NEL sequence is converted to NL so we have to skip
+ // over the next character. We already know it has a size of 1.
+ this.i = i + 2;
+ }
+ // Otherwise, a CR is just converted to NL, no skip.
+ }
+ /* yes, fall through */
+ case NEL: // 0x85
+ case LS: // Ox2028
+ this.line++;
+ this.column = 0;
+ this.positionAtNewLine = this.position;
+ return NL_LIKE;
+ default:
+ this.fail("disallowed character.");
+ return code;
+ }
+ }
+ if (code > 0xDBFF) {
+ // This is a specialized version of isCharAndNotRestricted that takes into
+ // account that in this context code > 0xDBFF and code <= 0xFFFF. So it
+ // does not test cases that don't need testing.
+ if (!(code >= 0xE000 && code <= 0xFFFD)) {
+ this.fail("disallowed character.");
+ }
+ return code;
+ }
+ const final = 0x10000 + ((code - 0xD800) * 0x400) +
+ (chunk.charCodeAt(i + 1) - 0xDC00);
+ this.i = i + 2;
+ // This is a specialized version of isCharAndNotRestricted that takes into
+ // account that in this context necessarily final >= 0x10000.
+ if (final > 0x10FFFF) {
+ this.fail("disallowed character.");
+ }
+ return final;
+ }
+ /**
+ * Like ``getCode`` but with the return value normalized so that ``NL`` is
+ * returned for ``NL_LIKE``.
+ */
+ getCodeNorm() {
+ const c = this.getCode();
+ return c === NL_LIKE ? NL : c;
+ }
+ unget() {
+ this.i = this.prevI;
+ this.column--;
+ }
+ /**
+ * Capture characters into a buffer until encountering one of a set of
+ * characters.
+ *
+ * @param chars An array of codepoints. Encountering a character in the array
+ * ends the capture. (``chars`` may safely contain ``NL``.)
+ *
+ * @return The character code that made the capture end, or ``EOC`` if we hit
+ * the end of the chunk. The return value cannot be NL_LIKE: NL is returned
+ * instead.
+ */
+ captureTo(chars) {
+ let { i: start } = this;
+ const { chunk } = this;
+ // eslint-disable-next-line no-constant-condition
+ while (true) {
+ const c = this.getCode();
+ const isNLLike = c === NL_LIKE;
+ const final = isNLLike ? NL : c;
+ if (final === EOC || chars.includes(final)) {
+ this.text += chunk.slice(start, this.prevI);
+ return final;
+ }
+ if (isNLLike) {
+ this.text += `${chunk.slice(start, this.prevI)}\n`;
+ start = this.i;
+ }
+ }
+ }
+ /**
+ * Capture characters into a buffer until encountering a character.
+ *
+ * @param char The codepoint that ends the capture. **NOTE ``char`` MAY NOT
+ * CONTAIN ``NL``.** Passing ``NL`` will result in buggy behavior.
+ *
+ * @return ``true`` if we ran into the character. Otherwise, we ran into the
+ * end of the current chunk.
+ */
+ captureToChar(char) {
+ let { i: start } = this;
+ const { chunk } = this;
+ // eslint-disable-next-line no-constant-condition
+ while (true) {
+ let c = this.getCode();
+ switch (c) {
+ case NL_LIKE:
+ this.text += `${chunk.slice(start, this.prevI)}\n`;
+ start = this.i;
+ c = NL;
+ break;
+ case EOC:
+ this.text += chunk.slice(start);
+ return false;
+ default:
+ }
+ if (c === char) {
+ this.text += chunk.slice(start, this.prevI);
+ return true;
+ }
+ }
+ }
+ /**
+ * Capture characters that satisfy ``isNameChar`` into the ``name`` field of
+ * this parser.
+ *
+ * @return The character code that made the test fail, or ``EOC`` if we hit
+ * the end of the chunk. The return value cannot be NL_LIKE: NL is returned
+ * instead.
+ */
+ captureNameChars() {
+ const { chunk, i: start } = this;
+ // eslint-disable-next-line no-constant-condition
+ while (true) {
+ const c = this.getCode();
+ if (c === EOC) {
+ this.name += chunk.slice(start);
+ return EOC;
+ }
+ // NL is not a name char so we don't have to test specifically for it.
+ if (!isNameChar(c)) {
+ this.name += chunk.slice(start, this.prevI);
+ return c === NL_LIKE ? NL : c;
+ }
+ }
+ }
+ /**
+ * Skip white spaces.
+ *
+ * @return The character that ended the skip, or ``EOC`` if we hit
+ * the end of the chunk. The return value cannot be NL_LIKE: NL is returned
+ * instead.
+ */
+ skipSpaces() {
+ // eslint-disable-next-line no-constant-condition
+ while (true) {
+ const c = this.getCodeNorm();
+ if (c === EOC || !isS(c)) {
+ return c;
+ }
+ }
+ }
+ setXMLVersion(version) {
+ this.currentXMLVersion = version;
+ /* eslint-disable @typescript-eslint/unbound-method */
+ if (version === "1.0") {
+ this.isChar = isChar10;
+ this.getCode = this.getCode10;
+ }
+ else {
+ this.isChar = isChar11;
+ this.getCode = this.getCode11;
+ }
+ /* eslint-enable @typescript-eslint/unbound-method */
+ }
+ // STATE ENGINE METHODS
+ // This needs to be a state separate from S_BEGIN_WHITESPACE because we want
+ // to be sure never to come back to this state later.
+ sBegin() {
+ // We are essentially peeking at the first character of the chunk. Since
+ // S_BEGIN can be in effect only when we start working on the first chunk,
+ // the index at which we must look is necessarily 0. Note also that the
+ // following test does not depend on decoding surrogates.
+ // If the initial character is 0xFEFF, ignore it.
+ if (this.chunk.charCodeAt(0) === 0xFEFF) {
+ this.i++;
+ this.column++;
+ }
+ this.state = S_BEGIN_WHITESPACE;
+ }
+ sBeginWhitespace() {
+ // We need to know whether we've encountered spaces or not because as soon
+ // as we run into a space, an XML declaration is no longer possible. Rather
+ // than slow down skipSpaces even in places where we don't care whether it
+ // skipped anything or not, we check whether prevI is equal to the value of
+ // i from before we skip spaces.
+ const iBefore = this.i;
+ const c = this.skipSpaces();
+ if (this.prevI !== iBefore) {
+ this.xmlDeclPossible = false;
+ }
+ switch (c) {
+ case LESS:
+ this.state = S_OPEN_WAKA;
+ // We could naively call closeText but in this state, it is not normal
+ // to have text be filled with any data.
+ if (this.text.length !== 0) {
+ throw new Error("no-empty text at start");
+ }
+ break;
+ case EOC:
+ break;
+ default:
+ this.unget();
+ this.state = S_TEXT;
+ this.xmlDeclPossible = false;
+ }
+ }
+ sDoctype() {
+ var _a;
+ const c = this.captureTo(DOCTYPE_TERMINATOR);
+ switch (c) {
+ case GREATER: {
+ // eslint-disable-next-line no-unused-expressions
+ (_a = this.doctypeHandler) === null || _a === void 0 ? void 0 : _a.call(this, this.text);
+ this.text = "";
+ this.state = S_TEXT;
+ this.doctype = true; // just remember that we saw it.
+ break;
+ }
+ case EOC:
+ break;
+ default:
+ this.text += String.fromCodePoint(c);
+ if (c === OPEN_BRACKET) {
+ this.state = S_DTD;
+ }
+ else if (isQuote(c)) {
+ this.state = S_DOCTYPE_QUOTE;
+ this.q = c;
+ }
+ }
+ }
+ sDoctypeQuote() {
+ const q = this.q;
+ if (this.captureToChar(q)) {
+ this.text += String.fromCodePoint(q);
+ this.q = null;
+ this.state = S_DOCTYPE;
+ }
+ }
+ sDTD() {
+ const c = this.captureTo(DTD_TERMINATOR);
+ if (c === EOC) {
+ return;
+ }
+ this.text += String.fromCodePoint(c);
+ if (c === CLOSE_BRACKET) {
+ this.state = S_DOCTYPE;
+ }
+ else if (c === LESS) {
+ this.state = S_DTD_OPEN_WAKA;
+ }
+ else if (isQuote(c)) {
+ this.state = S_DTD_QUOTED;
+ this.q = c;
+ }
+ }
+ sDTDQuoted() {
+ const q = this.q;
+ if (this.captureToChar(q)) {
+ this.text += String.fromCodePoint(q);
+ this.state = S_DTD;
+ this.q = null;
+ }
+ }
+ sDTDOpenWaka() {
+ const c = this.getCodeNorm();
+ this.text += String.fromCodePoint(c);
+ switch (c) {
+ case BANG:
+ this.state = S_DTD_OPEN_WAKA_BANG;
+ this.openWakaBang = "";
+ break;
+ case QUESTION:
+ this.state = S_DTD_PI;
+ break;
+ default:
+ this.state = S_DTD;
+ }
+ }
+ sDTDOpenWakaBang() {
+ const char = String.fromCodePoint(this.getCodeNorm());
+ const owb = this.openWakaBang += char;
+ this.text += char;
+ if (owb !== "-") {
+ this.state = owb === "--" ? S_DTD_COMMENT : S_DTD;
+ this.openWakaBang = "";
+ }
+ }
+ sDTDComment() {
+ if (this.captureToChar(MINUS)) {
+ this.text += "-";
+ this.state = S_DTD_COMMENT_ENDING;
+ }
+ }
+ sDTDCommentEnding() {
+ const c = this.getCodeNorm();
+ this.text += String.fromCodePoint(c);
+ this.state = c === MINUS ? S_DTD_COMMENT_ENDED : S_DTD_COMMENT;
+ }
+ sDTDCommentEnded() {
+ const c = this.getCodeNorm();
+ this.text += String.fromCodePoint(c);
+ if (c === GREATER) {
+ this.state = S_DTD;
+ }
+ else {
+ this.fail("malformed comment.");
+ // <!-- blah -- bloo --> will be recorded as
+ // a comment of " blah -- bloo "
+ this.state = S_DTD_COMMENT;
+ }
+ }
+ sDTDPI() {
+ if (this.captureToChar(QUESTION)) {
+ this.text += "?";
+ this.state = S_DTD_PI_ENDING;
+ }
+ }
+ sDTDPIEnding() {
+ const c = this.getCodeNorm();
+ this.text += String.fromCodePoint(c);
+ if (c === GREATER) {
+ this.state = S_DTD;
+ }
+ }
+ sText() {
+ //
+ // We did try a version of saxes where the S_TEXT state was split in two
+ // states: one for text inside the root element, and one for text
+ // outside. This was avoiding having to test this.tags.length to decide
+ // what implementation to actually use.
+ //
+ // Peformance testing on gigabyte-size files did not show any advantage to
+ // using the two states solution instead of the current one. Conversely, it
+ // made the code a bit more complicated elsewhere. For instance, a comment
+ // can appear before the root element so when a comment ended it was
+ // necessary to determine whether to return to the S_TEXT state or to the
+ // new text-outside-root state.
+ //
+ if (this.tags.length !== 0) {
+ this.handleTextInRoot();
+ }
+ else {
+ this.handleTextOutsideRoot();
+ }
+ }
+ sEntity() {
+ // This is essentially a specialized version of captureToChar(SEMICOLON...)
+ let { i: start } = this;
+ const { chunk } = this;
+ // eslint-disable-next-line no-labels, no-restricted-syntax
+ loop:
+ // eslint-disable-next-line no-constant-condition
+ while (true) {
+ switch (this.getCode()) {
+ case NL_LIKE:
+ this.entity += `${chunk.slice(start, this.prevI)}\n`;
+ start = this.i;
+ break;
+ case SEMICOLON: {
+ const { entityReturnState } = this;
+ const entity = this.entity + chunk.slice(start, this.prevI);
+ this.state = entityReturnState;
+ let parsed;
+ if (entity === "") {
+ this.fail("empty entity name.");
+ parsed = "&;";
+ }
+ else {
+ parsed = this.parseEntity(entity);
+ this.entity = "";
+ }
+ if (entityReturnState !== S_TEXT || this.textHandler !== undefined) {
+ this.text += parsed;
+ }
+ // eslint-disable-next-line no-labels
+ break loop;
+ }
+ case EOC:
+ this.entity += chunk.slice(start);
+ // eslint-disable-next-line no-labels
+ break loop;
+ default:
+ }
+ }
+ }
+ sOpenWaka() {
+ // Reminder: a state handler is called with at least one character
+ // available in the current chunk. So the first call to get code inside of
+ // a state handler cannot return ``EOC``. That's why we don't test
+ // for it.
+ const c = this.getCode();
+ // either a /, ?, !, or text is coming next.
+ if (isNameStartChar(c)) {
+ this.state = S_OPEN_TAG;
+ this.unget();
+ this.xmlDeclPossible = false;
+ }
+ else {
+ switch (c) {
+ case FORWARD_SLASH:
+ this.state = S_CLOSE_TAG;
+ this.xmlDeclPossible = false;
+ break;
+ case BANG:
+ this.state = S_OPEN_WAKA_BANG;
+ this.openWakaBang = "";
+ this.xmlDeclPossible = false;
+ break;
+ case QUESTION:
+ this.state = S_PI_FIRST_CHAR;
+ break;
+ default:
+ this.fail("disallowed character in tag name");
+ this.state = S_TEXT;
+ this.xmlDeclPossible = false;
+ }
+ }
+ }
+ sOpenWakaBang() {
+ this.openWakaBang += String.fromCodePoint(this.getCodeNorm());
+ switch (this.openWakaBang) {
+ case "[CDATA[":
+ if (!this.sawRoot && !this.reportedTextBeforeRoot) {
+ this.fail("text data outside of root node.");
+ this.reportedTextBeforeRoot = true;
+ }
+ if (this.closedRoot && !this.reportedTextAfterRoot) {
+ this.fail("text data outside of root node.");
+ this.reportedTextAfterRoot = true;
+ }
+ this.state = S_CDATA;
+ this.openWakaBang = "";
+ break;
+ case "--":
+ this.state = S_COMMENT;
+ this.openWakaBang = "";
+ break;
+ case "DOCTYPE":
+ this.state = S_DOCTYPE;
+ if (this.doctype || this.sawRoot) {
+ this.fail("inappropriately located doctype declaration.");
+ }
+ this.openWakaBang = "";
+ break;
+ default:
+ // 7 happens to be the maximum length of the string that can possibly
+ // match one of the cases above.
+ if (this.openWakaBang.length >= 7) {
+ this.fail("incorrect syntax.");
+ }
+ }
+ }
+ sComment() {
+ if (this.captureToChar(MINUS)) {
+ this.state = S_COMMENT_ENDING;
+ }
+ }
+ sCommentEnding() {
+ var _a;
+ const c = this.getCodeNorm();
+ if (c === MINUS) {
+ this.state = S_COMMENT_ENDED;
+ // eslint-disable-next-line no-unused-expressions
+ (_a = this.commentHandler) === null || _a === void 0 ? void 0 : _a.call(this, this.text);
+ this.text = "";
+ }
+ else {
+ this.text += `-${String.fromCodePoint(c)}`;
+ this.state = S_COMMENT;
+ }
+ }
+ sCommentEnded() {
+ const c = this.getCodeNorm();
+ if (c !== GREATER) {
+ this.fail("malformed comment.");
+ // <!-- blah -- bloo --> will be recorded as
+ // a comment of " blah -- bloo "
+ this.text += `--${String.fromCodePoint(c)}`;
+ this.state = S_COMMENT;
+ }
+ else {
+ this.state = S_TEXT;
+ }
+ }
+ sCData() {
+ if (this.captureToChar(CLOSE_BRACKET)) {
+ this.state = S_CDATA_ENDING;
+ }
+ }
+ sCDataEnding() {
+ const c = this.getCodeNorm();
+ if (c === CLOSE_BRACKET) {
+ this.state = S_CDATA_ENDING_2;
+ }
+ else {
+ this.text += `]${String.fromCodePoint(c)}`;
+ this.state = S_CDATA;
+ }
+ }
+ sCDataEnding2() {
+ var _a;
+ const c = this.getCodeNorm();
+ switch (c) {
+ case GREATER: {
+ // eslint-disable-next-line no-unused-expressions
+ (_a = this.cdataHandler) === null || _a === void 0 ? void 0 : _a.call(this, this.text);
+ this.text = "";
+ this.state = S_TEXT;
+ break;
+ }
+ case CLOSE_BRACKET:
+ this.text += "]";
+ break;
+ default:
+ this.text += `]]${String.fromCodePoint(c)}`;
+ this.state = S_CDATA;
+ }
+ }
+ // We need this separate state to check the first character fo the pi target
+ // with this.nameStartCheck which allows less characters than this.nameCheck.
+ sPIFirstChar() {
+ const c = this.getCodeNorm();
+ // This is first because in the case where the file is well-formed this is
+ // the branch taken. We optimize for well-formedness.
+ if (this.nameStartCheck(c)) {
+ this.piTarget += String.fromCodePoint(c);
+ this.state = S_PI_REST;
+ }
+ else if (c === QUESTION || isS(c)) {
+ this.fail("processing instruction without a target.");
+ this.state = c === QUESTION ? S_PI_ENDING : S_PI_BODY;
+ }
+ else {
+ this.fail("disallowed character in processing instruction name.");
+ this.piTarget += String.fromCodePoint(c);
+ this.state = S_PI_REST;
+ }
+ }
+ sPIRest() {
+ // Capture characters into a piTarget while ``this.nameCheck`` run on the
+ // character read returns true.
+ const { chunk, i: start } = this;
+ // eslint-disable-next-line no-constant-condition
+ while (true) {
+ const c = this.getCodeNorm();
+ if (c === EOC) {
+ this.piTarget += chunk.slice(start);
+ return;
+ }
+ // NL cannot satisfy this.nameCheck so we don't have to test specifically
+ // for it.
+ if (!this.nameCheck(c)) {
+ this.piTarget += chunk.slice(start, this.prevI);
+ const isQuestion = c === QUESTION;
+ if (isQuestion || isS(c)) {
+ if (this.piTarget === "xml") {
+ if (!this.xmlDeclPossible) {
+ this.fail("an XML declaration must be at the start of the document.");
+ }
+ this.state = isQuestion ? S_XML_DECL_ENDING : S_XML_DECL_NAME_START;
+ }
+ else {
+ this.state = isQuestion ? S_PI_ENDING : S_PI_BODY;
+ }
+ }
+ else {
+ this.fail("disallowed character in processing instruction name.");
+ this.piTarget += String.fromCodePoint(c);
+ }
+ break;
+ }
+ }
+ }
+ sPIBody() {
+ if (this.text.length === 0) {
+ const c = this.getCodeNorm();
+ if (c === QUESTION) {
+ this.state = S_PI_ENDING;
+ }
+ else if (!isS(c)) {
+ this.text = String.fromCodePoint(c);
+ }
+ }
+ // The question mark character is not valid inside any of the XML
+ // declaration name/value pairs.
+ else if (this.captureToChar(QUESTION)) {
+ this.state = S_PI_ENDING;
+ }
+ }
+ sPIEnding() {
+ var _a;
+ const c = this.getCodeNorm();
+ if (c === GREATER) {
+ const { piTarget } = this;
+ if (piTarget.toLowerCase() === "xml") {
+ this.fail("the XML declaration must appear at the start of the document.");
+ }
+ // eslint-disable-next-line no-unused-expressions
+ (_a = this.piHandler) === null || _a === void 0 ? void 0 : _a.call(this, {
+ target: piTarget,
+ body: this.text,
+ });
+ this.piTarget = this.text = "";
+ this.state = S_TEXT;
+ }
+ else if (c === QUESTION) {
+ // We ran into ?? as part of a processing instruction. We initially took
+ // the first ? as a sign that the PI was ending, but it is not. So we have
+ // to add it to the body but we take the new ? as a sign that the PI is
+ // ending.
+ this.text += "?";
+ }
+ else {
+ this.text += `?${String.fromCodePoint(c)}`;
+ this.state = S_PI_BODY;
+ }
+ this.xmlDeclPossible = false;
+ }
+ sXMLDeclNameStart() {
+ const c = this.skipSpaces();
+ // The question mark character is not valid inside any of the XML
+ // declaration name/value pairs.
+ if (c === QUESTION) {
+ // It is valid to go to S_XML_DECL_ENDING from this state.
+ this.state = S_XML_DECL_ENDING;
+ return;
+ }
+ if (c !== EOC) {
+ this.state = S_XML_DECL_NAME;
+ this.name = String.fromCodePoint(c);
+ }
+ }
+ sXMLDeclName() {
+ const c = this.captureTo(XML_DECL_NAME_TERMINATOR);
+ // The question mark character is not valid inside any of the XML
+ // declaration name/value pairs.
+ if (c === QUESTION) {
+ this.state = S_XML_DECL_ENDING;
+ this.name += this.text;
+ this.text = "";
+ this.fail("XML declaration is incomplete.");
+ return;
+ }
+ if (!(isS(c) || c === EQUAL)) {
+ return;
+ }
+ this.name += this.text;
+ this.text = "";
+ if (!this.xmlDeclExpects.includes(this.name)) {
+ switch (this.name.length) {
+ case 0:
+ this.fail("did not expect any more name/value pairs.");
+ break;
+ case 1:
+ this.fail(`expected the name ${this.xmlDeclExpects[0]}.`);
+ break;
+ default:
+ this.fail(`expected one of ${this.xmlDeclExpects.join(", ")}`);
+ }
+ }
+ this.state = c === EQUAL ? S_XML_DECL_VALUE_START : S_XML_DECL_EQ;
+ }
+ sXMLDeclEq() {
+ const c = this.getCodeNorm();
+ // The question mark character is not valid inside any of the XML
+ // declaration name/value pairs.
+ if (c === QUESTION) {
+ this.state = S_XML_DECL_ENDING;
+ this.fail("XML declaration is incomplete.");
+ return;
+ }
+ if (isS(c)) {
+ return;
+ }
+ if (c !== EQUAL) {
+ this.fail("value required.");
+ }
+ this.state = S_XML_DECL_VALUE_START;
+ }
+ sXMLDeclValueStart() {
+ const c = this.getCodeNorm();
+ // The question mark character is not valid inside any of the XML
+ // declaration name/value pairs.
+ if (c === QUESTION) {
+ this.state = S_XML_DECL_ENDING;
+ this.fail("XML declaration is incomplete.");
+ return;
+ }
+ if (isS(c)) {
+ return;
+ }
+ if (!isQuote(c)) {
+ this.fail("value must be quoted.");
+ this.q = SPACE;
+ }
+ else {
+ this.q = c;
+ }
+ this.state = S_XML_DECL_VALUE;
+ }
+ sXMLDeclValue() {
+ const c = this.captureTo([this.q, QUESTION]);
+ // The question mark character is not valid inside any of the XML
+ // declaration name/value pairs.
+ if (c === QUESTION) {
+ this.state = S_XML_DECL_ENDING;
+ this.text = "";
+ this.fail("XML declaration is incomplete.");
+ return;
+ }
+ if (c === EOC) {
+ return;
+ }
+ const value = this.text;
+ this.text = "";
+ switch (this.name) {
+ case "version": {
+ this.xmlDeclExpects = ["encoding", "standalone"];
+ const version = value;
+ this.xmlDecl.version = version;
+ // This is the test specified by XML 1.0 but it is fine for XML 1.1.
+ if (!/^1\.[0-9]+$/.test(version)) {
+ this.fail("version number must match /^1\\.[0-9]+$/.");
+ }
+ // When forceXMLVersion is set, the XML declaration is ignored.
+ else if (!this.opt.forceXMLVersion) {
+ this.setXMLVersion(version);
+ }
+ break;
+ }
+ case "encoding":
+ if (!/^[A-Za-z][A-Za-z0-9._-]*$/.test(value)) {
+ this.fail("encoding value must match \
+/^[A-Za-z0-9][A-Za-z0-9._-]*$/.");
+ }
+ this.xmlDeclExpects = ["standalone"];
+ this.xmlDecl.encoding = value;
+ break;
+ case "standalone":
+ if (value !== "yes" && value !== "no") {
+ this.fail("standalone value must match \"yes\" or \"no\".");
+ }
+ this.xmlDeclExpects = [];
+ this.xmlDecl.standalone = value;
+ break;
+ default:
+ // We don't need to raise an error here since we've already raised one
+ // when checking what name was expected.
+ }
+ this.name = "";
+ this.state = S_XML_DECL_SEPARATOR;
+ }
+ sXMLDeclSeparator() {
+ const c = this.getCodeNorm();
+ // The question mark character is not valid inside any of the XML
+ // declaration name/value pairs.
+ if (c === QUESTION) {
+ // It is valid to go to S_XML_DECL_ENDING from this state.
+ this.state = S_XML_DECL_ENDING;
+ return;
+ }
+ if (!isS(c)) {
+ this.fail("whitespace required.");
+ this.unget();
+ }
+ this.state = S_XML_DECL_NAME_START;
+ }
+ sXMLDeclEnding() {
+ var _a;
+ const c = this.getCodeNorm();
+ if (c === GREATER) {
+ if (this.piTarget !== "xml") {
+ this.fail("processing instructions are not allowed before root.");
+ }
+ else if (this.name !== "version" &&
+ this.xmlDeclExpects.includes("version")) {
+ this.fail("XML declaration must contain a version.");
+ }
+ // eslint-disable-next-line no-unused-expressions
+ (_a = this.xmldeclHandler) === null || _a === void 0 ? void 0 : _a.call(this, this.xmlDecl);
+ this.name = "";
+ this.piTarget = this.text = "";
+ this.state = S_TEXT;
+ }
+ else {
+ // We got here because the previous character was a ?, but the question
+ // mark character is not valid inside any of the XML declaration
+ // name/value pairs.
+ this.fail("The character ? is disallowed anywhere in XML declarations.");
+ }
+ this.xmlDeclPossible = false;
+ }
+ sOpenTag() {
+ var _a;
+ const c = this.captureNameChars();
+ if (c === EOC) {
+ return;
+ }
+ const tag = this.tag = {
+ name: this.name,
+ attributes: Object.create(null),
+ };
+ this.name = "";
+ if (this.xmlnsOpt) {
+ this.topNS = tag.ns = Object.create(null);
+ }
+ // eslint-disable-next-line no-unused-expressions
+ (_a = this.openTagStartHandler) === null || _a === void 0 ? void 0 : _a.call(this, tag);
+ this.sawRoot = true;
+ if (!this.fragmentOpt && this.closedRoot) {
+ this.fail("documents may contain only one root.");
+ }
+ switch (c) {
+ case GREATER:
+ this.openTag();
+ break;
+ case FORWARD_SLASH:
+ this.state = S_OPEN_TAG_SLASH;
+ break;
+ default:
+ if (!isS(c)) {
+ this.fail("disallowed character in tag name.");
+ }
+ this.state = S_ATTRIB;
+ }
+ }
+ sOpenTagSlash() {
+ if (this.getCode() === GREATER) {
+ this.openSelfClosingTag();
+ }
+ else {
+ this.fail("forward-slash in opening tag not followed by >.");
+ this.state = S_ATTRIB;
+ }
+ }
+ sAttrib() {
+ const c = this.skipSpaces();
+ if (c === EOC) {
+ return;
+ }
+ if (isNameStartChar(c)) {
+ this.unget();
+ this.state = S_ATTRIB_NAME;
+ }
+ else if (c === GREATER) {
+ this.openTag();
+ }
+ else if (c === FORWARD_SLASH) {
+ this.state = S_OPEN_TAG_SLASH;
+ }
+ else {
+ this.fail("disallowed character in attribute name.");
+ }
+ }
+ sAttribName() {
+ const c = this.captureNameChars();
+ if (c === EQUAL) {
+ this.state = S_ATTRIB_VALUE;
+ }
+ else if (isS(c)) {
+ this.state = S_ATTRIB_NAME_SAW_WHITE;
+ }
+ else if (c === GREATER) {
+ this.fail("attribute without value.");
+ this.pushAttrib(this.name, this.name);
+ this.name = this.text = "";
+ this.openTag();
+ }
+ else if (c !== EOC) {
+ this.fail("disallowed character in attribute name.");
+ }
+ }
+ sAttribNameSawWhite() {
+ const c = this.skipSpaces();
+ switch (c) {
+ case EOC:
+ return;
+ case EQUAL:
+ this.state = S_ATTRIB_VALUE;
+ break;
+ default:
+ this.fail("attribute without value.");
+ // Should we do this???
+ // this.tag.attributes[this.name] = "";
+ this.text = "";
+ this.name = "";
+ if (c === GREATER) {
+ this.openTag();
+ }
+ else if (isNameStartChar(c)) {
+ this.unget();
+ this.state = S_ATTRIB_NAME;
+ }
+ else {
+ this.fail("disallowed character in attribute name.");
+ this.state = S_ATTRIB;
+ }
+ }
+ }
+ sAttribValue() {
+ const c = this.getCodeNorm();
+ if (isQuote(c)) {
+ this.q = c;
+ this.state = S_ATTRIB_VALUE_QUOTED;
+ }
+ else if (!isS(c)) {
+ this.fail("unquoted attribute value.");
+ this.state = S_ATTRIB_VALUE_UNQUOTED;
+ this.unget();
+ }
+ }
+ sAttribValueQuoted() {
+ // We deliberately do not use captureTo here. The specialized code we use
+ // here is faster than using captureTo.
+ const { q, chunk } = this;
+ let { i: start } = this;
+ // eslint-disable-next-line no-constant-condition
+ while (true) {
+ switch (this.getCode()) {
+ case q:
+ this.pushAttrib(this.name, this.text + chunk.slice(start, this.prevI));
+ this.name = this.text = "";
+ this.q = null;
+ this.state = S_ATTRIB_VALUE_CLOSED;
+ return;
+ case AMP:
+ this.text += chunk.slice(start, this.prevI);
+ this.state = S_ENTITY;
+ this.entityReturnState = S_ATTRIB_VALUE_QUOTED;
+ return;
+ case NL:
+ case NL_LIKE:
+ case TAB:
+ this.text += `${chunk.slice(start, this.prevI)} `;
+ start = this.i;
+ break;
+ case LESS:
+ this.text += chunk.slice(start, this.prevI);
+ this.fail("disallowed character.");
+ return;
+ case EOC:
+ this.text += chunk.slice(start);
+ return;
+ default:
+ }
+ }
+ }
+ sAttribValueClosed() {
+ const c = this.getCodeNorm();
+ if (isS(c)) {
+ this.state = S_ATTRIB;
+ }
+ else if (c === GREATER) {
+ this.openTag();
+ }
+ else if (c === FORWARD_SLASH) {
+ this.state = S_OPEN_TAG_SLASH;
+ }
+ else if (isNameStartChar(c)) {
+ this.fail("no whitespace between attributes.");
+ this.unget();
+ this.state = S_ATTRIB_NAME;
+ }
+ else {
+ this.fail("disallowed character in attribute name.");
+ }
+ }
+ sAttribValueUnquoted() {
+ // We don't do anything regarding EOL or space handling for unquoted
+ // attributes. We already have failed by the time we get here, and the
+ // contract that saxes upholds states that upon failure, it is not safe to
+ // rely on the data passed to event handlers (other than
+ // ``onerror``). Passing "bad" data is not a problem.
+ const c = this.captureTo(ATTRIB_VALUE_UNQUOTED_TERMINATOR);
+ switch (c) {
+ case AMP:
+ this.state = S_ENTITY;
+ this.entityReturnState = S_ATTRIB_VALUE_UNQUOTED;
+ break;
+ case LESS:
+ this.fail("disallowed character.");
+ break;
+ case EOC:
+ break;
+ default:
+ if (this.text.includes("]]>")) {
+ this.fail("the string \"]]>\" is disallowed in char data.");
+ }
+ this.pushAttrib(this.name, this.text);
+ this.name = this.text = "";
+ if (c === GREATER) {
+ this.openTag();
+ }
+ else {
+ this.state = S_ATTRIB;
+ }
+ }
+ }
+ sCloseTag() {
+ const c = this.captureNameChars();
+ if (c === GREATER) {
+ this.closeTag();
+ }
+ else if (isS(c)) {
+ this.state = S_CLOSE_TAG_SAW_WHITE;
+ }
+ else if (c !== EOC) {
+ this.fail("disallowed character in closing tag.");
+ }
+ }
+ sCloseTagSawWhite() {
+ switch (this.skipSpaces()) {
+ case GREATER:
+ this.closeTag();
+ break;
+ case EOC:
+ break;
+ default:
+ this.fail("disallowed character in closing tag.");
+ }
+ }
+ // END OF STATE ENGINE METHODS
+ handleTextInRoot() {
+ // This is essentially a specialized version of captureTo which is optimized
+ // for performing the ]]> check. A previous version of this code, checked
+ // ``this.text`` for the presence of ]]>. It simplified the code but was
+ // very costly when character data contained a lot of entities to be parsed.
+ //
+ // Since we are using a specialized loop, we also keep track of the presence
+ // of ]]> in text data. The sequence ]]> is forbidden to appear as-is.
+ //
+ let { i: start, forbiddenState } = this;
+ const { chunk, textHandler: handler } = this;
+ // eslint-disable-next-line no-labels, no-restricted-syntax
+ scanLoop:
+ // eslint-disable-next-line no-constant-condition
+ while (true) {
+ switch (this.getCode()) {
+ case LESS: {
+ this.state = S_OPEN_WAKA;
+ if (handler !== undefined) {
+ const { text } = this;
+ const slice = chunk.slice(start, this.prevI);
+ if (text.length !== 0) {
+ handler(text + slice);
+ this.text = "";
+ }
+ else if (slice.length !== 0) {
+ handler(slice);
+ }
+ }
+ forbiddenState = FORBIDDEN_START;
+ // eslint-disable-next-line no-labels
+ break scanLoop;
+ }
+ case AMP:
+ this.state = S_ENTITY;
+ this.entityReturnState = S_TEXT;
+ if (handler !== undefined) {
+ this.text += chunk.slice(start, this.prevI);
+ }
+ forbiddenState = FORBIDDEN_START;
+ // eslint-disable-next-line no-labels
+ break scanLoop;
+ case CLOSE_BRACKET:
+ switch (forbiddenState) {
+ case FORBIDDEN_START:
+ forbiddenState = FORBIDDEN_BRACKET;
+ break;
+ case FORBIDDEN_BRACKET:
+ forbiddenState = FORBIDDEN_BRACKET_BRACKET;
+ break;
+ case FORBIDDEN_BRACKET_BRACKET:
+ break;
+ default:
+ throw new Error("impossible state");
+ }
+ break;
+ case GREATER:
+ if (forbiddenState === FORBIDDEN_BRACKET_BRACKET) {
+ this.fail("the string \"]]>\" is disallowed in char data.");
+ }
+ forbiddenState = FORBIDDEN_START;
+ break;
+ case NL_LIKE:
+ if (handler !== undefined) {
+ this.text += `${chunk.slice(start, this.prevI)}\n`;
+ }
+ start = this.i;
+ forbiddenState = FORBIDDEN_START;
+ break;
+ case EOC:
+ if (handler !== undefined) {
+ this.text += chunk.slice(start);
+ }
+ // eslint-disable-next-line no-labels
+ break scanLoop;
+ default:
+ forbiddenState = FORBIDDEN_START;
+ }
+ }
+ this.forbiddenState = forbiddenState;
+ }
+ handleTextOutsideRoot() {
+ // This is essentially a specialized version of captureTo which is optimized
+ // for a specialized task. We keep track of the presence of non-space
+ // characters in the text since these are errors when appearing outside the
+ // document root element.
+ let { i: start } = this;
+ const { chunk, textHandler: handler } = this;
+ let nonSpace = false;
+ // eslint-disable-next-line no-labels, no-restricted-syntax
+ outRootLoop:
+ // eslint-disable-next-line no-constant-condition
+ while (true) {
+ const code = this.getCode();
+ switch (code) {
+ case LESS: {
+ this.state = S_OPEN_WAKA;
+ if (handler !== undefined) {
+ const { text } = this;
+ const slice = chunk.slice(start, this.prevI);
+ if (text.length !== 0) {
+ handler(text + slice);
+ this.text = "";
+ }
+ else if (slice.length !== 0) {
+ handler(slice);
+ }
+ }
+ // eslint-disable-next-line no-labels
+ break outRootLoop;
+ }
+ case AMP:
+ this.state = S_ENTITY;
+ this.entityReturnState = S_TEXT;
+ if (handler !== undefined) {
+ this.text += chunk.slice(start, this.prevI);
+ }
+ nonSpace = true;
+ // eslint-disable-next-line no-labels
+ break outRootLoop;
+ case NL_LIKE:
+ if (handler !== undefined) {
+ this.text += `${chunk.slice(start, this.prevI)}\n`;
+ }
+ start = this.i;
+ break;
+ case EOC:
+ if (handler !== undefined) {
+ this.text += chunk.slice(start);
+ }
+ // eslint-disable-next-line no-labels
+ break outRootLoop;
+ default:
+ if (!isS(code)) {
+ nonSpace = true;
+ }
+ }
+ }
+ if (!nonSpace) {
+ return;
+ }
+ // We use the reportedTextBeforeRoot and reportedTextAfterRoot flags
+ // to avoid reporting errors for every single character that is out of
+ // place.
+ if (!this.sawRoot && !this.reportedTextBeforeRoot) {
+ this.fail("text data outside of root node.");
+ this.reportedTextBeforeRoot = true;
+ }
+ if (this.closedRoot && !this.reportedTextAfterRoot) {
+ this.fail("text data outside of root node.");
+ this.reportedTextAfterRoot = true;
+ }
+ }
+ pushAttribNS(name, value) {
+ var _a;
+ const { prefix, local } = this.qname(name);
+ const attr = { name, prefix, local, value };
+ this.attribList.push(attr);
+ // eslint-disable-next-line no-unused-expressions
+ (_a = this.attributeHandler) === null || _a === void 0 ? void 0 : _a.call(this, attr);
+ if (prefix === "xmlns") {
+ const trimmed = value.trim();
+ if (this.currentXMLVersion === "1.0" && trimmed === "") {
+ this.fail("invalid attempt to undefine prefix in XML 1.0");
+ }
+ this.topNS[local] = trimmed;
+ nsPairCheck(this, local, trimmed);
+ }
+ else if (name === "xmlns") {
+ const trimmed = value.trim();
+ this.topNS[""] = trimmed;
+ nsPairCheck(this, "", trimmed);
+ }
+ }
+ pushAttribPlain(name, value) {
+ var _a;
+ const attr = { name, value };
+ this.attribList.push(attr);
+ // eslint-disable-next-line no-unused-expressions
+ (_a = this.attributeHandler) === null || _a === void 0 ? void 0 : _a.call(this, attr);
+ }
+ /**
+ * End parsing. This performs final well-formedness checks and resets the
+ * parser to a clean state.
+ *
+ * @returns this
+ */
+ end() {
+ var _a, _b;
+ if (!this.sawRoot) {
+ this.fail("document must contain a root element.");
+ }
+ const { tags } = this;
+ while (tags.length > 0) {
+ const tag = tags.pop();
+ this.fail(`unclosed tag: ${tag.name}`);
+ }
+ if ((this.state !== S_BEGIN) && (this.state !== S_TEXT)) {
+ this.fail("unexpected end.");
+ }
+ const { text } = this;
+ if (text.length !== 0) {
+ // eslint-disable-next-line no-unused-expressions
+ (_a = this.textHandler) === null || _a === void 0 ? void 0 : _a.call(this, text);
+ this.text = "";
+ }
+ this._closed = true;
+ // eslint-disable-next-line no-unused-expressions
+ (_b = this.endHandler) === null || _b === void 0 ? void 0 : _b.call(this);
+ this._init();
+ return this;
+ }
+ /**
+ * Resolve a namespace prefix.
+ *
+ * @param prefix The prefix to resolve.
+ *
+ * @returns The namespace URI or ``undefined`` if the prefix is not defined.
+ */
+ resolve(prefix) {
+ var _a, _b;
+ let uri = this.topNS[prefix];
+ if (uri !== undefined) {
+ return uri;
+ }
+ const { tags } = this;
+ for (let index = tags.length - 1; index >= 0; index--) {
+ uri = tags[index].ns[prefix];
+ if (uri !== undefined) {
+ return uri;
+ }
+ }
+ uri = this.ns[prefix];
+ if (uri !== undefined) {
+ return uri;
+ }
+ return (_b = (_a = this.opt).resolvePrefix) === null || _b === void 0 ? void 0 : _b.call(_a, prefix);
+ }
+ /**
+ * Parse a qname into its prefix and local name parts.
+ *
+ * @param name The name to parse
+ *
+ * @returns
+ */
+ qname(name) {
+ // This is faster than using name.split(":").
+ const colon = name.indexOf(":");
+ if (colon === -1) {
+ return { prefix: "", local: name };
+ }
+ const local = name.slice(colon + 1);
+ const prefix = name.slice(0, colon);
+ if (prefix === "" || local === "" || local.includes(":")) {
+ this.fail(`malformed name: ${name}.`);
+ }
+ return { prefix, local };
+ }
+ processAttribsNS() {
+ var _a;
+ const { attribList } = this;
+ const tag = this.tag;
+ {
+ // add namespace info to tag
+ const { prefix, local } = this.qname(tag.name);
+ tag.prefix = prefix;
+ tag.local = local;
+ const uri = tag.uri = (_a = this.resolve(prefix)) !== null && _a !== void 0 ? _a : "";
+ if (prefix !== "") {
+ if (prefix === "xmlns") {
+ this.fail("tags may not have \"xmlns\" as prefix.");
+ }
+ if (uri === "") {
+ this.fail(`unbound namespace prefix: ${JSON.stringify(prefix)}.`);
+ tag.uri = prefix;
+ }
+ }
+ }
+ if (attribList.length === 0) {
+ return;
+ }
+ const { attributes } = tag;
+ const seen = new Set();
+ // Note: do not apply default ns to attributes:
+ // http://www.w3.org/TR/REC-xml-names/#defaulting
+ for (const attr of attribList) {
+ const { name, prefix, local } = attr;
+ let uri;
+ let eqname;
+ if (prefix === "") {
+ uri = name === "xmlns" ? XMLNS_NAMESPACE : "";
+ eqname = name;
+ }
+ else {
+ uri = this.resolve(prefix);
+ // if there's any attributes with an undefined namespace,
+ // then fail on them now.
+ if (uri === undefined) {
+ this.fail(`unbound namespace prefix: ${JSON.stringify(prefix)}.`);
+ uri = prefix;
+ }
+ eqname = `{${uri}}${local}`;
+ }
+ if (seen.has(eqname)) {
+ this.fail(`duplicate attribute: ${eqname}.`);
+ }
+ seen.add(eqname);
+ attr.uri = uri;
+ attributes[name] = attr;
+ }
+ this.attribList = [];
+ }
+ processAttribsPlain() {
+ const { attribList } = this;
+ // eslint-disable-next-line prefer-destructuring
+ const attributes = this.tag.attributes;
+ for (const { name, value } of attribList) {
+ if (attributes[name] !== undefined) {
+ this.fail(`duplicate attribute: ${name}.`);
+ }
+ attributes[name] = value;
+ }
+ this.attribList = [];
+ }
+ /**
+ * Handle a complete open tag. This parser code calls this once it has seen
+ * the whole tag. This method checks for well-formeness and then emits
+ * ``onopentag``.
+ */
+ openTag() {
+ var _a;
+ this.processAttribs();
+ const { tags } = this;
+ const tag = this.tag;
+ tag.isSelfClosing = false;
+ // There cannot be any pending text here due to the onopentagstart that was
+ // necessarily emitted before we get here. So we do not check text.
+ // eslint-disable-next-line no-unused-expressions
+ (_a = this.openTagHandler) === null || _a === void 0 ? void 0 : _a.call(this, tag);
+ tags.push(tag);
+ this.state = S_TEXT;
+ this.name = "";
+ }
+ /**
+ * Handle a complete self-closing tag. This parser code calls this once it has
+ * seen the whole tag. This method checks for well-formeness and then emits
+ * ``onopentag`` and ``onclosetag``.
+ */
+ openSelfClosingTag() {
+ var _a, _b, _c;
+ this.processAttribs();
+ const { tags } = this;
+ const tag = this.tag;
+ tag.isSelfClosing = true;
+ // There cannot be any pending text here due to the onopentagstart that was
+ // necessarily emitted before we get here. So we do not check text.
+ // eslint-disable-next-line no-unused-expressions
+ (_a = this.openTagHandler) === null || _a === void 0 ? void 0 : _a.call(this, tag);
+ // eslint-disable-next-line no-unused-expressions
+ (_b = this.closeTagHandler) === null || _b === void 0 ? void 0 : _b.call(this, tag);
+ const top = this.tag = (_c = tags[tags.length - 1]) !== null && _c !== void 0 ? _c : null;
+ if (top === null) {
+ this.closedRoot = true;
+ }
+ this.state = S_TEXT;
+ this.name = "";
+ }
+ /**
+ * Handle a complete close tag. This parser code calls this once it has seen
+ * the whole tag. This method checks for well-formeness and then emits
+ * ``onclosetag``.
+ */
+ closeTag() {
+ const { tags, name } = this;
+ // Our state after this will be S_TEXT, no matter what, and we can clear
+ // tagName now.
+ this.state = S_TEXT;
+ this.name = "";
+ if (name === "") {
+ this.fail("weird empty close tag.");
+ this.text += "</>";
+ return;
+ }
+ const handler = this.closeTagHandler;
+ let l = tags.length;
+ while (l-- > 0) {
+ const tag = this.tag = tags.pop();
+ this.topNS = tag.ns;
+ // eslint-disable-next-line no-unused-expressions
+ handler === null || handler === void 0 ? void 0 : handler(tag);
+ if (tag.name === name) {
+ break;
+ }
+ this.fail("unexpected close tag.");
+ }
+ if (l === 0) {
+ this.closedRoot = true;
+ }
+ else if (l < 0) {
+ this.fail(`unmatched closing tag: ${name}.`);
+ this.text += `</${name}>`;
+ }
+ }
+ /**
+ * Resolves an entity. Makes any necessary well-formedness checks.
+ *
+ * @param entity The entity to resolve.
+ *
+ * @returns The parsed entity.
+ */
+ parseEntity(entity) {
+ // startsWith would be significantly slower for this test.
+ // eslint-disable-next-line @typescript-eslint/prefer-string-starts-ends-with
+ if (entity[0] !== "#") {
+ const defined = this.ENTITIES[entity];
+ if (defined !== undefined) {
+ return defined;
+ }
+ this.fail(this.isName(entity) ? "undefined entity." :
+ "disallowed character in entity name.");
+ return `&${entity};`;
+ }
+ let num = NaN;
+ if (entity[1] === "x" && /^#x[0-9a-f]+$/i.test(entity)) {
+ num = parseInt(entity.slice(2), 16);
+ }
+ else if (/^#[0-9]+$/.test(entity)) {
+ num = parseInt(entity.slice(1), 10);
+ }
+ // The character reference is required to match the CHAR production.
+ if (!this.isChar(num)) {
+ this.fail("malformed character entity.");
+ return `&${entity};`;
+ }
+ return String.fromCodePoint(num);
+ }
+}
+exports.SaxesParser = SaxesParser;
+//# sourceMappingURL=saxes.js.map \ No newline at end of file
diff --git a/school/node_modules/saxes/saxes.js.map b/school/node_modules/saxes/saxes.js.map
new file mode 100644
index 0000000..deb2820
--- /dev/null
+++ b/school/node_modules/saxes/saxes.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"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