@pokash/n8n-nodes-ksef 0.2.12 → 0.2.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node_modules/@oozcitak/dom/LICENSE +21 -0
- package/node_modules/@oozcitak/dom/README.md +32 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/AbortAlgorithm.d.ts +21 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/AbortAlgorithm.js +79 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/AbortAlgorithm.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/AttrAlgorithm.d.ts +8 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/AttrAlgorithm.js +23 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/AttrAlgorithm.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/BoundaryPointAlgorithm.d.ts +8 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/BoundaryPointAlgorithm.js +76 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/BoundaryPointAlgorithm.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/CharacterDataAlgorithm.d.ts +19 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/CharacterDataAlgorithm.js +140 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/CharacterDataAlgorithm.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/CreateAlgorithm.d.ts +192 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/CreateAlgorithm.js +303 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/CreateAlgorithm.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/CustomElementAlgorithm.d.ts +61 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/CustomElementAlgorithm.js +108 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/CustomElementAlgorithm.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/DOMAlgorithm.d.ts +72 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/DOMAlgorithm.js +288 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/DOMAlgorithm.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/DOMTokenListAlgorithm.d.ts +21 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/DOMTokenListAlgorithm.js +61 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/DOMTokenListAlgorithm.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/DocumentAlgorithm.d.ts +29 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/DocumentAlgorithm.js +161 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/DocumentAlgorithm.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/ElementAlgorithm.d.ts +121 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/ElementAlgorithm.js +608 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/ElementAlgorithm.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/EventAlgorithm.d.ts +146 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/EventAlgorithm.js +995 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/EventAlgorithm.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/EventTargetAlgorithm.d.ts +33 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/EventTargetAlgorithm.js +142 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/EventTargetAlgorithm.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/MutationAlgorithm.d.ts +66 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/MutationAlgorithm.js +1173 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/MutationAlgorithm.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/MutationObserverAlgorithm.d.ts +43 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/MutationObserverAlgorithm.js +276 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/MutationObserverAlgorithm.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/NamespaceAlgorithm.d.ts +25 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/NamespaceAlgorithm.js +85 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/NamespaceAlgorithm.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/NodeAlgorithm.d.ts +68 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/NodeAlgorithm.js +543 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/NodeAlgorithm.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/NodeIteratorAlgorithm.d.ts +15 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/NodeIteratorAlgorithm.js +105 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/NodeIteratorAlgorithm.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/OrderedSetAlgorithm.d.ts +27 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/OrderedSetAlgorithm.js +125 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/OrderedSetAlgorithm.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/ParentNodeAlgorithm.d.ts +9 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/ParentNodeAlgorithm.js +69 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/ParentNodeAlgorithm.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/RangeAlgorithm.d.ts +82 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/RangeAlgorithm.js +829 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/RangeAlgorithm.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/SelectorsAlgorithm.d.ts +8 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/SelectorsAlgorithm.js +21 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/SelectorsAlgorithm.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/ShadowTreeAlgorithm.d.ts +57 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/ShadowTreeAlgorithm.js +316 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/ShadowTreeAlgorithm.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/TextAlgorithm.d.ts +30 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/TextAlgorithm.js +226 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/TextAlgorithm.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/TraversalAlgorithm.d.ts +8 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/TraversalAlgorithm.js +62 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/TraversalAlgorithm.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/TreeAlgorithm.d.ts +268 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/TreeAlgorithm.js +853 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/TreeAlgorithm.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/TreeWalkerAlgorithm.d.ts +17 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/TreeWalkerAlgorithm.js +147 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/TreeWalkerAlgorithm.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/WebIDLAlgorithm.d.ts +8 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/WebIDLAlgorithm.js +14 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/WebIDLAlgorithm.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/XMLAlgorithm.d.ts +25 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/XMLAlgorithm.js +164 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/XMLAlgorithm.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/index.d.ts +28 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/index.js +34 -0
- package/node_modules/@oozcitak/dom/lib/algorithm/index.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/dom/AbortControllerImpl.d.ts +15 -0
- package/node_modules/@oozcitak/dom/lib/dom/AbortControllerImpl.js +32 -0
- package/node_modules/@oozcitak/dom/lib/dom/AbortControllerImpl.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/dom/AbortSignalImpl.d.ts +23 -0
- package/node_modules/@oozcitak/dom/lib/dom/AbortSignalImpl.js +59 -0
- package/node_modules/@oozcitak/dom/lib/dom/AbortSignalImpl.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/dom/AbstractRangeImpl.d.ts +23 -0
- package/node_modules/@oozcitak/dom/lib/dom/AbstractRangeImpl.js +70 -0
- package/node_modules/@oozcitak/dom/lib/dom/AbstractRangeImpl.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/dom/AttrImpl.d.ts +45 -0
- package/node_modules/@oozcitak/dom/lib/dom/AttrImpl.js +118 -0
- package/node_modules/@oozcitak/dom/lib/dom/AttrImpl.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/dom/CDATASectionImpl.d.ts +21 -0
- package/node_modules/@oozcitak/dom/lib/dom/CDATASectionImpl.js +51 -0
- package/node_modules/@oozcitak/dom/lib/dom/CDATASectionImpl.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/dom/CharacterDataImpl.d.ts +35 -0
- package/node_modules/@oozcitak/dom/lib/dom/CharacterDataImpl.js +132 -0
- package/node_modules/@oozcitak/dom/lib/dom/CharacterDataImpl.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/dom/ChildNodeImpl.d.ts +16 -0
- package/node_modules/@oozcitak/dom/lib/dom/ChildNodeImpl.js +165 -0
- package/node_modules/@oozcitak/dom/lib/dom/ChildNodeImpl.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/dom/CommentImpl.d.ts +21 -0
- package/node_modules/@oozcitak/dom/lib/dom/CommentImpl.js +52 -0
- package/node_modules/@oozcitak/dom/lib/dom/CommentImpl.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/dom/CustomEventImpl.d.ts +16 -0
- package/node_modules/@oozcitak/dom/lib/dom/CustomEventImpl.js +60 -0
- package/node_modules/@oozcitak/dom/lib/dom/CustomEventImpl.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/dom/DOMException.d.ts +171 -0
- package/node_modules/@oozcitak/dom/lib/dom/DOMException.js +347 -0
- package/node_modules/@oozcitak/dom/lib/dom/DOMException.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/dom/DOMImpl.d.ts +48 -0
- package/node_modules/@oozcitak/dom/lib/dom/DOMImpl.js +100 -0
- package/node_modules/@oozcitak/dom/lib/dom/DOMImpl.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/dom/DOMImplementationImpl.d.ts +29 -0
- package/node_modules/@oozcitak/dom/lib/dom/DOMImplementationImpl.js +149 -0
- package/node_modules/@oozcitak/dom/lib/dom/DOMImplementationImpl.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/dom/DOMTokenListImpl.d.ts +46 -0
- package/node_modules/@oozcitak/dom/lib/dom/DOMTokenListImpl.js +312 -0
- package/node_modules/@oozcitak/dom/lib/dom/DOMTokenListImpl.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/dom/DocumentFragmentImpl.d.ts +32 -0
- package/node_modules/@oozcitak/dom/lib/dom/DocumentFragmentImpl.js +103 -0
- package/node_modules/@oozcitak/dom/lib/dom/DocumentFragmentImpl.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/dom/DocumentImpl.d.ts +116 -0
- package/node_modules/@oozcitak/dom/lib/dom/DocumentImpl.js +545 -0
- package/node_modules/@oozcitak/dom/lib/dom/DocumentImpl.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/dom/DocumentOrShadowRootImpl.d.ts +11 -0
- package/node_modules/@oozcitak/dom/lib/dom/DocumentOrShadowRootImpl.js +17 -0
- package/node_modules/@oozcitak/dom/lib/dom/DocumentOrShadowRootImpl.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/dom/DocumentTypeImpl.d.ts +39 -0
- package/node_modules/@oozcitak/dom/lib/dom/DocumentTypeImpl.js +109 -0
- package/node_modules/@oozcitak/dom/lib/dom/DocumentTypeImpl.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/dom/ElementImpl.d.ts +132 -0
- package/node_modules/@oozcitak/dom/lib/dom/ElementImpl.js +714 -0
- package/node_modules/@oozcitak/dom/lib/dom/ElementImpl.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/dom/EventImpl.d.ts +74 -0
- package/node_modules/@oozcitak/dom/lib/dom/EventImpl.js +313 -0
- package/node_modules/@oozcitak/dom/lib/dom/EventImpl.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/dom/EventTargetImpl.d.ts +30 -0
- package/node_modules/@oozcitak/dom/lib/dom/EventTargetImpl.js +133 -0
- package/node_modules/@oozcitak/dom/lib/dom/EventTargetImpl.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/dom/HTMLCollectionImpl.d.ts +44 -0
- package/node_modules/@oozcitak/dom/lib/dom/HTMLCollectionImpl.js +157 -0
- package/node_modules/@oozcitak/dom/lib/dom/HTMLCollectionImpl.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/dom/MutationObserverImpl.d.ts +22 -0
- package/node_modules/@oozcitak/dom/lib/dom/MutationObserverImpl.js +184 -0
- package/node_modules/@oozcitak/dom/lib/dom/MutationObserverImpl.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/dom/MutationRecordImpl.d.ts +73 -0
- package/node_modules/@oozcitak/dom/lib/dom/MutationRecordImpl.js +116 -0
- package/node_modules/@oozcitak/dom/lib/dom/MutationRecordImpl.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/dom/NamedNodeMapImpl.d.ts +34 -0
- package/node_modules/@oozcitak/dom/lib/dom/NamedNodeMapImpl.js +112 -0
- package/node_modules/@oozcitak/dom/lib/dom/NamedNodeMapImpl.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/dom/NodeFilterImpl.d.ts +50 -0
- package/node_modules/@oozcitak/dom/lib/dom/NodeFilterImpl.js +64 -0
- package/node_modules/@oozcitak/dom/lib/dom/NodeFilterImpl.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/dom/NodeImpl.d.ts +252 -0
- package/node_modules/@oozcitak/dom/lib/dom/NodeImpl.js +891 -0
- package/node_modules/@oozcitak/dom/lib/dom/NodeImpl.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/dom/NodeIteratorImpl.d.ts +34 -0
- package/node_modules/@oozcitak/dom/lib/dom/NodeIteratorImpl.js +86 -0
- package/node_modules/@oozcitak/dom/lib/dom/NodeIteratorImpl.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/dom/NodeListImpl.d.ts +46 -0
- package/node_modules/@oozcitak/dom/lib/dom/NodeListImpl.js +198 -0
- package/node_modules/@oozcitak/dom/lib/dom/NodeListImpl.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/dom/NodeListStaticImpl.d.ts +49 -0
- package/node_modules/@oozcitak/dom/lib/dom/NodeListStaticImpl.js +188 -0
- package/node_modules/@oozcitak/dom/lib/dom/NodeListStaticImpl.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/dom/NonDocumentTypeChildNodeImpl.d.ts +12 -0
- package/node_modules/@oozcitak/dom/lib/dom/NonDocumentTypeChildNodeImpl.js +53 -0
- package/node_modules/@oozcitak/dom/lib/dom/NonDocumentTypeChildNodeImpl.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/dom/NonElementParentNodeImpl.d.ts +9 -0
- package/node_modules/@oozcitak/dom/lib/dom/NonElementParentNodeImpl.js +31 -0
- package/node_modules/@oozcitak/dom/lib/dom/NonElementParentNodeImpl.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/dom/ParentNodeImpl.d.ts +24 -0
- package/node_modules/@oozcitak/dom/lib/dom/ParentNodeImpl.js +158 -0
- package/node_modules/@oozcitak/dom/lib/dom/ParentNodeImpl.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/dom/ProcessingInstructionImpl.d.ts +25 -0
- package/node_modules/@oozcitak/dom/lib/dom/ProcessingInstructionImpl.js +59 -0
- package/node_modules/@oozcitak/dom/lib/dom/ProcessingInstructionImpl.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/dom/RangeImpl.d.ts +71 -0
- package/node_modules/@oozcitak/dom/lib/dom/RangeImpl.js +649 -0
- package/node_modules/@oozcitak/dom/lib/dom/RangeImpl.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/dom/ShadowRootImpl.d.ts +33 -0
- package/node_modules/@oozcitak/dom/lib/dom/ShadowRootImpl.js +82 -0
- package/node_modules/@oozcitak/dom/lib/dom/ShadowRootImpl.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/dom/SlotableImpl.d.ts +16 -0
- package/node_modules/@oozcitak/dom/lib/dom/SlotableImpl.js +35 -0
- package/node_modules/@oozcitak/dom/lib/dom/SlotableImpl.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/dom/StaticRangeImpl.d.ts +13 -0
- package/node_modules/@oozcitak/dom/lib/dom/StaticRangeImpl.js +48 -0
- package/node_modules/@oozcitak/dom/lib/dom/StaticRangeImpl.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/dom/TextImpl.d.ts +28 -0
- package/node_modules/@oozcitak/dom/lib/dom/TextImpl.js +109 -0
- package/node_modules/@oozcitak/dom/lib/dom/TextImpl.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/dom/TraverserImpl.d.ts +23 -0
- package/node_modules/@oozcitak/dom/lib/dom/TraverserImpl.js +41 -0
- package/node_modules/@oozcitak/dom/lib/dom/TraverserImpl.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/dom/TreeWalkerImpl.d.ts +36 -0
- package/node_modules/@oozcitak/dom/lib/dom/TreeWalkerImpl.js +249 -0
- package/node_modules/@oozcitak/dom/lib/dom/TreeWalkerImpl.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/dom/WindowImpl.d.ts +26 -0
- package/node_modules/@oozcitak/dom/lib/dom/WindowImpl.js +57 -0
- package/node_modules/@oozcitak/dom/lib/dom/WindowImpl.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/dom/XMLDocumentImpl.d.ts +11 -0
- package/node_modules/@oozcitak/dom/lib/dom/XMLDocumentImpl.js +31 -0
- package/node_modules/@oozcitak/dom/lib/dom/XMLDocumentImpl.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/dom/index.d.ts +36 -0
- package/node_modules/@oozcitak/dom/lib/dom/index.js +102 -0
- package/node_modules/@oozcitak/dom/lib/dom/index.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/dom/interfaces.d.ts +2218 -0
- package/node_modules/@oozcitak/dom/lib/dom/interfaces.js +91 -0
- package/node_modules/@oozcitak/dom/lib/dom/interfaces.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/index.d.ts +3 -0
- package/node_modules/@oozcitak/dom/lib/index.js +11 -0
- package/node_modules/@oozcitak/dom/lib/index.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/parser/DOMParserImpl.d.ts +11 -0
- package/node_modules/@oozcitak/dom/lib/parser/DOMParserImpl.js +37 -0
- package/node_modules/@oozcitak/dom/lib/parser/DOMParserImpl.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/parser/XMLParserImpl.d.ts +26 -0
- package/node_modules/@oozcitak/dom/lib/parser/XMLParserImpl.js +240 -0
- package/node_modules/@oozcitak/dom/lib/parser/XMLParserImpl.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/parser/XMLStringLexer.d.ts +159 -0
- package/node_modules/@oozcitak/dom/lib/parser/XMLStringLexer.js +512 -0
- package/node_modules/@oozcitak/dom/lib/parser/XMLStringLexer.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/parser/index.d.ts +1 -0
- package/node_modules/@oozcitak/dom/lib/parser/index.js +6 -0
- package/node_modules/@oozcitak/dom/lib/parser/index.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/parser/interfaces.d.ts +131 -0
- package/node_modules/@oozcitak/dom/lib/parser/interfaces.js +18 -0
- package/node_modules/@oozcitak/dom/lib/parser/interfaces.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/serializer/LocalNameSet.d.ts +27 -0
- package/node_modules/@oozcitak/dom/lib/serializer/LocalNameSet.js +56 -0
- package/node_modules/@oozcitak/dom/lib/serializer/LocalNameSet.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/serializer/NamespacePrefixMap.d.ts +52 -0
- package/node_modules/@oozcitak/dom/lib/serializer/NamespacePrefixMap.js +151 -0
- package/node_modules/@oozcitak/dom/lib/serializer/NamespacePrefixMap.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/serializer/XMLSerializerImpl.d.ts +166 -0
- package/node_modules/@oozcitak/dom/lib/serializer/XMLSerializerImpl.js +1479 -0
- package/node_modules/@oozcitak/dom/lib/serializer/XMLSerializerImpl.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/serializer/index.d.ts +1 -0
- package/node_modules/@oozcitak/dom/lib/serializer/index.js +6 -0
- package/node_modules/@oozcitak/dom/lib/serializer/index.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/serializer/interfaces.d.ts +15 -0
- package/node_modules/@oozcitak/dom/lib/serializer/interfaces.js +3 -0
- package/node_modules/@oozcitak/dom/lib/serializer/interfaces.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/util/Cast.d.ts +12 -0
- package/node_modules/@oozcitak/dom/lib/util/Cast.js +26 -0
- package/node_modules/@oozcitak/dom/lib/util/Cast.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/util/EmptySet.d.ts +13 -0
- package/node_modules/@oozcitak/dom/lib/util/EmptySet.js +61 -0
- package/node_modules/@oozcitak/dom/lib/util/EmptySet.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/util/Guard.d.ts +135 -0
- package/node_modules/@oozcitak/dom/lib/util/Guard.js +192 -0
- package/node_modules/@oozcitak/dom/lib/util/Guard.js.map +1 -0
- package/node_modules/@oozcitak/dom/lib/util/index.d.ts +3 -0
- package/node_modules/@oozcitak/dom/lib/util/index.js +9 -0
- package/node_modules/@oozcitak/dom/lib/util/index.js.map +1 -0
- package/node_modules/@oozcitak/dom/package.json +72 -0
- package/node_modules/@oozcitak/infra/LICENSE +21 -0
- package/node_modules/@oozcitak/infra/README.md +13 -0
- package/node_modules/@oozcitak/infra/lib/Base64.d.ts +12 -0
- package/node_modules/@oozcitak/infra/lib/Base64.js +82 -0
- package/node_modules/@oozcitak/infra/lib/Base64.js.map +1 -0
- package/node_modules/@oozcitak/infra/lib/Byte.d.ts +6 -0
- package/node_modules/@oozcitak/infra/lib/Byte.js +15 -0
- package/node_modules/@oozcitak/infra/lib/Byte.js.map +1 -0
- package/node_modules/@oozcitak/infra/lib/ByteSequence.d.ts +45 -0
- package/node_modules/@oozcitak/infra/lib/ByteSequence.js +171 -0
- package/node_modules/@oozcitak/infra/lib/ByteSequence.js.map +1 -0
- package/node_modules/@oozcitak/infra/lib/CodePoints.d.ts +82 -0
- package/node_modules/@oozcitak/infra/lib/CodePoints.js +85 -0
- package/node_modules/@oozcitak/infra/lib/CodePoints.js.map +1 -0
- package/node_modules/@oozcitak/infra/lib/JSON.d.ts +24 -0
- package/node_modules/@oozcitak/infra/lib/JSON.js +123 -0
- package/node_modules/@oozcitak/infra/lib/JSON.js.map +1 -0
- package/node_modules/@oozcitak/infra/lib/List.d.ts +101 -0
- package/node_modules/@oozcitak/infra/lib/List.js +325 -0
- package/node_modules/@oozcitak/infra/lib/List.js.map +1 -0
- package/node_modules/@oozcitak/infra/lib/Map.d.ts +87 -0
- package/node_modules/@oozcitak/infra/lib/Map.js +308 -0
- package/node_modules/@oozcitak/infra/lib/Map.js.map +1 -0
- package/node_modules/@oozcitak/infra/lib/Namespace.d.ts +6 -0
- package/node_modules/@oozcitak/infra/lib/Namespace.js +9 -0
- package/node_modules/@oozcitak/infra/lib/Namespace.js.map +1 -0
- package/node_modules/@oozcitak/infra/lib/Queue.d.ts +13 -0
- package/node_modules/@oozcitak/infra/lib/Queue.js +22 -0
- package/node_modules/@oozcitak/infra/lib/Queue.js.map +1 -0
- package/node_modules/@oozcitak/infra/lib/Set.d.ts +136 -0
- package/node_modules/@oozcitak/infra/lib/Set.js +467 -0
- package/node_modules/@oozcitak/infra/lib/Set.js.map +1 -0
- package/node_modules/@oozcitak/infra/lib/Stack.d.ts +13 -0
- package/node_modules/@oozcitak/infra/lib/Stack.js +22 -0
- package/node_modules/@oozcitak/infra/lib/Stack.js.map +1 -0
- package/node_modules/@oozcitak/infra/lib/String.d.ts +129 -0
- package/node_modules/@oozcitak/infra/lib/String.js +472 -0
- package/node_modules/@oozcitak/infra/lib/String.js.map +1 -0
- package/node_modules/@oozcitak/infra/lib/index.d.ts +13 -0
- package/node_modules/@oozcitak/infra/lib/index.js +34 -0
- package/node_modules/@oozcitak/infra/lib/index.js.map +1 -0
- package/node_modules/@oozcitak/infra/package.json +54 -0
- package/node_modules/@oozcitak/url/LICENSE +21 -0
- package/node_modules/@oozcitak/url/README.md +27 -0
- package/node_modules/@oozcitak/url/lib/URLAlgorithm.d.ts +267 -0
- package/node_modules/@oozcitak/url/lib/URLAlgorithm.js +2758 -0
- package/node_modules/@oozcitak/url/lib/URLAlgorithm.js.map +1 -0
- package/node_modules/@oozcitak/url/lib/URLImpl.d.ts +53 -0
- package/node_modules/@oozcitak/url/lib/URLImpl.js +377 -0
- package/node_modules/@oozcitak/url/lib/URLImpl.js.map +1 -0
- package/node_modules/@oozcitak/url/lib/URLSearchParamsImpl.d.ts +38 -0
- package/node_modules/@oozcitak/url/lib/URLSearchParamsImpl.js +303 -0
- package/node_modules/@oozcitak/url/lib/URLSearchParamsImpl.js.map +1 -0
- package/node_modules/@oozcitak/url/lib/index.d.ts +2 -0
- package/node_modules/@oozcitak/url/lib/index.js +7 -0
- package/node_modules/@oozcitak/url/lib/index.js.map +1 -0
- package/node_modules/@oozcitak/url/lib/interfaces.d.ts +195 -0
- package/node_modules/@oozcitak/url/lib/interfaces.js +31 -0
- package/node_modules/@oozcitak/url/lib/interfaces.js.map +1 -0
- package/node_modules/@oozcitak/url/package.json +55 -0
- package/node_modules/@oozcitak/util/LICENSE +21 -0
- package/node_modules/@oozcitak/util/README.md +10 -0
- package/node_modules/@oozcitak/util/lib/CompareCache.d.ts +32 -0
- package/node_modules/@oozcitak/util/lib/CompareCache.js +59 -0
- package/node_modules/@oozcitak/util/lib/CompareCache.js.map +1 -0
- package/node_modules/@oozcitak/util/lib/FixedSizeSet.d.ts +64 -0
- package/node_modules/@oozcitak/util/lib/FixedSizeSet.js +174 -0
- package/node_modules/@oozcitak/util/lib/FixedSizeSet.js.map +1 -0
- package/node_modules/@oozcitak/util/lib/Lazy.d.ts +18 -0
- package/node_modules/@oozcitak/util/lib/Lazy.js +34 -0
- package/node_modules/@oozcitak/util/lib/Lazy.js.map +1 -0
- package/node_modules/@oozcitak/util/lib/ObjectCache.d.ts +71 -0
- package/node_modules/@oozcitak/util/lib/ObjectCache.js +181 -0
- package/node_modules/@oozcitak/util/lib/ObjectCache.js.map +1 -0
- package/node_modules/@oozcitak/util/lib/StringWalker.d.ts +49 -0
- package/node_modules/@oozcitak/util/lib/StringWalker.js +105 -0
- package/node_modules/@oozcitak/util/lib/StringWalker.js.map +1 -0
- package/node_modules/@oozcitak/util/lib/index.d.ts +178 -0
- package/node_modules/@oozcitak/util/lib/index.js +439 -0
- package/node_modules/@oozcitak/util/lib/index.js.map +1 -0
- package/node_modules/@oozcitak/util/package.json +50 -0
- package/node_modules/@xmldom/is-dom-node/LICENSE.md +21 -0
- package/node_modules/@xmldom/is-dom-node/README.md +91 -0
- package/node_modules/@xmldom/is-dom-node/dist/index.d.ts +33 -0
- package/node_modules/@xmldom/is-dom-node/dist/index.js +91 -0
- package/node_modules/@xmldom/is-dom-node/dist/index.js.map +1 -0
- package/node_modules/@xmldom/is-dom-node/package.json +69 -0
- package/node_modules/@xmldom/xmldom/CHANGELOG.md +468 -0
- package/node_modules/@xmldom/xmldom/LICENSE +8 -0
- package/node_modules/@xmldom/xmldom/SECURITY.md +50 -0
- package/node_modules/@xmldom/xmldom/index.d.ts +43 -0
- package/node_modules/@xmldom/xmldom/lib/.eslintrc.yml +2 -0
- package/node_modules/@xmldom/xmldom/lib/conventions.js +203 -0
- package/node_modules/@xmldom/xmldom/lib/dom-parser.js +322 -0
- package/node_modules/@xmldom/xmldom/lib/dom.js +1879 -0
- package/node_modules/@xmldom/xmldom/lib/entities.js +2166 -0
- package/node_modules/@xmldom/xmldom/lib/index.js +4 -0
- package/node_modules/@xmldom/xmldom/lib/sax.js +662 -0
- package/node_modules/@xmldom/xmldom/package.json +71 -0
- package/node_modules/@xmldom/xmldom/readme.md +356 -0
- package/node_modules/esprima/ChangeLog +235 -0
- package/node_modules/esprima/LICENSE.BSD +21 -0
- package/node_modules/esprima/README.md +46 -0
- package/node_modules/esprima/bin/esparse.js +139 -0
- package/node_modules/esprima/bin/esvalidate.js +236 -0
- package/node_modules/esprima/dist/esprima.js +6709 -0
- package/node_modules/esprima/package.json +112 -0
- package/node_modules/node-forge/LICENSE +331 -0
- package/node_modules/node-forge/README.md +2071 -0
- package/node_modules/node-forge/dist/forge.all.min.js +2 -0
- package/node_modules/node-forge/dist/forge.all.min.js.map +1 -0
- package/node_modules/node-forge/dist/forge.min.js +2 -0
- package/node_modules/node-forge/dist/forge.min.js.map +1 -0
- package/node_modules/node-forge/dist/prime.worker.min.js +2 -0
- package/node_modules/node-forge/dist/prime.worker.min.js.map +1 -0
- package/node_modules/node-forge/flash/swf/SocketPool.swf +0 -0
- package/node_modules/node-forge/lib/aes.js +1091 -0
- package/node_modules/node-forge/lib/aesCipherSuites.js +282 -0
- package/node_modules/node-forge/lib/asn1-validator.js +91 -0
- package/node_modules/node-forge/lib/asn1.js +1503 -0
- package/node_modules/node-forge/lib/baseN.js +186 -0
- package/node_modules/node-forge/lib/cipher.js +230 -0
- package/node_modules/node-forge/lib/cipherModes.js +999 -0
- package/node_modules/node-forge/lib/des.js +496 -0
- package/node_modules/node-forge/lib/ed25519.js +1072 -0
- package/node_modules/node-forge/lib/forge.js +13 -0
- package/node_modules/node-forge/lib/form.js +149 -0
- package/node_modules/node-forge/lib/hmac.js +146 -0
- package/node_modules/node-forge/lib/http.js +1346 -0
- package/node_modules/node-forge/lib/index.all.js +16 -0
- package/node_modules/node-forge/lib/index.js +33 -0
- package/node_modules/node-forge/lib/jsbn.js +1264 -0
- package/node_modules/node-forge/lib/kem.js +168 -0
- package/node_modules/node-forge/lib/log.js +319 -0
- package/node_modules/node-forge/lib/md.all.js +13 -0
- package/node_modules/node-forge/lib/md.js +11 -0
- package/node_modules/node-forge/lib/md5.js +289 -0
- package/node_modules/node-forge/lib/mgf.js +12 -0
- package/node_modules/node-forge/lib/mgf1.js +57 -0
- package/node_modules/node-forge/lib/oids.js +179 -0
- package/node_modules/node-forge/lib/pbe.js +1023 -0
- package/node_modules/node-forge/lib/pbkdf2.js +211 -0
- package/node_modules/node-forge/lib/pem.js +237 -0
- package/node_modules/node-forge/lib/pkcs1.js +276 -0
- package/node_modules/node-forge/lib/pkcs12.js +1078 -0
- package/node_modules/node-forge/lib/pkcs7.js +1260 -0
- package/node_modules/node-forge/lib/pkcs7asn1.js +410 -0
- package/node_modules/node-forge/lib/pki.js +102 -0
- package/node_modules/node-forge/lib/prime.js +297 -0
- package/node_modules/node-forge/lib/prime.worker.js +168 -0
- package/node_modules/node-forge/lib/prng.js +419 -0
- package/node_modules/node-forge/lib/pss.js +241 -0
- package/node_modules/node-forge/lib/random.js +191 -0
- package/node_modules/node-forge/lib/rc2.js +410 -0
- package/node_modules/node-forge/lib/rsa.js +1949 -0
- package/node_modules/node-forge/lib/sha1.js +319 -0
- package/node_modules/node-forge/lib/sha256.js +327 -0
- package/node_modules/node-forge/lib/sha512.js +561 -0
- package/node_modules/node-forge/lib/socket.js +287 -0
- package/node_modules/node-forge/lib/ssh.js +236 -0
- package/node_modules/node-forge/lib/tls.js +4282 -0
- package/node_modules/node-forge/lib/tlssocket.js +249 -0
- package/node_modules/node-forge/lib/util.js +2652 -0
- package/node_modules/node-forge/lib/x509.js +3242 -0
- package/node_modules/node-forge/lib/xhr.js +738 -0
- package/node_modules/node-forge/package.json +123 -0
- package/node_modules/sprintf-js/.npmignore +1 -0
- package/node_modules/sprintf-js/LICENSE +24 -0
- package/node_modules/sprintf-js/README.md +88 -0
- package/node_modules/sprintf-js/bower.json +14 -0
- package/node_modules/sprintf-js/demo/angular.html +20 -0
- package/node_modules/sprintf-js/dist/angular-sprintf.min.js +4 -0
- package/node_modules/sprintf-js/dist/angular-sprintf.min.js.map +1 -0
- package/node_modules/sprintf-js/dist/angular-sprintf.min.map +1 -0
- package/node_modules/sprintf-js/dist/sprintf.min.js +4 -0
- package/node_modules/sprintf-js/dist/sprintf.min.js.map +1 -0
- package/node_modules/sprintf-js/dist/sprintf.min.map +1 -0
- package/node_modules/sprintf-js/gruntfile.js +36 -0
- package/node_modules/sprintf-js/package.json +22 -0
- package/node_modules/sprintf-js/src/angular-sprintf.js +18 -0
- package/node_modules/sprintf-js/src/sprintf.js +208 -0
- package/node_modules/sprintf-js/test/test.js +82 -0
- package/node_modules/xml-crypto/LICENSE +22 -0
- package/node_modules/xml-crypto/README.md +557 -0
- package/node_modules/xml-crypto/lib/c14n-canonicalization.d.ts +39 -0
- package/node_modules/xml-crypto/lib/c14n-canonicalization.js +230 -0
- package/node_modules/xml-crypto/lib/c14n-canonicalization.js.map +1 -0
- package/node_modules/xml-crypto/lib/enveloped-signature.d.ts +7 -0
- package/node_modules/xml-crypto/lib/enveloped-signature.js +43 -0
- package/node_modules/xml-crypto/lib/enveloped-signature.js.map +1 -0
- package/node_modules/xml-crypto/lib/exclusive-canonicalization.d.ts +38 -0
- package/node_modules/xml-crypto/lib/exclusive-canonicalization.js +246 -0
- package/node_modules/xml-crypto/lib/exclusive-canonicalization.js.map +1 -0
- package/node_modules/xml-crypto/lib/hash-algorithms.d.ts +13 -0
- package/node_modules/xml-crypto/lib/hash-algorithms.js +47 -0
- package/node_modules/xml-crypto/lib/hash-algorithms.js.map +1 -0
- package/node_modules/xml-crypto/lib/index.d.ts +5 -0
- package/node_modules/xml-crypto/lib/index.js +28 -0
- package/node_modules/xml-crypto/lib/index.js.map +1 -0
- package/node_modules/xml-crypto/lib/signature-algorithms.d.ts +47 -0
- package/node_modules/xml-crypto/lib/signature-algorithms.js +86 -0
- package/node_modules/xml-crypto/lib/signature-algorithms.js.map +1 -0
- package/node_modules/xml-crypto/lib/signed-xml.d.ts +225 -0
- package/node_modules/xml-crypto/lib/signed-xml.js +960 -0
- package/node_modules/xml-crypto/lib/signed-xml.js.map +1 -0
- package/node_modules/xml-crypto/lib/types.d.ts +125 -0
- package/node_modules/xml-crypto/lib/types.js +57 -0
- package/node_modules/xml-crypto/lib/types.js.map +1 -0
- package/node_modules/xml-crypto/lib/utils.d.ts +65 -0
- package/node_modules/xml-crypto/lib/utils.js +256 -0
- package/node_modules/xml-crypto/lib/utils.js.map +1 -0
- package/node_modules/xml-crypto/node_modules/xpath/LICENSE +22 -0
- package/node_modules/xml-crypto/node_modules/xpath/README.md +133 -0
- package/node_modules/xml-crypto/node_modules/xpath/docs/XPathEvaluator.md +62 -0
- package/node_modules/xml-crypto/node_modules/xpath/docs/XPathResult.md +47 -0
- package/node_modules/xml-crypto/node_modules/xpath/docs/function resolvers.md +88 -0
- package/node_modules/xml-crypto/node_modules/xpath/docs/namespace resolvers.md +69 -0
- package/node_modules/xml-crypto/node_modules/xpath/docs/parsed expressions.md +21 -0
- package/node_modules/xml-crypto/node_modules/xpath/docs/variable resolvers.md +89 -0
- package/node_modules/xml-crypto/node_modules/xpath/docs/xpath methods.md +39 -0
- package/node_modules/xml-crypto/node_modules/xpath/package.json +39 -0
- package/node_modules/xml-crypto/node_modules/xpath/test.js +1186 -0
- package/node_modules/xml-crypto/node_modules/xpath/xpath.d.ts +51 -0
- package/node_modules/xml-crypto/node_modules/xpath/xpath.js +4938 -0
- package/node_modules/xml-crypto/package.json +73 -0
- package/node_modules/xmlbuilder2/CHANGELOG.md +309 -0
- package/node_modules/xmlbuilder2/LICENSE +21 -0
- package/node_modules/xmlbuilder2/README.md +183 -0
- package/node_modules/xmlbuilder2/lib/builder/BuilderFunctions.d.ts +236 -0
- package/node_modules/xmlbuilder2/lib/builder/BuilderFunctions.js +108 -0
- package/node_modules/xmlbuilder2/lib/builder/BuilderFunctions.js.map +1 -0
- package/node_modules/xmlbuilder2/lib/builder/BuilderFunctionsCB.d.ts +17 -0
- package/node_modules/xmlbuilder2/lib/builder/BuilderFunctionsCB.js +26 -0
- package/node_modules/xmlbuilder2/lib/builder/BuilderFunctionsCB.js.map +1 -0
- package/node_modules/xmlbuilder2/lib/builder/XMLBuilderCBImpl.d.ts +124 -0
- package/node_modules/xmlbuilder2/lib/builder/XMLBuilderCBImpl.js +782 -0
- package/node_modules/xmlbuilder2/lib/builder/XMLBuilderCBImpl.js.map +1 -0
- package/node_modules/xmlbuilder2/lib/builder/XMLBuilderImpl.d.ts +143 -0
- package/node_modules/xmlbuilder2/lib/builder/XMLBuilderImpl.js +841 -0
- package/node_modules/xmlbuilder2/lib/builder/XMLBuilderImpl.js.map +1 -0
- package/node_modules/xmlbuilder2/lib/builder/dom.d.ts +8 -0
- package/node_modules/xmlbuilder2/lib/builder/dom.js +67 -0
- package/node_modules/xmlbuilder2/lib/builder/dom.js.map +1 -0
- package/node_modules/xmlbuilder2/lib/builder/index.d.ts +4 -0
- package/node_modules/xmlbuilder2/lib/builder/index.js +15 -0
- package/node_modules/xmlbuilder2/lib/builder/index.js.map +1 -0
- package/node_modules/xmlbuilder2/lib/constants.d.ts +1 -0
- package/node_modules/xmlbuilder2/lib/constants.js +4 -0
- package/node_modules/xmlbuilder2/lib/constants.js.map +1 -0
- package/node_modules/xmlbuilder2/lib/index.d.ts +1 -0
- package/node_modules/xmlbuilder2/lib/index.js +10 -0
- package/node_modules/xmlbuilder2/lib/index.js.map +1 -0
- package/node_modules/xmlbuilder2/lib/interfaces.d.ts +1355 -0
- package/node_modules/xmlbuilder2/lib/interfaces.js +76 -0
- package/node_modules/xmlbuilder2/lib/interfaces.js.map +1 -0
- package/node_modules/xmlbuilder2/lib/readers/BaseReader.d.ts +109 -0
- package/node_modules/xmlbuilder2/lib/readers/BaseReader.js +167 -0
- package/node_modules/xmlbuilder2/lib/readers/BaseReader.js.map +1 -0
- package/node_modules/xmlbuilder2/lib/readers/JSONReader.d.ts +14 -0
- package/node_modules/xmlbuilder2/lib/readers/JSONReader.js +38 -0
- package/node_modules/xmlbuilder2/lib/readers/JSONReader.js.map +1 -0
- package/node_modules/xmlbuilder2/lib/readers/ObjectReader.d.ts +15 -0
- package/node_modules/xmlbuilder2/lib/readers/ObjectReader.js +168 -0
- package/node_modules/xmlbuilder2/lib/readers/ObjectReader.js.map +1 -0
- package/node_modules/xmlbuilder2/lib/readers/XMLReader.d.ts +14 -0
- package/node_modules/xmlbuilder2/lib/readers/XMLReader.js +206 -0
- package/node_modules/xmlbuilder2/lib/readers/XMLReader.js.map +1 -0
- package/node_modules/xmlbuilder2/lib/readers/YAMLReader.d.ts +14 -0
- package/node_modules/xmlbuilder2/lib/readers/YAMLReader.js +44 -0
- package/node_modules/xmlbuilder2/lib/readers/YAMLReader.js.map +1 -0
- package/node_modules/xmlbuilder2/lib/readers/index.d.ts +4 -0
- package/node_modules/xmlbuilder2/lib/readers/index.js +11 -0
- package/node_modules/xmlbuilder2/lib/readers/index.js.map +1 -0
- package/node_modules/xmlbuilder2/lib/writers/BaseCBWriter.d.ts +110 -0
- package/node_modules/xmlbuilder2/lib/writers/BaseCBWriter.js +23 -0
- package/node_modules/xmlbuilder2/lib/writers/BaseCBWriter.js.map +1 -0
- package/node_modules/xmlbuilder2/lib/writers/BaseWriter.d.ts +276 -0
- package/node_modules/xmlbuilder2/lib/writers/BaseWriter.js +1603 -0
- package/node_modules/xmlbuilder2/lib/writers/BaseWriter.js.map +1 -0
- package/node_modules/xmlbuilder2/lib/writers/JSONCBWriter.d.ts +68 -0
- package/node_modules/xmlbuilder2/lib/writers/JSONCBWriter.js +172 -0
- package/node_modules/xmlbuilder2/lib/writers/JSONCBWriter.js.map +1 -0
- package/node_modules/xmlbuilder2/lib/writers/JSONWriter.d.ts +67 -0
- package/node_modules/xmlbuilder2/lib/writers/JSONWriter.js +222 -0
- package/node_modules/xmlbuilder2/lib/writers/JSONWriter.js.map +1 -0
- package/node_modules/xmlbuilder2/lib/writers/MapWriter.d.ts +27 -0
- package/node_modules/xmlbuilder2/lib/writers/MapWriter.js +84 -0
- package/node_modules/xmlbuilder2/lib/writers/MapWriter.js.map +1 -0
- package/node_modules/xmlbuilder2/lib/writers/ObjectWriter.d.ts +56 -0
- package/node_modules/xmlbuilder2/lib/writers/ObjectWriter.js +483 -0
- package/node_modules/xmlbuilder2/lib/writers/ObjectWriter.js.map +1 -0
- package/node_modules/xmlbuilder2/lib/writers/XMLCBWriter.d.ts +51 -0
- package/node_modules/xmlbuilder2/lib/writers/XMLCBWriter.js +165 -0
- package/node_modules/xmlbuilder2/lib/writers/XMLCBWriter.js.map +1 -0
- package/node_modules/xmlbuilder2/lib/writers/XMLWriter.d.ts +60 -0
- package/node_modules/xmlbuilder2/lib/writers/XMLWriter.js +236 -0
- package/node_modules/xmlbuilder2/lib/writers/XMLWriter.js.map +1 -0
- package/node_modules/xmlbuilder2/lib/writers/YAMLCBWriter.d.ts +61 -0
- package/node_modules/xmlbuilder2/lib/writers/YAMLCBWriter.js +161 -0
- package/node_modules/xmlbuilder2/lib/writers/YAMLCBWriter.js.map +1 -0
- package/node_modules/xmlbuilder2/lib/writers/YAMLWriter.d.ts +55 -0
- package/node_modules/xmlbuilder2/lib/writers/YAMLWriter.js +186 -0
- package/node_modules/xmlbuilder2/lib/writers/YAMLWriter.js.map +1 -0
- package/node_modules/xmlbuilder2/lib/writers/index.d.ts +5 -0
- package/node_modules/xmlbuilder2/lib/writers/index.js +13 -0
- package/node_modules/xmlbuilder2/lib/writers/index.js.map +1 -0
- package/node_modules/xmlbuilder2/lib/xmlbuilder2.min.js +8 -0
- package/node_modules/xmlbuilder2/node_modules/argparse/CHANGELOG.md +185 -0
- package/node_modules/xmlbuilder2/node_modules/argparse/LICENSE +21 -0
- package/node_modules/xmlbuilder2/node_modules/argparse/README.md +257 -0
- package/node_modules/xmlbuilder2/node_modules/argparse/index.js +3 -0
- package/node_modules/xmlbuilder2/node_modules/argparse/lib/action/append/constant.js +47 -0
- package/node_modules/xmlbuilder2/node_modules/argparse/lib/action/append.js +53 -0
- package/node_modules/xmlbuilder2/node_modules/argparse/lib/action/count.js +40 -0
- package/node_modules/xmlbuilder2/node_modules/argparse/lib/action/help.js +47 -0
- package/node_modules/xmlbuilder2/node_modules/argparse/lib/action/store/constant.js +43 -0
- package/node_modules/xmlbuilder2/node_modules/argparse/lib/action/store/false.js +27 -0
- package/node_modules/xmlbuilder2/node_modules/argparse/lib/action/store/true.js +26 -0
- package/node_modules/xmlbuilder2/node_modules/argparse/lib/action/store.js +50 -0
- package/node_modules/xmlbuilder2/node_modules/argparse/lib/action/subparsers.js +149 -0
- package/node_modules/xmlbuilder2/node_modules/argparse/lib/action/version.js +47 -0
- package/node_modules/xmlbuilder2/node_modules/argparse/lib/action.js +146 -0
- package/node_modules/xmlbuilder2/node_modules/argparse/lib/action_container.js +482 -0
- package/node_modules/xmlbuilder2/node_modules/argparse/lib/argparse.js +14 -0
- package/node_modules/xmlbuilder2/node_modules/argparse/lib/argument/error.js +50 -0
- package/node_modules/xmlbuilder2/node_modules/argparse/lib/argument/exclusive.js +54 -0
- package/node_modules/xmlbuilder2/node_modules/argparse/lib/argument/group.js +75 -0
- package/node_modules/xmlbuilder2/node_modules/argparse/lib/argument_parser.js +1161 -0
- package/node_modules/xmlbuilder2/node_modules/argparse/lib/const.js +21 -0
- package/node_modules/xmlbuilder2/node_modules/argparse/lib/help/added_formatters.js +87 -0
- package/node_modules/xmlbuilder2/node_modules/argparse/lib/help/formatter.js +795 -0
- package/node_modules/xmlbuilder2/node_modules/argparse/lib/namespace.js +76 -0
- package/node_modules/xmlbuilder2/node_modules/argparse/lib/utils.js +57 -0
- package/node_modules/xmlbuilder2/node_modules/argparse/package.json +34 -0
- package/node_modules/xmlbuilder2/node_modules/js-yaml/CHANGELOG.md +557 -0
- package/node_modules/xmlbuilder2/node_modules/js-yaml/LICENSE +21 -0
- package/node_modules/xmlbuilder2/node_modules/js-yaml/README.md +299 -0
- package/node_modules/xmlbuilder2/node_modules/js-yaml/bin/js-yaml.js +132 -0
- package/node_modules/xmlbuilder2/node_modules/js-yaml/dist/js-yaml.js +3989 -0
- package/node_modules/xmlbuilder2/node_modules/js-yaml/dist/js-yaml.min.js +1 -0
- package/node_modules/xmlbuilder2/node_modules/js-yaml/index.js +7 -0
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/common.js +59 -0
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/dumper.js +850 -0
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/exception.js +43 -0
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/loader.js +1644 -0
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/mark.js +76 -0
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/schema/core.js +18 -0
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/schema/default_full.js +25 -0
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js +28 -0
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js +17 -0
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/schema/json.js +25 -0
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/schema.js +108 -0
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type/binary.js +138 -0
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type/bool.js +35 -0
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type/float.js +116 -0
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type/int.js +173 -0
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type/js/function.js +93 -0
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js +60 -0
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js +28 -0
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type/map.js +8 -0
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type/merge.js +12 -0
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type/null.js +34 -0
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type/omap.js +44 -0
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type/pairs.js +53 -0
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type/seq.js +8 -0
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type/set.js +29 -0
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type/str.js +8 -0
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type/timestamp.js +88 -0
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type.js +61 -0
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml.js +39 -0
- package/node_modules/xmlbuilder2/node_modules/js-yaml/package.json +49 -0
- package/node_modules/xmlbuilder2/package.json +82 -0
- package/node_modules/xpath/LICENSE +22 -0
- package/node_modules/xpath/README.md +133 -0
- package/node_modules/xpath/package.json +43 -0
- package/node_modules/xpath/xpath.d.ts +51 -0
- package/node_modules/xpath/xpath.js +5041 -0
- package/package.json +9 -2
|
@@ -0,0 +1,1479 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __values = (this && this.__values) || function(o) {
|
|
3
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
4
|
+
if (m) return m.call(o);
|
|
5
|
+
if (o && typeof o.length === "number") return {
|
|
6
|
+
next: function () {
|
|
7
|
+
if (o && i >= o.length) o = void 0;
|
|
8
|
+
return { value: o && o[i++], done: !o };
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
var interfaces_1 = require("../dom/interfaces");
|
|
15
|
+
var LocalNameSet_1 = require("./LocalNameSet");
|
|
16
|
+
var NamespacePrefixMap_1 = require("./NamespacePrefixMap");
|
|
17
|
+
var DOMException_1 = require("../dom/DOMException");
|
|
18
|
+
var infra_1 = require("@oozcitak/infra");
|
|
19
|
+
var algorithm_1 = require("../algorithm");
|
|
20
|
+
/**
|
|
21
|
+
* Represents an XML serializer.
|
|
22
|
+
*
|
|
23
|
+
* Implements: https://www.w3.org/TR/DOM-Parsing/#serializing
|
|
24
|
+
*/
|
|
25
|
+
var XMLSerializerImpl = /** @class */ (function () {
|
|
26
|
+
function XMLSerializerImpl() {
|
|
27
|
+
}
|
|
28
|
+
/** @inheritdoc */
|
|
29
|
+
XMLSerializerImpl.prototype.serializeToString = function (root) {
|
|
30
|
+
/**
|
|
31
|
+
* The serializeToString(root) method must produce an XML serialization
|
|
32
|
+
* of root passing a value of false for the require well-formed parameter,
|
|
33
|
+
* and return the result.
|
|
34
|
+
*/
|
|
35
|
+
return this._xmlSerialization(root, false);
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Produces an XML serialization of the given node.
|
|
39
|
+
*
|
|
40
|
+
* @param node - node to serialize
|
|
41
|
+
* @param requireWellFormed - whether to check conformance
|
|
42
|
+
*/
|
|
43
|
+
XMLSerializerImpl.prototype._xmlSerialization = function (node, requireWellFormed) {
|
|
44
|
+
// To increase performance, use a namespace-aware serializer only if the
|
|
45
|
+
// document has namespaced elements
|
|
46
|
+
if (node._nodeDocument === undefined || node._nodeDocument._hasNamespaces) {
|
|
47
|
+
/** From: https://w3c.github.io/DOM-Parsing/#xml-serialization
|
|
48
|
+
*
|
|
49
|
+
* 1. Let namespace be a context namespace with value null.
|
|
50
|
+
* The context namespace tracks the XML serialization algorithm's current
|
|
51
|
+
* default namespace. The context namespace is changed when either an Element
|
|
52
|
+
* Node has a default namespace declaration, or the algorithm generates a
|
|
53
|
+
* default namespace declaration for the Element Node to match its own
|
|
54
|
+
* namespace. The algorithm assumes no namespace (null) to start.
|
|
55
|
+
* 2. Let prefix map be a new namespace prefix map.
|
|
56
|
+
* 3. Add the XML namespace with prefix value "xml" to prefix map.
|
|
57
|
+
* 4. Let prefix index be a generated namespace prefix index with value 1.
|
|
58
|
+
* The generated namespace prefix index is used to generate a new unique
|
|
59
|
+
* prefix value when no suitable existing namespace prefix is available to
|
|
60
|
+
* serialize a node's namespaceURI (or the namespaceURI of one of node's
|
|
61
|
+
* attributes). See the generate a prefix algorithm.
|
|
62
|
+
*/
|
|
63
|
+
var namespace = null;
|
|
64
|
+
var prefixMap = new NamespacePrefixMap_1.NamespacePrefixMap();
|
|
65
|
+
prefixMap.set("xml", infra_1.namespace.XML);
|
|
66
|
+
var prefixIndex = { value: 1 };
|
|
67
|
+
/**
|
|
68
|
+
* 5. Return the result of running the XML serialization algorithm on node
|
|
69
|
+
* passing the context namespace namespace, namespace prefix map prefix map,
|
|
70
|
+
* generated namespace prefix index reference to prefix index, and the
|
|
71
|
+
* flag require well-formed. If an exception occurs during the execution
|
|
72
|
+
* of the algorithm, then catch that exception and throw an
|
|
73
|
+
* "InvalidStateError" DOMException.
|
|
74
|
+
*/
|
|
75
|
+
try {
|
|
76
|
+
return this._serializeNodeNS(node, namespace, prefixMap, prefixIndex, requireWellFormed);
|
|
77
|
+
}
|
|
78
|
+
catch (_a) {
|
|
79
|
+
throw new DOMException_1.InvalidStateError();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
try {
|
|
84
|
+
return this._serializeNode(node, requireWellFormed);
|
|
85
|
+
}
|
|
86
|
+
catch (_b) {
|
|
87
|
+
throw new DOMException_1.InvalidStateError();
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* Produces an XML serialization of a node.
|
|
93
|
+
*
|
|
94
|
+
* @param node - node to serialize
|
|
95
|
+
* @param namespace - context namespace
|
|
96
|
+
* @param prefixMap - namespace prefix map
|
|
97
|
+
* @param prefixIndex - generated namespace prefix index
|
|
98
|
+
* @param requireWellFormed - whether to check conformance
|
|
99
|
+
*/
|
|
100
|
+
XMLSerializerImpl.prototype._serializeNodeNS = function (node, namespace, prefixMap, prefixIndex, requireWellFormed) {
|
|
101
|
+
switch (node.nodeType) {
|
|
102
|
+
case interfaces_1.NodeType.Element:
|
|
103
|
+
return this._serializeElementNS(node, namespace, prefixMap, prefixIndex, requireWellFormed);
|
|
104
|
+
case interfaces_1.NodeType.Document:
|
|
105
|
+
return this._serializeDocumentNS(node, namespace, prefixMap, prefixIndex, requireWellFormed);
|
|
106
|
+
case interfaces_1.NodeType.Comment:
|
|
107
|
+
return this._serializeComment(node, requireWellFormed);
|
|
108
|
+
case interfaces_1.NodeType.Text:
|
|
109
|
+
return this._serializeText(node, requireWellFormed);
|
|
110
|
+
case interfaces_1.NodeType.DocumentFragment:
|
|
111
|
+
return this._serializeDocumentFragmentNS(node, namespace, prefixMap, prefixIndex, requireWellFormed);
|
|
112
|
+
case interfaces_1.NodeType.DocumentType:
|
|
113
|
+
return this._serializeDocumentType(node, requireWellFormed);
|
|
114
|
+
case interfaces_1.NodeType.ProcessingInstruction:
|
|
115
|
+
return this._serializeProcessingInstruction(node, requireWellFormed);
|
|
116
|
+
case interfaces_1.NodeType.CData:
|
|
117
|
+
return this._serializeCData(node, requireWellFormed);
|
|
118
|
+
default:
|
|
119
|
+
throw new Error("Unknown node type: " + node.nodeType);
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* Produces an XML serialization of a node.
|
|
124
|
+
*
|
|
125
|
+
* @param node - node to serialize
|
|
126
|
+
* @param requireWellFormed - whether to check conformance
|
|
127
|
+
*/
|
|
128
|
+
XMLSerializerImpl.prototype._serializeNode = function (node, requireWellFormed) {
|
|
129
|
+
switch (node.nodeType) {
|
|
130
|
+
case interfaces_1.NodeType.Element:
|
|
131
|
+
return this._serializeElement(node, requireWellFormed);
|
|
132
|
+
case interfaces_1.NodeType.Document:
|
|
133
|
+
return this._serializeDocument(node, requireWellFormed);
|
|
134
|
+
case interfaces_1.NodeType.Comment:
|
|
135
|
+
return this._serializeComment(node, requireWellFormed);
|
|
136
|
+
case interfaces_1.NodeType.Text:
|
|
137
|
+
return this._serializeText(node, requireWellFormed);
|
|
138
|
+
case interfaces_1.NodeType.DocumentFragment:
|
|
139
|
+
return this._serializeDocumentFragment(node, requireWellFormed);
|
|
140
|
+
case interfaces_1.NodeType.DocumentType:
|
|
141
|
+
return this._serializeDocumentType(node, requireWellFormed);
|
|
142
|
+
case interfaces_1.NodeType.ProcessingInstruction:
|
|
143
|
+
return this._serializeProcessingInstruction(node, requireWellFormed);
|
|
144
|
+
case interfaces_1.NodeType.CData:
|
|
145
|
+
return this._serializeCData(node, requireWellFormed);
|
|
146
|
+
default:
|
|
147
|
+
throw new Error("Unknown node type: " + node.nodeType);
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* Produces an XML serialization of an element node.
|
|
152
|
+
*
|
|
153
|
+
* @param node - node to serialize
|
|
154
|
+
* @param namespace - context namespace
|
|
155
|
+
* @param prefixMap - namespace prefix map
|
|
156
|
+
* @param prefixIndex - generated namespace prefix index
|
|
157
|
+
* @param requireWellFormed - whether to check conformance
|
|
158
|
+
*/
|
|
159
|
+
XMLSerializerImpl.prototype._serializeElementNS = function (node, namespace, prefixMap, prefixIndex, requireWellFormed) {
|
|
160
|
+
var e_1, _a;
|
|
161
|
+
/**
|
|
162
|
+
* From: https://w3c.github.io/DOM-Parsing/#xml-serializing-an-element-node
|
|
163
|
+
*
|
|
164
|
+
* 1. If the require well-formed flag is set (its value is true), and this
|
|
165
|
+
* node's localName attribute contains the character ":" (U+003A COLON) or
|
|
166
|
+
* does not match the XML Name production, then throw an exception; the
|
|
167
|
+
* serialization of this node would not be a well-formed element.
|
|
168
|
+
*/
|
|
169
|
+
if (requireWellFormed && (node.localName.indexOf(":") !== -1 ||
|
|
170
|
+
!algorithm_1.xml_isName(node.localName))) {
|
|
171
|
+
throw new Error("Node local name contains invalid characters (well-formed required).");
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* 2. Let markup be the string "<" (U+003C LESS-THAN SIGN).
|
|
175
|
+
* 3. Let qualified name be an empty string.
|
|
176
|
+
* 4. Let skip end tag be a boolean flag with value false.
|
|
177
|
+
* 5. Let ignore namespace definition attribute be a boolean flag with value
|
|
178
|
+
* false.
|
|
179
|
+
* 6. Given prefix map, copy a namespace prefix map and let map be the
|
|
180
|
+
* result.
|
|
181
|
+
* 7. Let local prefixes map be an empty map. The map has unique Node prefix
|
|
182
|
+
* strings as its keys, with corresponding namespaceURI Node values as the
|
|
183
|
+
* map's key values (in this map, the null namespace is represented by the
|
|
184
|
+
* empty string).
|
|
185
|
+
*
|
|
186
|
+
* _Note:_ This map is local to each element. It is used to ensure there
|
|
187
|
+
* are no conflicting prefixes should a new namespace prefix attribute need
|
|
188
|
+
* to be generated. It is also used to enable skipping of duplicate prefix
|
|
189
|
+
* definitions when writing an element's attributes: the map allows the
|
|
190
|
+
* algorithm to distinguish between a prefix in the namespace prefix map
|
|
191
|
+
* that might be locally-defined (to the current Element) and one that is
|
|
192
|
+
* not.
|
|
193
|
+
* 8. Let local default namespace be the result of recording the namespace
|
|
194
|
+
* information for node given map and local prefixes map.
|
|
195
|
+
*
|
|
196
|
+
* _Note:_ The above step will update map with any found namespace prefix
|
|
197
|
+
* definitions, add the found prefix definitions to the local prefixes map
|
|
198
|
+
* and return a local default namespace value defined by a default namespace
|
|
199
|
+
* attribute if one exists. Otherwise it returns null.
|
|
200
|
+
* 9. Let inherited ns be a copy of namespace.
|
|
201
|
+
* 10. Let ns be the value of node's namespaceURI attribute.
|
|
202
|
+
*/
|
|
203
|
+
var markup = "<";
|
|
204
|
+
var qualifiedName = '';
|
|
205
|
+
var skipEndTag = false;
|
|
206
|
+
var ignoreNamespaceDefinitionAttribute = false;
|
|
207
|
+
var map = prefixMap.copy();
|
|
208
|
+
var localPrefixesMap = {};
|
|
209
|
+
var localDefaultNamespace = this._recordNamespaceInformation(node, map, localPrefixesMap);
|
|
210
|
+
var inheritedNS = namespace;
|
|
211
|
+
var ns = node.namespaceURI;
|
|
212
|
+
/** 11. If inherited ns is equal to ns, then: */
|
|
213
|
+
if (inheritedNS === ns) {
|
|
214
|
+
/**
|
|
215
|
+
* 11.1. If local default namespace is not null, then set ignore
|
|
216
|
+
* namespace definition attribute to true.
|
|
217
|
+
*/
|
|
218
|
+
if (localDefaultNamespace !== null) {
|
|
219
|
+
ignoreNamespaceDefinitionAttribute = true;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* 11.2. If ns is the XML namespace, then append to qualified name the
|
|
223
|
+
* concatenation of the string "xml:" and the value of node's localName.
|
|
224
|
+
* 11.3. Otherwise, append to qualified name the value of node's
|
|
225
|
+
* localName. The node's prefix if it exists, is dropped.
|
|
226
|
+
*/
|
|
227
|
+
if (ns === infra_1.namespace.XML) {
|
|
228
|
+
qualifiedName = 'xml:' + node.localName;
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
231
|
+
qualifiedName = node.localName;
|
|
232
|
+
}
|
|
233
|
+
/** 11.4. Append the value of qualified name to markup. */
|
|
234
|
+
markup += qualifiedName;
|
|
235
|
+
}
|
|
236
|
+
else {
|
|
237
|
+
/**
|
|
238
|
+
* 12. Otherwise, inherited ns is not equal to ns (the node's own
|
|
239
|
+
* namespace is different from the context namespace of its parent).
|
|
240
|
+
* Run these sub-steps:
|
|
241
|
+
*
|
|
242
|
+
* 12.1. Let prefix be the value of node's prefix attribute.
|
|
243
|
+
* 12.2. Let candidate prefix be the result of retrieving a preferred
|
|
244
|
+
* prefix string prefix from map given namespace ns. The above may return
|
|
245
|
+
* null if no namespace key ns exists in map.
|
|
246
|
+
*/
|
|
247
|
+
var prefix = node.prefix;
|
|
248
|
+
/**
|
|
249
|
+
* We don't need to run "retrieving a preferred prefix string" algorithm if
|
|
250
|
+
* the element has no prefix and its namespace matches to the default
|
|
251
|
+
* namespace.
|
|
252
|
+
* See: https://github.com/web-platform-tests/wpt/pull/16703
|
|
253
|
+
*/
|
|
254
|
+
var candidatePrefix = null;
|
|
255
|
+
if (prefix !== null || ns !== localDefaultNamespace) {
|
|
256
|
+
candidatePrefix = map.get(prefix, ns);
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* 12.3. If the value of prefix matches "xmlns", then run the following
|
|
260
|
+
* steps:
|
|
261
|
+
*/
|
|
262
|
+
if (prefix === "xmlns") {
|
|
263
|
+
/**
|
|
264
|
+
* 12.3.1. If the require well-formed flag is set, then throw an error.
|
|
265
|
+
* An Element with prefix "xmlns" will not legally round-trip in a
|
|
266
|
+
* conforming XML parser.
|
|
267
|
+
*/
|
|
268
|
+
if (requireWellFormed) {
|
|
269
|
+
throw new Error("An element cannot have the 'xmlns' prefix (well-formed required).");
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* 12.3.2. Let candidate prefix be the value of prefix.
|
|
273
|
+
*/
|
|
274
|
+
candidatePrefix = prefix;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* 12.4.Found a suitable namespace prefix: if candidate prefix is not
|
|
278
|
+
* null (a namespace prefix is defined which maps to ns), then:
|
|
279
|
+
*/
|
|
280
|
+
if (candidatePrefix !== null) {
|
|
281
|
+
/**
|
|
282
|
+
* The following may serialize a different prefix than the Element's
|
|
283
|
+
* existing prefix if it already had one. However, the retrieving a
|
|
284
|
+
* preferred prefix string algorithm already tried to match the
|
|
285
|
+
* existing prefix if possible.
|
|
286
|
+
*
|
|
287
|
+
* 12.4.1. Append to qualified name the concatenation of candidate
|
|
288
|
+
* prefix, ":" (U+003A COLON), and node's localName. There exists on
|
|
289
|
+
* this node or the node's ancestry a namespace prefix definition that
|
|
290
|
+
* defines the node's namespace.
|
|
291
|
+
* 12.4.2. If the local default namespace is not null (there exists a
|
|
292
|
+
* locally-defined default namespace declaration attribute) and its
|
|
293
|
+
* value is not the XML namespace, then let inherited ns get the value
|
|
294
|
+
* of local default namespace unless the local default namespace is the
|
|
295
|
+
* empty string in which case let it get null (the context namespace
|
|
296
|
+
* is changed to the declared default, rather than this node's own
|
|
297
|
+
* namespace).
|
|
298
|
+
*
|
|
299
|
+
* _Note:_ Any default namespace definitions or namespace prefixes that
|
|
300
|
+
* define the XML namespace are omitted when serializing this node's
|
|
301
|
+
* attributes.
|
|
302
|
+
*/
|
|
303
|
+
qualifiedName = candidatePrefix + ':' + node.localName;
|
|
304
|
+
if (localDefaultNamespace !== null && localDefaultNamespace !== infra_1.namespace.XML) {
|
|
305
|
+
inheritedNS = localDefaultNamespace || null;
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* 12.4.3. Append the value of qualified name to markup.
|
|
309
|
+
*/
|
|
310
|
+
markup += qualifiedName;
|
|
311
|
+
/** 12.5. Otherwise, if prefix is not null, then: */
|
|
312
|
+
}
|
|
313
|
+
else if (prefix !== null) {
|
|
314
|
+
/**
|
|
315
|
+
* _Note:_ By this step, there is no namespace or prefix mapping
|
|
316
|
+
* declaration in this node (or any parent node visited by this
|
|
317
|
+
* algorithm) that defines prefix otherwise the step labelled Found
|
|
318
|
+
* a suitable namespace prefix would have been followed. The sub-steps
|
|
319
|
+
* that follow will create a new namespace prefix declaration for prefix
|
|
320
|
+
* and ensure that prefix does not conflict with an existing namespace
|
|
321
|
+
* prefix declaration of the same localName in node's attribute list.
|
|
322
|
+
*
|
|
323
|
+
* 12.5.1. If the local prefixes map contains a key matching prefix,
|
|
324
|
+
* then let prefix be the result of generating a prefix providing as
|
|
325
|
+
* input map, ns, and prefix index.
|
|
326
|
+
*/
|
|
327
|
+
if (prefix in localPrefixesMap) {
|
|
328
|
+
prefix = this._generatePrefix(ns, map, prefixIndex);
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* 12.5.2. Add prefix to map given namespace ns.
|
|
332
|
+
* 12.5.3. Append to qualified name the concatenation of prefix, ":"
|
|
333
|
+
* (U+003A COLON), and node's localName.
|
|
334
|
+
* 12.5.4. Append the value of qualified name to markup.
|
|
335
|
+
*/
|
|
336
|
+
map.set(prefix, ns);
|
|
337
|
+
qualifiedName += prefix + ':' + node.localName;
|
|
338
|
+
markup += qualifiedName;
|
|
339
|
+
/**
|
|
340
|
+
* 12.5.5. Append the following to markup, in the order listed:
|
|
341
|
+
*
|
|
342
|
+
* _Note:_ The following serializes a namespace prefix declaration for
|
|
343
|
+
* prefix which was just added to the map.
|
|
344
|
+
*
|
|
345
|
+
* 12.5.5.1. " " (U+0020 SPACE);
|
|
346
|
+
* 12.5.5.2. The string "xmlns:";
|
|
347
|
+
* 12.5.5.3. The value of prefix;
|
|
348
|
+
* 12.5.5.4. "="" (U+003D EQUALS SIGN, U+0022 QUOTATION MARK);
|
|
349
|
+
* 12.5.5.5. The result of serializing an attribute value given ns and
|
|
350
|
+
* the require well-formed flag as input;
|
|
351
|
+
* 12.5.5.6. """ (U+0022 QUOTATION MARK).
|
|
352
|
+
*/
|
|
353
|
+
markup += " xmlns:" + prefix + "=\"" +
|
|
354
|
+
this._serializeAttributeValue(ns, requireWellFormed) + "\"";
|
|
355
|
+
/**
|
|
356
|
+
* 12.5.5.7. If local default namespace is not null (there exists a
|
|
357
|
+
* locally-defined default namespace declaration attribute), then
|
|
358
|
+
* let inherited ns get the value of local default namespace unless the
|
|
359
|
+
* local default namespace is the empty string in which case let it get
|
|
360
|
+
* null.
|
|
361
|
+
*/
|
|
362
|
+
if (localDefaultNamespace !== null) {
|
|
363
|
+
inheritedNS = localDefaultNamespace || null;
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* 12.6. Otherwise, if local default namespace is null, or local
|
|
367
|
+
* default namespace is not null and its value is not equal to ns, then:
|
|
368
|
+
*/
|
|
369
|
+
}
|
|
370
|
+
else if (localDefaultNamespace === null ||
|
|
371
|
+
(localDefaultNamespace !== null && localDefaultNamespace !== ns)) {
|
|
372
|
+
/**
|
|
373
|
+
* _Note:_ At this point, the namespace for this node still needs to be
|
|
374
|
+
* serialized, but there's no prefix (or candidate prefix) available; the
|
|
375
|
+
* following uses the default namespace declaration to define the
|
|
376
|
+
* namespace--optionally replacing an existing default declaration
|
|
377
|
+
* if present.
|
|
378
|
+
*
|
|
379
|
+
* 12.6.1. Set the ignore namespace definition attribute flag to true.
|
|
380
|
+
* 12.6.2. Append to qualified name the value of node's localName.
|
|
381
|
+
* 12.6.3. Let the value of inherited ns be ns.
|
|
382
|
+
*
|
|
383
|
+
* _Note:_ The new default namespace will be used in the serialization
|
|
384
|
+
* to define this node's namespace and act as the context namespace for
|
|
385
|
+
* its children.
|
|
386
|
+
*/
|
|
387
|
+
ignoreNamespaceDefinitionAttribute = true;
|
|
388
|
+
qualifiedName += node.localName;
|
|
389
|
+
inheritedNS = ns;
|
|
390
|
+
/**
|
|
391
|
+
* 12.6.4. Append the value of qualified name to markup.
|
|
392
|
+
*/
|
|
393
|
+
markup += qualifiedName;
|
|
394
|
+
/**
|
|
395
|
+
* 12.6.5. Append the following to markup, in the order listed:
|
|
396
|
+
*
|
|
397
|
+
* _Note:_ The following serializes the new (or replacement) default
|
|
398
|
+
* namespace definition.
|
|
399
|
+
*
|
|
400
|
+
* 12.6.5.1. " " (U+0020 SPACE);
|
|
401
|
+
* 12.6.5.2. The string "xmlns";
|
|
402
|
+
* 12.6.5.3. "="" (U+003D EQUALS SIGN, U+0022 QUOTATION MARK);
|
|
403
|
+
* 12.6.5.4. The result of serializing an attribute value given ns
|
|
404
|
+
* and the require well-formed flag as input;
|
|
405
|
+
* 12.6.5.5. """ (U+0022 QUOTATION MARK).
|
|
406
|
+
*/
|
|
407
|
+
markup += " xmlns" + "=\"" +
|
|
408
|
+
this._serializeAttributeValue(ns, requireWellFormed) + "\"";
|
|
409
|
+
/**
|
|
410
|
+
* 12.7. Otherwise, the node has a local default namespace that matches
|
|
411
|
+
* ns. Append to qualified name the value of node's localName, let the
|
|
412
|
+
* value of inherited ns be ns, and append the value of qualified name
|
|
413
|
+
* to markup.
|
|
414
|
+
*/
|
|
415
|
+
}
|
|
416
|
+
else {
|
|
417
|
+
qualifiedName += node.localName;
|
|
418
|
+
inheritedNS = ns;
|
|
419
|
+
markup += qualifiedName;
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* 13. Append to markup the result of the XML serialization of node's
|
|
424
|
+
* attributes given map, prefix index, local prefixes map, ignore namespace
|
|
425
|
+
* definition attribute flag, and require well-formed flag.
|
|
426
|
+
*/
|
|
427
|
+
markup += this._serializeAttributesNS(node, map, prefixIndex, localPrefixesMap, ignoreNamespaceDefinitionAttribute, requireWellFormed);
|
|
428
|
+
/**
|
|
429
|
+
* 14. If ns is the HTML namespace, and the node's list of children is
|
|
430
|
+
* empty, and the node's localName matches any one of the following void
|
|
431
|
+
* elements: "area", "base", "basefont", "bgsound", "br", "col", "embed",
|
|
432
|
+
* "frame", "hr", "img", "input", "keygen", "link", "menuitem", "meta",
|
|
433
|
+
* "param", "source", "track", "wbr"; then append the following to markup,
|
|
434
|
+
* in the order listed:
|
|
435
|
+
* 14.1. " " (U+0020 SPACE);
|
|
436
|
+
* 14.2. "/" (U+002F SOLIDUS).
|
|
437
|
+
* and set the skip end tag flag to true.
|
|
438
|
+
* 15. If ns is not the HTML namespace, and the node's list of children is
|
|
439
|
+
* empty, then append "/" (U+002F SOLIDUS) to markup and set the skip end
|
|
440
|
+
* tag flag to true.
|
|
441
|
+
* 16. Append ">" (U+003E GREATER-THAN SIGN) to markup.
|
|
442
|
+
*/
|
|
443
|
+
var isHTML = (ns === infra_1.namespace.HTML);
|
|
444
|
+
if (isHTML && node.childNodes.length === 0 &&
|
|
445
|
+
XMLSerializerImpl._VoidElementNames.has(node.localName)) {
|
|
446
|
+
markup += " /";
|
|
447
|
+
skipEndTag = true;
|
|
448
|
+
}
|
|
449
|
+
else if (!isHTML && node.childNodes.length === 0) {
|
|
450
|
+
markup += "/";
|
|
451
|
+
skipEndTag = true;
|
|
452
|
+
}
|
|
453
|
+
markup += ">";
|
|
454
|
+
/**
|
|
455
|
+
* 17. If the value of skip end tag is true, then return the value of markup
|
|
456
|
+
* and skip the remaining steps. The node is a leaf-node.
|
|
457
|
+
*/
|
|
458
|
+
if (skipEndTag)
|
|
459
|
+
return markup;
|
|
460
|
+
/**
|
|
461
|
+
* 18. If ns is the HTML namespace, and the node's localName matches the
|
|
462
|
+
* string "template", then this is a template element. Append to markup the
|
|
463
|
+
* result of XML serializing a DocumentFragment node given the template
|
|
464
|
+
* element's template contents (a DocumentFragment), providing inherited
|
|
465
|
+
* ns, map, prefix index, and the require well-formed flag.
|
|
466
|
+
*
|
|
467
|
+
* _Note:_ This allows template content to round-trip, given the rules for
|
|
468
|
+
* parsing XHTML documents.
|
|
469
|
+
*
|
|
470
|
+
* 19. Otherwise, append to markup the result of running the XML
|
|
471
|
+
* serialization algorithm on each of node's children, in tree order,
|
|
472
|
+
* providing inherited ns, map, prefix index, and the require well-formed
|
|
473
|
+
* flag.
|
|
474
|
+
*/
|
|
475
|
+
if (isHTML && node.localName === "template") {
|
|
476
|
+
// TODO: serialize template contents
|
|
477
|
+
}
|
|
478
|
+
else {
|
|
479
|
+
try {
|
|
480
|
+
for (var _b = __values(node._children || node.childNodes), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
481
|
+
var childNode = _c.value;
|
|
482
|
+
markup += this._serializeNodeNS(childNode, inheritedNS, map, prefixIndex, requireWellFormed);
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
486
|
+
finally {
|
|
487
|
+
try {
|
|
488
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
489
|
+
}
|
|
490
|
+
finally { if (e_1) throw e_1.error; }
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
/**
|
|
494
|
+
* 20. Append the following to markup, in the order listed:
|
|
495
|
+
* 20.1. "</" (U+003C LESS-THAN SIGN, U+002F SOLIDUS);
|
|
496
|
+
* 20.2. The value of qualified name;
|
|
497
|
+
* 20.3. ">" (U+003E GREATER-THAN SIGN).
|
|
498
|
+
*/
|
|
499
|
+
markup += "</" + qualifiedName + ">";
|
|
500
|
+
/**
|
|
501
|
+
* 21. Return the value of markup.
|
|
502
|
+
*/
|
|
503
|
+
return markup;
|
|
504
|
+
};
|
|
505
|
+
/**
|
|
506
|
+
* Produces an XML serialization of a document node.
|
|
507
|
+
*
|
|
508
|
+
* @param node - node to serialize
|
|
509
|
+
* @param namespace - context namespace
|
|
510
|
+
* @param prefixMap - namespace prefix map
|
|
511
|
+
* @param prefixIndex - generated namespace prefix index
|
|
512
|
+
* @param requireWellFormed - whether to check conformance
|
|
513
|
+
*/
|
|
514
|
+
XMLSerializerImpl.prototype._serializeDocumentNS = function (node, namespace, prefixMap, prefixIndex, requireWellFormed) {
|
|
515
|
+
var e_2, _a;
|
|
516
|
+
/**
|
|
517
|
+
* If the require well-formed flag is set (its value is true), and this node
|
|
518
|
+
* has no documentElement (the documentElement attribute's value is null),
|
|
519
|
+
* then throw an exception; the serialization of this node would not be a
|
|
520
|
+
* well-formed document.
|
|
521
|
+
*/
|
|
522
|
+
if (requireWellFormed && node.documentElement === null) {
|
|
523
|
+
throw new Error("Missing document element (well-formed required).");
|
|
524
|
+
}
|
|
525
|
+
/**
|
|
526
|
+
* Otherwise, run the following steps:
|
|
527
|
+
* 1. Let serialized document be an empty string.
|
|
528
|
+
* 2. For each child child of node, in tree order, run the XML
|
|
529
|
+
* serialization algorithm on the child passing along the provided
|
|
530
|
+
* arguments, and append the result to serialized document.
|
|
531
|
+
*
|
|
532
|
+
* _Note:_ This will serialize any number of ProcessingInstruction and
|
|
533
|
+
* Comment nodes both before and after the Document's documentElement node,
|
|
534
|
+
* including at most one DocumentType node. (Text nodes are not allowed as
|
|
535
|
+
* children of the Document.)
|
|
536
|
+
*
|
|
537
|
+
* 3. Return the value of serialized document.
|
|
538
|
+
*/
|
|
539
|
+
var serializedDocument = "";
|
|
540
|
+
try {
|
|
541
|
+
for (var _b = __values(node._children || node.childNodes), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
542
|
+
var childNode = _c.value;
|
|
543
|
+
serializedDocument += this._serializeNodeNS(childNode, namespace, prefixMap, prefixIndex, requireWellFormed);
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
547
|
+
finally {
|
|
548
|
+
try {
|
|
549
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
550
|
+
}
|
|
551
|
+
finally { if (e_2) throw e_2.error; }
|
|
552
|
+
}
|
|
553
|
+
return serializedDocument;
|
|
554
|
+
};
|
|
555
|
+
/**
|
|
556
|
+
* Produces an XML serialization of a comment node.
|
|
557
|
+
*
|
|
558
|
+
* @param node - node to serialize
|
|
559
|
+
* @param requireWellFormed - whether to check conformance
|
|
560
|
+
*/
|
|
561
|
+
XMLSerializerImpl.prototype._serializeComment = function (node, requireWellFormed) {
|
|
562
|
+
/**
|
|
563
|
+
* If the require well-formed flag is set (its value is true), and node's
|
|
564
|
+
* data contains characters that are not matched by the XML Char production
|
|
565
|
+
* or contains "--" (two adjacent U+002D HYPHEN-MINUS characters) or that
|
|
566
|
+
* ends with a "-" (U+002D HYPHEN-MINUS) character, then throw an exception;
|
|
567
|
+
* the serialization of this node's data would not be well-formed.
|
|
568
|
+
*/
|
|
569
|
+
if (requireWellFormed && (!algorithm_1.xml_isLegalChar(node.data) ||
|
|
570
|
+
node.data.indexOf("--") !== -1 || node.data.endsWith("-"))) {
|
|
571
|
+
throw new Error("Comment data contains invalid characters (well-formed required).");
|
|
572
|
+
}
|
|
573
|
+
/**
|
|
574
|
+
* Otherwise, return the concatenation of "<!--", node's data, and "-->".
|
|
575
|
+
*/
|
|
576
|
+
return "<!--" + node.data + "-->";
|
|
577
|
+
};
|
|
578
|
+
/**
|
|
579
|
+
* Produces an XML serialization of a text node.
|
|
580
|
+
*
|
|
581
|
+
* @param node - node to serialize
|
|
582
|
+
* @param requireWellFormed - whether to check conformance
|
|
583
|
+
* @param level - current depth of the XML tree
|
|
584
|
+
*/
|
|
585
|
+
XMLSerializerImpl.prototype._serializeText = function (node, requireWellFormed) {
|
|
586
|
+
/**
|
|
587
|
+
* 1. If the require well-formed flag is set (its value is true), and
|
|
588
|
+
* node's data contains characters that are not matched by the XML Char
|
|
589
|
+
* production, then throw an exception; the serialization of this node's
|
|
590
|
+
* data would not be well-formed.
|
|
591
|
+
*/
|
|
592
|
+
if (requireWellFormed && !algorithm_1.xml_isLegalChar(node.data)) {
|
|
593
|
+
throw new Error("Text data contains invalid characters (well-formed required).");
|
|
594
|
+
}
|
|
595
|
+
/**
|
|
596
|
+
* 2. Let markup be the value of node's data.
|
|
597
|
+
* 3. Replace any occurrences of "&" in markup by "&".
|
|
598
|
+
* 4. Replace any occurrences of "<" in markup by "<".
|
|
599
|
+
* 5. Replace any occurrences of ">" in markup by ">".
|
|
600
|
+
* 6. Return the value of markup.
|
|
601
|
+
*/
|
|
602
|
+
var result = "";
|
|
603
|
+
for (var i = 0; i < node.data.length; i++) {
|
|
604
|
+
var c = node.data[i];
|
|
605
|
+
if (c === "&")
|
|
606
|
+
result += "&";
|
|
607
|
+
else if (c === "<")
|
|
608
|
+
result += "<";
|
|
609
|
+
else if (c === ">")
|
|
610
|
+
result += ">";
|
|
611
|
+
else
|
|
612
|
+
result += c;
|
|
613
|
+
}
|
|
614
|
+
return result;
|
|
615
|
+
};
|
|
616
|
+
/**
|
|
617
|
+
* Produces an XML serialization of a document fragment node.
|
|
618
|
+
*
|
|
619
|
+
* @param node - node to serialize
|
|
620
|
+
* @param namespace - context namespace
|
|
621
|
+
* @param prefixMap - namespace prefix map
|
|
622
|
+
* @param prefixIndex - generated namespace prefix index
|
|
623
|
+
* @param requireWellFormed - whether to check conformance
|
|
624
|
+
*/
|
|
625
|
+
XMLSerializerImpl.prototype._serializeDocumentFragmentNS = function (node, namespace, prefixMap, prefixIndex, requireWellFormed) {
|
|
626
|
+
var e_3, _a;
|
|
627
|
+
/**
|
|
628
|
+
* 1. Let markup the empty string.
|
|
629
|
+
* 2. For each child child of node, in tree order, run the XML serialization
|
|
630
|
+
* algorithm on the child given namespace, prefix map, a reference to prefix
|
|
631
|
+
* index, and flag require well-formed. Concatenate the result to markup.
|
|
632
|
+
* 3. Return the value of markup.
|
|
633
|
+
*/
|
|
634
|
+
var markup = "";
|
|
635
|
+
try {
|
|
636
|
+
for (var _b = __values(node._children || node.childNodes), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
637
|
+
var childNode = _c.value;
|
|
638
|
+
markup += this._serializeNodeNS(childNode, namespace, prefixMap, prefixIndex, requireWellFormed);
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
642
|
+
finally {
|
|
643
|
+
try {
|
|
644
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
645
|
+
}
|
|
646
|
+
finally { if (e_3) throw e_3.error; }
|
|
647
|
+
}
|
|
648
|
+
return markup;
|
|
649
|
+
};
|
|
650
|
+
/**
|
|
651
|
+
* Produces an XML serialization of a document type node.
|
|
652
|
+
*
|
|
653
|
+
* @param node - node to serialize
|
|
654
|
+
* @param requireWellFormed - whether to check conformance
|
|
655
|
+
*/
|
|
656
|
+
XMLSerializerImpl.prototype._serializeDocumentType = function (node, requireWellFormed) {
|
|
657
|
+
/**
|
|
658
|
+
* 1. If the require well-formed flag is true and the node's publicId
|
|
659
|
+
* attribute contains characters that are not matched by the XML PubidChar
|
|
660
|
+
* production, then throw an exception; the serialization of this node
|
|
661
|
+
* would not be a well-formed document type declaration.
|
|
662
|
+
*/
|
|
663
|
+
if (requireWellFormed && !algorithm_1.xml_isPubidChar(node.publicId)) {
|
|
664
|
+
throw new Error("DocType public identifier does not match PubidChar construct (well-formed required).");
|
|
665
|
+
}
|
|
666
|
+
/**
|
|
667
|
+
* 2. If the require well-formed flag is true and the node's systemId
|
|
668
|
+
* attribute contains characters that are not matched by the XML Char
|
|
669
|
+
* production or that contains both a """ (U+0022 QUOTATION MARK) and a
|
|
670
|
+
* "'" (U+0027 APOSTROPHE), then throw an exception; the serialization
|
|
671
|
+
* of this node would not be a well-formed document type declaration.
|
|
672
|
+
*/
|
|
673
|
+
if (requireWellFormed &&
|
|
674
|
+
(!algorithm_1.xml_isLegalChar(node.systemId) ||
|
|
675
|
+
(node.systemId.indexOf('"') !== -1 && node.systemId.indexOf("'") !== -1))) {
|
|
676
|
+
throw new Error("DocType system identifier contains invalid characters (well-formed required).");
|
|
677
|
+
}
|
|
678
|
+
/**
|
|
679
|
+
* 3. Let markup be an empty string.
|
|
680
|
+
* 4. Append the string "<!DOCTYPE" to markup.
|
|
681
|
+
* 5. Append " " (U+0020 SPACE) to markup.
|
|
682
|
+
* 6. Append the value of the node's name attribute to markup. For a node
|
|
683
|
+
* belonging to an HTML document, the value will be all lowercase.
|
|
684
|
+
* 7. If the node's publicId is not the empty string then append the
|
|
685
|
+
* following, in the order listed, to markup:
|
|
686
|
+
* 7.1. " " (U+0020 SPACE);
|
|
687
|
+
* 7.2. The string "PUBLIC";
|
|
688
|
+
* 7.3. " " (U+0020 SPACE);
|
|
689
|
+
* 7.4. """ (U+0022 QUOTATION MARK);
|
|
690
|
+
* 7.5. The value of the node's publicId attribute;
|
|
691
|
+
* 7.6. """ (U+0022 QUOTATION MARK).
|
|
692
|
+
* 8. If the node's systemId is not the empty string and the node's publicId
|
|
693
|
+
* is set to the empty string, then append the following, in the order
|
|
694
|
+
* listed, to markup:
|
|
695
|
+
* 8.1. " " (U+0020 SPACE);
|
|
696
|
+
* 8.2. The string "SYSTEM".
|
|
697
|
+
* 9. If the node's systemId is not the empty string then append the
|
|
698
|
+
* following, in the order listed, to markup:
|
|
699
|
+
* 9.2. " " (U+0020 SPACE);
|
|
700
|
+
* 9.3. """ (U+0022 QUOTATION MARK);
|
|
701
|
+
* 9.3. The value of the node's systemId attribute;
|
|
702
|
+
* 9.4. """ (U+0022 QUOTATION MARK).
|
|
703
|
+
* 10. Append ">" (U+003E GREATER-THAN SIGN) to markup.
|
|
704
|
+
* 11. Return the value of markup.
|
|
705
|
+
*/
|
|
706
|
+
return node.publicId && node.systemId ?
|
|
707
|
+
"<!DOCTYPE " + node.name + " PUBLIC \"" + node.publicId + "\" \"" + node.systemId + "\">"
|
|
708
|
+
: node.publicId ?
|
|
709
|
+
"<!DOCTYPE " + node.name + " PUBLIC \"" + node.publicId + "\">"
|
|
710
|
+
: node.systemId ?
|
|
711
|
+
"<!DOCTYPE " + node.name + " SYSTEM \"" + node.systemId + "\">"
|
|
712
|
+
:
|
|
713
|
+
"<!DOCTYPE " + node.name + ">";
|
|
714
|
+
};
|
|
715
|
+
/**
|
|
716
|
+
* Produces an XML serialization of a processing instruction node.
|
|
717
|
+
*
|
|
718
|
+
* @param node - node to serialize
|
|
719
|
+
* @param requireWellFormed - whether to check conformance
|
|
720
|
+
*/
|
|
721
|
+
XMLSerializerImpl.prototype._serializeProcessingInstruction = function (node, requireWellFormed) {
|
|
722
|
+
/**
|
|
723
|
+
* 1. If the require well-formed flag is set (its value is true), and node's
|
|
724
|
+
* target contains a ":" (U+003A COLON) character or is an ASCII
|
|
725
|
+
* case-insensitive match for the string "xml", then throw an exception;
|
|
726
|
+
* the serialization of this node's target would not be well-formed.
|
|
727
|
+
*/
|
|
728
|
+
if (requireWellFormed && (node.target.indexOf(":") !== -1 || (/^xml$/i).test(node.target))) {
|
|
729
|
+
throw new Error("Processing instruction target contains invalid characters (well-formed required).");
|
|
730
|
+
}
|
|
731
|
+
/**
|
|
732
|
+
* 2. If the require well-formed flag is set (its value is true), and node's
|
|
733
|
+
* data contains characters that are not matched by the XML Char production
|
|
734
|
+
* or contains the string "?>" (U+003F QUESTION MARK,
|
|
735
|
+
* U+003E GREATER-THAN SIGN), then throw an exception; the serialization of
|
|
736
|
+
* this node's data would not be well-formed.
|
|
737
|
+
*/
|
|
738
|
+
if (requireWellFormed && (!algorithm_1.xml_isLegalChar(node.data) ||
|
|
739
|
+
node.data.indexOf("?>") !== -1)) {
|
|
740
|
+
throw new Error("Processing instruction data contains invalid characters (well-formed required).");
|
|
741
|
+
}
|
|
742
|
+
/**
|
|
743
|
+
* 3. Let markup be the concatenation of the following, in the order listed:
|
|
744
|
+
* 3.1. "<?" (U+003C LESS-THAN SIGN, U+003F QUESTION MARK);
|
|
745
|
+
* 3.2. The value of node's target;
|
|
746
|
+
* 3.3. " " (U+0020 SPACE);
|
|
747
|
+
* 3.4. The value of node's data;
|
|
748
|
+
* 3.5. "?>" (U+003F QUESTION MARK, U+003E GREATER-THAN SIGN).
|
|
749
|
+
* 4. Return the value of markup.
|
|
750
|
+
*/
|
|
751
|
+
return "<?" + (node.data === "" ? node.target : node.target + " " + node.data) + "?>";
|
|
752
|
+
};
|
|
753
|
+
/**
|
|
754
|
+
* Produces an XML serialization of a CDATA node.
|
|
755
|
+
*
|
|
756
|
+
* @param node - node to serialize
|
|
757
|
+
* @param requireWellFormed - whether to check conformance
|
|
758
|
+
*/
|
|
759
|
+
XMLSerializerImpl.prototype._serializeCData = function (node, requireWellFormed) {
|
|
760
|
+
if (requireWellFormed && (node.data.indexOf("]]>") !== -1)) {
|
|
761
|
+
throw new Error("CDATA contains invalid characters (well-formed required).");
|
|
762
|
+
}
|
|
763
|
+
return "<![CDATA[" + node.data + "]]>";
|
|
764
|
+
};
|
|
765
|
+
/**
|
|
766
|
+
* Produces an XML serialization of the attributes of an element node.
|
|
767
|
+
*
|
|
768
|
+
* @param node - node to serialize
|
|
769
|
+
* @param map - namespace prefix map
|
|
770
|
+
* @param prefixIndex - generated namespace prefix index
|
|
771
|
+
* @param localPrefixesMap - local prefixes map
|
|
772
|
+
* @param ignoreNamespaceDefinitionAttribute - whether to ignore namespace
|
|
773
|
+
* attributes
|
|
774
|
+
* @param requireWellFormed - whether to check conformance
|
|
775
|
+
*/
|
|
776
|
+
XMLSerializerImpl.prototype._serializeAttributesNS = function (node, map, prefixIndex, localPrefixesMap, ignoreNamespaceDefinitionAttribute, requireWellFormed) {
|
|
777
|
+
var e_4, _a;
|
|
778
|
+
/**
|
|
779
|
+
* 1. Let result be the empty string.
|
|
780
|
+
* 2. Let localname set be a new empty namespace localname set. This
|
|
781
|
+
* localname set will contain tuples of unique attribute namespaceURI and
|
|
782
|
+
* localName pairs, and is populated as each attr is processed. This set is
|
|
783
|
+
* used to [optionally] enforce the well-formed constraint that an element
|
|
784
|
+
* cannot have two attributes with the same namespaceURI and localName.
|
|
785
|
+
* This can occur when two otherwise identical attributes on the same
|
|
786
|
+
* element differ only by their prefix values.
|
|
787
|
+
*/
|
|
788
|
+
var result = "";
|
|
789
|
+
var localNameSet = requireWellFormed ? new LocalNameSet_1.LocalNameSet() : undefined;
|
|
790
|
+
try {
|
|
791
|
+
/**
|
|
792
|
+
* 3. Loop: For each attribute attr in element's attributes, in the order
|
|
793
|
+
* they are specified in the element's attribute list:
|
|
794
|
+
*/
|
|
795
|
+
for (var _b = __values(node.attributes), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
796
|
+
var attr = _c.value;
|
|
797
|
+
// Optimize common case
|
|
798
|
+
if (!ignoreNamespaceDefinitionAttribute && !requireWellFormed && attr.namespaceURI === null) {
|
|
799
|
+
result += " " + attr.localName + "=\"" +
|
|
800
|
+
this._serializeAttributeValue(attr.value, requireWellFormed) + "\"";
|
|
801
|
+
continue;
|
|
802
|
+
}
|
|
803
|
+
/**
|
|
804
|
+
* 3.1. If the require well-formed flag is set (its value is true), and the
|
|
805
|
+
* localname set contains a tuple whose values match those of a new tuple
|
|
806
|
+
* consisting of attr's namespaceURI attribute and localName attribute,
|
|
807
|
+
* then throw an exception; the serialization of this attr would fail to
|
|
808
|
+
* produce a well-formed element serialization.
|
|
809
|
+
*/
|
|
810
|
+
if (requireWellFormed && localNameSet && localNameSet.has(attr.namespaceURI, attr.localName)) {
|
|
811
|
+
throw new Error("Element contains duplicate attributes (well-formed required).");
|
|
812
|
+
}
|
|
813
|
+
/**
|
|
814
|
+
* 3.2. Create a new tuple consisting of attr's namespaceURI attribute and
|
|
815
|
+
* localName attribute, and add it to the localname set.
|
|
816
|
+
* 3.3. Let attribute namespace be the value of attr's namespaceURI value.
|
|
817
|
+
* 3.4. Let candidate prefix be null.
|
|
818
|
+
*/
|
|
819
|
+
if (requireWellFormed && localNameSet)
|
|
820
|
+
localNameSet.set(attr.namespaceURI, attr.localName);
|
|
821
|
+
var attributeNamespace = attr.namespaceURI;
|
|
822
|
+
var candidatePrefix = null;
|
|
823
|
+
/** 3.5. If attribute namespace is not null, then run these sub-steps: */
|
|
824
|
+
if (attributeNamespace !== null) {
|
|
825
|
+
/**
|
|
826
|
+
* 3.5.1. Let candidate prefix be the result of retrieving a preferred
|
|
827
|
+
* prefix string from map given namespace attribute namespace with
|
|
828
|
+
* preferred prefix being attr's prefix value.
|
|
829
|
+
*/
|
|
830
|
+
candidatePrefix = map.get(attr.prefix, attributeNamespace);
|
|
831
|
+
/**
|
|
832
|
+
* 3.5.2. If the value of attribute namespace is the XMLNS namespace,
|
|
833
|
+
* then run these steps:
|
|
834
|
+
*/
|
|
835
|
+
if (attributeNamespace === infra_1.namespace.XMLNS) {
|
|
836
|
+
/**
|
|
837
|
+
* 3.5.2.1. If any of the following are true, then stop running these
|
|
838
|
+
* steps and goto Loop to visit the next attribute:
|
|
839
|
+
* - the attr's value is the XML namespace;
|
|
840
|
+
* _Note:_ The XML namespace cannot be redeclared and survive
|
|
841
|
+
* round-tripping (unless it defines the prefix "xml"). To avoid this
|
|
842
|
+
* problem, this algorithm always prefixes elements in the XML
|
|
843
|
+
* namespace with "xml" and drops any related definitions as seen
|
|
844
|
+
* in the above condition.
|
|
845
|
+
* - the attr's prefix is null and the ignore namespace definition
|
|
846
|
+
* attribute flag is true (the Element's default namespace attribute
|
|
847
|
+
* should be skipped);
|
|
848
|
+
* - the attr's prefix is not null and either
|
|
849
|
+
* * the attr's localName is not a key contained in the local
|
|
850
|
+
* prefixes map, or
|
|
851
|
+
* * the attr's localName is present in the local prefixes map but
|
|
852
|
+
* the value of the key does not match attr's value
|
|
853
|
+
* and furthermore that the attr's localName (as the prefix to find)
|
|
854
|
+
* is found in the namespace prefix map given the namespace consisting
|
|
855
|
+
* of the attr's value (the current namespace prefix definition was
|
|
856
|
+
* exactly defined previously--on an ancestor element not the current
|
|
857
|
+
* element whose attributes are being processed).
|
|
858
|
+
*/
|
|
859
|
+
if (attr.value === infra_1.namespace.XML ||
|
|
860
|
+
(attr.prefix === null && ignoreNamespaceDefinitionAttribute) ||
|
|
861
|
+
(attr.prefix !== null && (!(attr.localName in localPrefixesMap) ||
|
|
862
|
+
localPrefixesMap[attr.localName] !== attr.value) &&
|
|
863
|
+
map.has(attr.localName, attr.value)))
|
|
864
|
+
continue;
|
|
865
|
+
/**
|
|
866
|
+
* 3.5.2.2. If the require well-formed flag is set (its value is true),
|
|
867
|
+
* and the value of attr's value attribute matches the XMLNS
|
|
868
|
+
* namespace, then throw an exception; the serialization of this
|
|
869
|
+
* attribute would produce invalid XML because the XMLNS namespace
|
|
870
|
+
* is reserved and cannot be applied as an element's namespace via
|
|
871
|
+
* XML parsing.
|
|
872
|
+
*
|
|
873
|
+
* _Note:_ DOM APIs do allow creation of elements in the XMLNS
|
|
874
|
+
* namespace but with strict qualifications.
|
|
875
|
+
*/
|
|
876
|
+
if (requireWellFormed && attr.value === infra_1.namespace.XMLNS) {
|
|
877
|
+
throw new Error("XMLNS namespace is reserved (well-formed required).");
|
|
878
|
+
}
|
|
879
|
+
/**
|
|
880
|
+
* 3.5.2.3. If the require well-formed flag is set (its value is true),
|
|
881
|
+
* and the value of attr's value attribute is the empty string, then
|
|
882
|
+
* throw an exception; namespace prefix declarations cannot be used
|
|
883
|
+
* to undeclare a namespace (use a default namespace declaration
|
|
884
|
+
* instead).
|
|
885
|
+
*/
|
|
886
|
+
if (requireWellFormed && attr.value === '') {
|
|
887
|
+
throw new Error("Namespace prefix declarations cannot be used to undeclare a namespace (well-formed required).");
|
|
888
|
+
}
|
|
889
|
+
/**
|
|
890
|
+
* 3.5.2.4. the attr's prefix matches the string "xmlns", then let
|
|
891
|
+
* candidate prefix be the string "xmlns".
|
|
892
|
+
*/
|
|
893
|
+
if (attr.prefix === 'xmlns')
|
|
894
|
+
candidatePrefix = 'xmlns';
|
|
895
|
+
/**
|
|
896
|
+
* 3.5.3. Otherwise, the attribute namespace is not the XMLNS namespace.
|
|
897
|
+
* Run these steps:
|
|
898
|
+
*
|
|
899
|
+
* _Note:_ The (candidatePrefix === null) check is not in the spec.
|
|
900
|
+
* We deviate from the spec here. Otherwise a prefix is generated for
|
|
901
|
+
* all attributes with namespaces.
|
|
902
|
+
*/
|
|
903
|
+
}
|
|
904
|
+
else if (candidatePrefix === null) {
|
|
905
|
+
if (attr.prefix !== null &&
|
|
906
|
+
(!map.hasPrefix(attr.prefix) ||
|
|
907
|
+
map.has(attr.prefix, attributeNamespace))) {
|
|
908
|
+
/**
|
|
909
|
+
* Check if we can use the attribute's own prefix.
|
|
910
|
+
* We deviate from the spec here.
|
|
911
|
+
* TODO: This is not an efficient way of searching for prefixes.
|
|
912
|
+
* Follow developments to the spec.
|
|
913
|
+
*/
|
|
914
|
+
candidatePrefix = attr.prefix;
|
|
915
|
+
}
|
|
916
|
+
else {
|
|
917
|
+
/**
|
|
918
|
+
* 3.5.3.1. Let candidate prefix be the result of generating a prefix
|
|
919
|
+
* providing map, attribute namespace, and prefix index as input.
|
|
920
|
+
*/
|
|
921
|
+
candidatePrefix = this._generatePrefix(attributeNamespace, map, prefixIndex);
|
|
922
|
+
}
|
|
923
|
+
/**
|
|
924
|
+
* 3.5.3.2. Append the following to result, in the order listed:
|
|
925
|
+
* 3.5.3.2.1. " " (U+0020 SPACE);
|
|
926
|
+
* 3.5.3.2.2. The string "xmlns:";
|
|
927
|
+
* 3.5.3.2.3. The value of candidate prefix;
|
|
928
|
+
* 3.5.3.2.4. "="" (U+003D EQUALS SIGN, U+0022 QUOTATION MARK);
|
|
929
|
+
* 3.5.3.2.5. The result of serializing an attribute value given
|
|
930
|
+
* attribute namespace and the require well-formed flag as input;
|
|
931
|
+
* 3.5.3.2.6. """ (U+0022 QUOTATION MARK).
|
|
932
|
+
*/
|
|
933
|
+
result += " xmlns:" + candidatePrefix + "=\"" +
|
|
934
|
+
this._serializeAttributeValue(attributeNamespace, requireWellFormed) + "\"";
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
/**
|
|
938
|
+
* 3.6. Append a " " (U+0020 SPACE) to result.
|
|
939
|
+
* 3.7. If candidate prefix is not null, then append to result the
|
|
940
|
+
* concatenation of candidate prefix with ":" (U+003A COLON).
|
|
941
|
+
*/
|
|
942
|
+
result += " ";
|
|
943
|
+
if (candidatePrefix !== null) {
|
|
944
|
+
result += candidatePrefix + ':';
|
|
945
|
+
}
|
|
946
|
+
/**
|
|
947
|
+
* 3.8. If the require well-formed flag is set (its value is true), and
|
|
948
|
+
* this attr's localName attribute contains the character
|
|
949
|
+
* ":" (U+003A COLON) or does not match the XML Name production or
|
|
950
|
+
* equals "xmlns" and attribute namespace is null, then throw an
|
|
951
|
+
* exception; the serialization of this attr would not be a
|
|
952
|
+
* well-formed attribute.
|
|
953
|
+
*/
|
|
954
|
+
if (requireWellFormed && (attr.localName.indexOf(":") !== -1 ||
|
|
955
|
+
!algorithm_1.xml_isName(attr.localName) ||
|
|
956
|
+
(attr.localName === "xmlns" && attributeNamespace === null))) {
|
|
957
|
+
throw new Error("Attribute local name contains invalid characters (well-formed required).");
|
|
958
|
+
}
|
|
959
|
+
/**
|
|
960
|
+
* 3.9. Append the following strings to result, in the order listed:
|
|
961
|
+
* 3.9.1. The value of attr's localName;
|
|
962
|
+
* 3.9.2. "="" (U+003D EQUALS SIGN, U+0022 QUOTATION MARK);
|
|
963
|
+
* 3.9.3. The result of serializing an attribute value given attr's value
|
|
964
|
+
* attribute and the require well-formed flag as input;
|
|
965
|
+
* 3.9.4. """ (U+0022 QUOTATION MARK).
|
|
966
|
+
*/
|
|
967
|
+
result += attr.localName + "=\"" +
|
|
968
|
+
this._serializeAttributeValue(attr.value, requireWellFormed) + "\"";
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
972
|
+
finally {
|
|
973
|
+
try {
|
|
974
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
975
|
+
}
|
|
976
|
+
finally { if (e_4) throw e_4.error; }
|
|
977
|
+
}
|
|
978
|
+
/**
|
|
979
|
+
* 4. Return the value of result.
|
|
980
|
+
*/
|
|
981
|
+
return result;
|
|
982
|
+
};
|
|
983
|
+
/**
|
|
984
|
+
* Records namespace information for the given element and returns the
|
|
985
|
+
* default namespace attribute value.
|
|
986
|
+
*
|
|
987
|
+
* @param node - element node to process
|
|
988
|
+
* @param map - namespace prefix map
|
|
989
|
+
* @param localPrefixesMap - local prefixes map
|
|
990
|
+
*/
|
|
991
|
+
XMLSerializerImpl.prototype._recordNamespaceInformation = function (node, map, localPrefixesMap) {
|
|
992
|
+
var e_5, _a;
|
|
993
|
+
/**
|
|
994
|
+
* 1. Let default namespace attr value be null.
|
|
995
|
+
*/
|
|
996
|
+
var defaultNamespaceAttrValue = null;
|
|
997
|
+
try {
|
|
998
|
+
/**
|
|
999
|
+
* 2. Main: For each attribute attr in element's attributes, in the order
|
|
1000
|
+
* they are specified in the element's attribute list:
|
|
1001
|
+
*/
|
|
1002
|
+
for (var _b = __values(node.attributes), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1003
|
+
var attr = _c.value;
|
|
1004
|
+
/**
|
|
1005
|
+
* _Note:_ The following conditional steps find namespace prefixes. Only
|
|
1006
|
+
* attributes in the XMLNS namespace are considered (e.g., attributes made
|
|
1007
|
+
* to look like namespace declarations via
|
|
1008
|
+
* setAttribute("xmlns:pretend-prefix", "pretend-namespace") are not
|
|
1009
|
+
* included).
|
|
1010
|
+
*/
|
|
1011
|
+
/** 2.1. Let attribute namespace be the value of attr's namespaceURI value. */
|
|
1012
|
+
var attributeNamespace = attr.namespaceURI;
|
|
1013
|
+
/** 2.2. Let attribute prefix be the value of attr's prefix. */
|
|
1014
|
+
var attributePrefix = attr.prefix;
|
|
1015
|
+
/** 2.3. If the attribute namespace is the XMLNS namespace, then: */
|
|
1016
|
+
if (attributeNamespace === infra_1.namespace.XMLNS) {
|
|
1017
|
+
/**
|
|
1018
|
+
* 2.3.1. If attribute prefix is null, then attr is a default namespace
|
|
1019
|
+
* declaration. Set the default namespace attr value to attr's value and
|
|
1020
|
+
* stop running these steps, returning to Main to visit the next
|
|
1021
|
+
* attribute.
|
|
1022
|
+
*/
|
|
1023
|
+
if (attributePrefix === null) {
|
|
1024
|
+
defaultNamespaceAttrValue = attr.value;
|
|
1025
|
+
continue;
|
|
1026
|
+
/**
|
|
1027
|
+
* 2.3.2. Otherwise, the attribute prefix is not null and attr is a
|
|
1028
|
+
* namespace prefix definition. Run the following steps:
|
|
1029
|
+
*/
|
|
1030
|
+
}
|
|
1031
|
+
else {
|
|
1032
|
+
/** 2.3.2.1. Let prefix definition be the value of attr's localName. */
|
|
1033
|
+
var prefixDefinition = attr.localName;
|
|
1034
|
+
/** 2.3.2.2. Let namespace definition be the value of attr's value. */
|
|
1035
|
+
var namespaceDefinition = attr.value;
|
|
1036
|
+
/**
|
|
1037
|
+
* 2.3.2.3. If namespace definition is the XML namespace, then stop
|
|
1038
|
+
* running these steps, and return to Main to visit the next
|
|
1039
|
+
* attribute.
|
|
1040
|
+
*
|
|
1041
|
+
* _Note:_ XML namespace definitions in prefixes are completely
|
|
1042
|
+
* ignored (in order to avoid unnecessary work when there might be
|
|
1043
|
+
* prefix conflicts). XML namespaced elements are always handled
|
|
1044
|
+
* uniformly by prefixing (and overriding if necessary) the element's
|
|
1045
|
+
* localname with the reserved "xml" prefix.
|
|
1046
|
+
*/
|
|
1047
|
+
if (namespaceDefinition === infra_1.namespace.XML) {
|
|
1048
|
+
continue;
|
|
1049
|
+
}
|
|
1050
|
+
/**
|
|
1051
|
+
* 2.3.2.4. If namespace definition is the empty string (the
|
|
1052
|
+
* declarative form of having no namespace), then let namespace
|
|
1053
|
+
* definition be null instead.
|
|
1054
|
+
*/
|
|
1055
|
+
if (namespaceDefinition === '') {
|
|
1056
|
+
namespaceDefinition = null;
|
|
1057
|
+
}
|
|
1058
|
+
/**
|
|
1059
|
+
* 2.3.2.5. If prefix definition is found in map given the namespace
|
|
1060
|
+
* namespace definition, then stop running these steps, and return to
|
|
1061
|
+
* Main to visit the next attribute.
|
|
1062
|
+
*
|
|
1063
|
+
* _Note:_ This step avoids adding duplicate prefix definitions for
|
|
1064
|
+
* the same namespace in the map. This has the side-effect of avoiding
|
|
1065
|
+
* later serialization of duplicate namespace prefix declarations in
|
|
1066
|
+
* any descendant nodes.
|
|
1067
|
+
*/
|
|
1068
|
+
if (map.has(prefixDefinition, namespaceDefinition)) {
|
|
1069
|
+
continue;
|
|
1070
|
+
}
|
|
1071
|
+
/**
|
|
1072
|
+
* 2.3.2.6. Add the prefix prefix definition to map given namespace
|
|
1073
|
+
* namespace definition.
|
|
1074
|
+
*/
|
|
1075
|
+
map.set(prefixDefinition, namespaceDefinition);
|
|
1076
|
+
/**
|
|
1077
|
+
* 2.3.2.7. Add the value of prefix definition as a new key to the
|
|
1078
|
+
* local prefixes map, with the namespace definition as the key's
|
|
1079
|
+
* value replacing the value of null with the empty string if
|
|
1080
|
+
* applicable.
|
|
1081
|
+
*/
|
|
1082
|
+
localPrefixesMap[prefixDefinition] = namespaceDefinition || '';
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
1087
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
1088
|
+
finally {
|
|
1089
|
+
try {
|
|
1090
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1091
|
+
}
|
|
1092
|
+
finally { if (e_5) throw e_5.error; }
|
|
1093
|
+
}
|
|
1094
|
+
/**
|
|
1095
|
+
* 3. Return the value of default namespace attr value.
|
|
1096
|
+
*
|
|
1097
|
+
* _Note:_ The empty string is a legitimate return value and is not
|
|
1098
|
+
* converted to null.
|
|
1099
|
+
*/
|
|
1100
|
+
return defaultNamespaceAttrValue;
|
|
1101
|
+
};
|
|
1102
|
+
/**
|
|
1103
|
+
* Generates a new prefix for the given namespace.
|
|
1104
|
+
*
|
|
1105
|
+
* @param newNamespace - a namespace to generate prefix for
|
|
1106
|
+
* @param prefixMap - namespace prefix map
|
|
1107
|
+
* @param prefixIndex - generated namespace prefix index
|
|
1108
|
+
*/
|
|
1109
|
+
XMLSerializerImpl.prototype._generatePrefix = function (newNamespace, prefixMap, prefixIndex) {
|
|
1110
|
+
/**
|
|
1111
|
+
* 1. Let generated prefix be the concatenation of the string "ns" and the
|
|
1112
|
+
* current numerical value of prefix index.
|
|
1113
|
+
* 2. Let the value of prefix index be incremented by one.
|
|
1114
|
+
* 3. Add to map the generated prefix given the new namespace namespace.
|
|
1115
|
+
* 4. Return the value of generated prefix.
|
|
1116
|
+
*/
|
|
1117
|
+
var generatedPrefix = "ns" + prefixIndex.value;
|
|
1118
|
+
prefixIndex.value++;
|
|
1119
|
+
prefixMap.set(generatedPrefix, newNamespace);
|
|
1120
|
+
return generatedPrefix;
|
|
1121
|
+
};
|
|
1122
|
+
/**
|
|
1123
|
+
* Produces an XML serialization of an attribute value.
|
|
1124
|
+
*
|
|
1125
|
+
* @param value - attribute value
|
|
1126
|
+
* @param requireWellFormed - whether to check conformance
|
|
1127
|
+
*/
|
|
1128
|
+
XMLSerializerImpl.prototype._serializeAttributeValue = function (value, requireWellFormed) {
|
|
1129
|
+
/**
|
|
1130
|
+
* From: https://w3c.github.io/DOM-Parsing/#dfn-serializing-an-attribute-value
|
|
1131
|
+
*
|
|
1132
|
+
* 1. If the require well-formed flag is set (its value is true), and
|
|
1133
|
+
* attribute value contains characters that are not matched by the XML Char
|
|
1134
|
+
* production, then throw an exception; the serialization of this attribute
|
|
1135
|
+
* value would fail to produce a well-formed element serialization.
|
|
1136
|
+
*/
|
|
1137
|
+
if (requireWellFormed && value !== null && !algorithm_1.xml_isLegalChar(value)) {
|
|
1138
|
+
throw new Error("Invalid characters in attribute value.");
|
|
1139
|
+
}
|
|
1140
|
+
/**
|
|
1141
|
+
* 2. If attribute value is null, then return the empty string.
|
|
1142
|
+
*/
|
|
1143
|
+
if (value === null)
|
|
1144
|
+
return "";
|
|
1145
|
+
/**
|
|
1146
|
+
* 3. Otherwise, attribute value is a string. Return the value of attribute
|
|
1147
|
+
* value, first replacing any occurrences of the following:
|
|
1148
|
+
* - "&" with "&"
|
|
1149
|
+
* - """ with """
|
|
1150
|
+
* - "<" with "<"
|
|
1151
|
+
* - ">" with ">"
|
|
1152
|
+
* NOTE
|
|
1153
|
+
* This matches behavior present in browsers, and goes above and beyond the
|
|
1154
|
+
* grammar requirement in the XML specification's AttValue production by
|
|
1155
|
+
* also replacing ">" characters.
|
|
1156
|
+
*/
|
|
1157
|
+
var result = "";
|
|
1158
|
+
for (var i = 0; i < value.length; i++) {
|
|
1159
|
+
var c = value[i];
|
|
1160
|
+
if (c === "\"")
|
|
1161
|
+
result += """;
|
|
1162
|
+
else if (c === "&")
|
|
1163
|
+
result += "&";
|
|
1164
|
+
else if (c === "<")
|
|
1165
|
+
result += "<";
|
|
1166
|
+
else if (c === ">")
|
|
1167
|
+
result += ">";
|
|
1168
|
+
else
|
|
1169
|
+
result += c;
|
|
1170
|
+
}
|
|
1171
|
+
return result;
|
|
1172
|
+
};
|
|
1173
|
+
/**
|
|
1174
|
+
* Produces an XML serialization of an element node.
|
|
1175
|
+
*
|
|
1176
|
+
* @param node - node to serialize
|
|
1177
|
+
* @param requireWellFormed - whether to check conformance
|
|
1178
|
+
*/
|
|
1179
|
+
XMLSerializerImpl.prototype._serializeElement = function (node, requireWellFormed) {
|
|
1180
|
+
var e_6, _a;
|
|
1181
|
+
/**
|
|
1182
|
+
* From: https://w3c.github.io/DOM-Parsing/#xml-serializing-an-element-node
|
|
1183
|
+
*
|
|
1184
|
+
* 1. If the require well-formed flag is set (its value is true), and this
|
|
1185
|
+
* node's localName attribute contains the character ":" (U+003A COLON) or
|
|
1186
|
+
* does not match the XML Name production, then throw an exception; the
|
|
1187
|
+
* serialization of this node would not be a well-formed element.
|
|
1188
|
+
*/
|
|
1189
|
+
if (requireWellFormed && (node.localName.indexOf(":") !== -1 ||
|
|
1190
|
+
!algorithm_1.xml_isName(node.localName))) {
|
|
1191
|
+
throw new Error("Node local name contains invalid characters (well-formed required).");
|
|
1192
|
+
}
|
|
1193
|
+
/**
|
|
1194
|
+
* 2. Let markup be the string "<" (U+003C LESS-THAN SIGN).
|
|
1195
|
+
* 3. Let qualified name be an empty string.
|
|
1196
|
+
* 4. Let skip end tag be a boolean flag with value false.
|
|
1197
|
+
* 5. Let ignore namespace definition attribute be a boolean flag with value
|
|
1198
|
+
* false.
|
|
1199
|
+
* 6. Given prefix map, copy a namespace prefix map and let map be the
|
|
1200
|
+
* result.
|
|
1201
|
+
* 7. Let local prefixes map be an empty map. The map has unique Node prefix
|
|
1202
|
+
* strings as its keys, with corresponding namespaceURI Node values as the
|
|
1203
|
+
* map's key values (in this map, the null namespace is represented by the
|
|
1204
|
+
* empty string).
|
|
1205
|
+
*
|
|
1206
|
+
* _Note:_ This map is local to each element. It is used to ensure there
|
|
1207
|
+
* are no conflicting prefixes should a new namespace prefix attribute need
|
|
1208
|
+
* to be generated. It is also used to enable skipping of duplicate prefix
|
|
1209
|
+
* definitions when writing an element's attributes: the map allows the
|
|
1210
|
+
* algorithm to distinguish between a prefix in the namespace prefix map
|
|
1211
|
+
* that might be locally-defined (to the current Element) and one that is
|
|
1212
|
+
* not.
|
|
1213
|
+
* 8. Let local default namespace be the result of recording the namespace
|
|
1214
|
+
* information for node given map and local prefixes map.
|
|
1215
|
+
*
|
|
1216
|
+
* _Note:_ The above step will update map with any found namespace prefix
|
|
1217
|
+
* definitions, add the found prefix definitions to the local prefixes map
|
|
1218
|
+
* and return a local default namespace value defined by a default namespace
|
|
1219
|
+
* attribute if one exists. Otherwise it returns null.
|
|
1220
|
+
* 9. Let inherited ns be a copy of namespace.
|
|
1221
|
+
* 10. Let ns be the value of node's namespaceURI attribute.
|
|
1222
|
+
*/
|
|
1223
|
+
var skipEndTag = false;
|
|
1224
|
+
/** 11. If inherited ns is equal to ns, then: */
|
|
1225
|
+
/**
|
|
1226
|
+
* 11.1. If local default namespace is not null, then set ignore
|
|
1227
|
+
* namespace definition attribute to true.
|
|
1228
|
+
* 11.2. If ns is the XML namespace, then append to qualified name the
|
|
1229
|
+
* concatenation of the string "xml:" and the value of node's localName.
|
|
1230
|
+
* 11.3. Otherwise, append to qualified name the value of node's
|
|
1231
|
+
* localName. The node's prefix if it exists, is dropped.
|
|
1232
|
+
*/
|
|
1233
|
+
var qualifiedName = node.localName;
|
|
1234
|
+
/** 11.4. Append the value of qualified name to markup. */
|
|
1235
|
+
var markup = "<" + qualifiedName;
|
|
1236
|
+
/**
|
|
1237
|
+
* 13. Append to markup the result of the XML serialization of node's
|
|
1238
|
+
* attributes given map, prefix index, local prefixes map, ignore namespace
|
|
1239
|
+
* definition attribute flag, and require well-formed flag.
|
|
1240
|
+
*/
|
|
1241
|
+
markup += this._serializeAttributes(node, requireWellFormed);
|
|
1242
|
+
/**
|
|
1243
|
+
* 14. If ns is the HTML namespace, and the node's list of children is
|
|
1244
|
+
* empty, and the node's localName matches any one of the following void
|
|
1245
|
+
* elements: "area", "base", "basefont", "bgsound", "br", "col", "embed",
|
|
1246
|
+
* "frame", "hr", "img", "input", "keygen", "link", "menuitem", "meta",
|
|
1247
|
+
* "param", "source", "track", "wbr"; then append the following to markup,
|
|
1248
|
+
* in the order listed:
|
|
1249
|
+
* 14.1. " " (U+0020 SPACE);
|
|
1250
|
+
* 14.2. "/" (U+002F SOLIDUS).
|
|
1251
|
+
* and set the skip end tag flag to true.
|
|
1252
|
+
* 15. If ns is not the HTML namespace, and the node's list of children is
|
|
1253
|
+
* empty, then append "/" (U+002F SOLIDUS) to markup and set the skip end
|
|
1254
|
+
* tag flag to true.
|
|
1255
|
+
* 16. Append ">" (U+003E GREATER-THAN SIGN) to markup.
|
|
1256
|
+
*/
|
|
1257
|
+
if (node._children.size === 0) {
|
|
1258
|
+
markup += "/";
|
|
1259
|
+
skipEndTag = true;
|
|
1260
|
+
}
|
|
1261
|
+
markup += ">";
|
|
1262
|
+
/**
|
|
1263
|
+
* 17. If the value of skip end tag is true, then return the value of markup
|
|
1264
|
+
* and skip the remaining steps. The node is a leaf-node.
|
|
1265
|
+
*/
|
|
1266
|
+
if (skipEndTag)
|
|
1267
|
+
return markup;
|
|
1268
|
+
try {
|
|
1269
|
+
/**
|
|
1270
|
+
* 18. If ns is the HTML namespace, and the node's localName matches the
|
|
1271
|
+
* string "template", then this is a template element. Append to markup the
|
|
1272
|
+
* result of XML serializing a DocumentFragment node given the template
|
|
1273
|
+
* element's template contents (a DocumentFragment), providing inherited
|
|
1274
|
+
* ns, map, prefix index, and the require well-formed flag.
|
|
1275
|
+
*
|
|
1276
|
+
* _Note:_ This allows template content to round-trip, given the rules for
|
|
1277
|
+
* parsing XHTML documents.
|
|
1278
|
+
*
|
|
1279
|
+
* 19. Otherwise, append to markup the result of running the XML
|
|
1280
|
+
* serialization algorithm on each of node's children, in tree order,
|
|
1281
|
+
* providing inherited ns, map, prefix index, and the require well-formed
|
|
1282
|
+
* flag.
|
|
1283
|
+
*/
|
|
1284
|
+
for (var _b = __values(node._children), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1285
|
+
var childNode = _c.value;
|
|
1286
|
+
markup += this._serializeNode(childNode, requireWellFormed);
|
|
1287
|
+
}
|
|
1288
|
+
}
|
|
1289
|
+
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
1290
|
+
finally {
|
|
1291
|
+
try {
|
|
1292
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1293
|
+
}
|
|
1294
|
+
finally { if (e_6) throw e_6.error; }
|
|
1295
|
+
}
|
|
1296
|
+
/**
|
|
1297
|
+
* 20. Append the following to markup, in the order listed:
|
|
1298
|
+
* 20.1. "</" (U+003C LESS-THAN SIGN, U+002F SOLIDUS);
|
|
1299
|
+
* 20.2. The value of qualified name;
|
|
1300
|
+
* 20.3. ">" (U+003E GREATER-THAN SIGN).
|
|
1301
|
+
*/
|
|
1302
|
+
markup += "</" + qualifiedName + ">";
|
|
1303
|
+
/**
|
|
1304
|
+
* 21. Return the value of markup.
|
|
1305
|
+
*/
|
|
1306
|
+
return markup;
|
|
1307
|
+
};
|
|
1308
|
+
/**
|
|
1309
|
+
* Produces an XML serialization of a document node.
|
|
1310
|
+
*
|
|
1311
|
+
* @param node - node to serialize
|
|
1312
|
+
* @param requireWellFormed - whether to check conformance
|
|
1313
|
+
*/
|
|
1314
|
+
XMLSerializerImpl.prototype._serializeDocument = function (node, requireWellFormed) {
|
|
1315
|
+
var e_7, _a;
|
|
1316
|
+
/**
|
|
1317
|
+
* If the require well-formed flag is set (its value is true), and this node
|
|
1318
|
+
* has no documentElement (the documentElement attribute's value is null),
|
|
1319
|
+
* then throw an exception; the serialization of this node would not be a
|
|
1320
|
+
* well-formed document.
|
|
1321
|
+
*/
|
|
1322
|
+
if (requireWellFormed && node.documentElement === null) {
|
|
1323
|
+
throw new Error("Missing document element (well-formed required).");
|
|
1324
|
+
}
|
|
1325
|
+
/**
|
|
1326
|
+
* Otherwise, run the following steps:
|
|
1327
|
+
* 1. Let serialized document be an empty string.
|
|
1328
|
+
* 2. For each child child of node, in tree order, run the XML
|
|
1329
|
+
* serialization algorithm on the child passing along the provided
|
|
1330
|
+
* arguments, and append the result to serialized document.
|
|
1331
|
+
*
|
|
1332
|
+
* _Note:_ This will serialize any number of ProcessingInstruction and
|
|
1333
|
+
* Comment nodes both before and after the Document's documentElement node,
|
|
1334
|
+
* including at most one DocumentType node. (Text nodes are not allowed as
|
|
1335
|
+
* children of the Document.)
|
|
1336
|
+
*
|
|
1337
|
+
* 3. Return the value of serialized document.
|
|
1338
|
+
*/
|
|
1339
|
+
var serializedDocument = "";
|
|
1340
|
+
try {
|
|
1341
|
+
for (var _b = __values(node._children), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1342
|
+
var childNode = _c.value;
|
|
1343
|
+
serializedDocument += this._serializeNode(childNode, requireWellFormed);
|
|
1344
|
+
}
|
|
1345
|
+
}
|
|
1346
|
+
catch (e_7_1) { e_7 = { error: e_7_1 }; }
|
|
1347
|
+
finally {
|
|
1348
|
+
try {
|
|
1349
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1350
|
+
}
|
|
1351
|
+
finally { if (e_7) throw e_7.error; }
|
|
1352
|
+
}
|
|
1353
|
+
return serializedDocument;
|
|
1354
|
+
};
|
|
1355
|
+
/**
|
|
1356
|
+
* Produces an XML serialization of a document fragment node.
|
|
1357
|
+
*
|
|
1358
|
+
* @param node - node to serialize
|
|
1359
|
+
* @param requireWellFormed - whether to check conformance
|
|
1360
|
+
*/
|
|
1361
|
+
XMLSerializerImpl.prototype._serializeDocumentFragment = function (node, requireWellFormed) {
|
|
1362
|
+
var e_8, _a;
|
|
1363
|
+
/**
|
|
1364
|
+
* 1. Let markup the empty string.
|
|
1365
|
+
* 2. For each child child of node, in tree order, run the XML serialization
|
|
1366
|
+
* algorithm on the child given namespace, prefix map, a reference to prefix
|
|
1367
|
+
* index, and flag require well-formed. Concatenate the result to markup.
|
|
1368
|
+
* 3. Return the value of markup.
|
|
1369
|
+
*/
|
|
1370
|
+
var markup = "";
|
|
1371
|
+
try {
|
|
1372
|
+
for (var _b = __values(node._children), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1373
|
+
var childNode = _c.value;
|
|
1374
|
+
markup += this._serializeNode(childNode, requireWellFormed);
|
|
1375
|
+
}
|
|
1376
|
+
}
|
|
1377
|
+
catch (e_8_1) { e_8 = { error: e_8_1 }; }
|
|
1378
|
+
finally {
|
|
1379
|
+
try {
|
|
1380
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1381
|
+
}
|
|
1382
|
+
finally { if (e_8) throw e_8.error; }
|
|
1383
|
+
}
|
|
1384
|
+
return markup;
|
|
1385
|
+
};
|
|
1386
|
+
/**
|
|
1387
|
+
* Produces an XML serialization of the attributes of an element node.
|
|
1388
|
+
*
|
|
1389
|
+
* @param node - node to serialize
|
|
1390
|
+
* @param requireWellFormed - whether to check conformance
|
|
1391
|
+
*/
|
|
1392
|
+
XMLSerializerImpl.prototype._serializeAttributes = function (node, requireWellFormed) {
|
|
1393
|
+
var e_9, _a;
|
|
1394
|
+
/**
|
|
1395
|
+
* 1. Let result be the empty string.
|
|
1396
|
+
* 2. Let localname set be a new empty namespace localname set. This
|
|
1397
|
+
* localname set will contain tuples of unique attribute namespaceURI and
|
|
1398
|
+
* localName pairs, and is populated as each attr is processed. This set is
|
|
1399
|
+
* used to [optionally] enforce the well-formed constraint that an element
|
|
1400
|
+
* cannot have two attributes with the same namespaceURI and localName.
|
|
1401
|
+
* This can occur when two otherwise identical attributes on the same
|
|
1402
|
+
* element differ only by their prefix values.
|
|
1403
|
+
*/
|
|
1404
|
+
var result = "";
|
|
1405
|
+
var localNameSet = requireWellFormed ? {} : undefined;
|
|
1406
|
+
try {
|
|
1407
|
+
/**
|
|
1408
|
+
* 3. Loop: For each attribute attr in element's attributes, in the order
|
|
1409
|
+
* they are specified in the element's attribute list:
|
|
1410
|
+
*/
|
|
1411
|
+
for (var _b = __values(node.attributes), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1412
|
+
var attr = _c.value;
|
|
1413
|
+
/**
|
|
1414
|
+
* 3.1. If the require well-formed flag is set (its value is true), and the
|
|
1415
|
+
* localname set contains a tuple whose values match those of a new tuple
|
|
1416
|
+
* consisting of attr's namespaceURI attribute and localName attribute,
|
|
1417
|
+
* then throw an exception; the serialization of this attr would fail to
|
|
1418
|
+
* produce a well-formed element serialization.
|
|
1419
|
+
*/
|
|
1420
|
+
if (requireWellFormed && localNameSet && (attr.localName in localNameSet)) {
|
|
1421
|
+
throw new Error("Element contains duplicate attributes (well-formed required).");
|
|
1422
|
+
}
|
|
1423
|
+
/**
|
|
1424
|
+
* 3.2. Create a new tuple consisting of attr's namespaceURI attribute and
|
|
1425
|
+
* localName attribute, and add it to the localname set.
|
|
1426
|
+
* 3.3. Let attribute namespace be the value of attr's namespaceURI value.
|
|
1427
|
+
* 3.4. Let candidate prefix be null.
|
|
1428
|
+
*/
|
|
1429
|
+
if (requireWellFormed && localNameSet)
|
|
1430
|
+
localNameSet[attr.localName] = true;
|
|
1431
|
+
/** 3.5. If attribute namespace is not null, then run these sub-steps: */
|
|
1432
|
+
/**
|
|
1433
|
+
* 3.6. Append a " " (U+0020 SPACE) to result.
|
|
1434
|
+
* 3.7. If candidate prefix is not null, then append to result the
|
|
1435
|
+
* concatenation of candidate prefix with ":" (U+003A COLON).
|
|
1436
|
+
*/
|
|
1437
|
+
/**
|
|
1438
|
+
* 3.8. If the require well-formed flag is set (its value is true), and
|
|
1439
|
+
* this attr's localName attribute contains the character
|
|
1440
|
+
* ":" (U+003A COLON) or does not match the XML Name production or
|
|
1441
|
+
* equals "xmlns" and attribute namespace is null, then throw an
|
|
1442
|
+
* exception; the serialization of this attr would not be a
|
|
1443
|
+
* well-formed attribute.
|
|
1444
|
+
*/
|
|
1445
|
+
if (requireWellFormed && (attr.localName.indexOf(":") !== -1 ||
|
|
1446
|
+
!algorithm_1.xml_isName(attr.localName))) {
|
|
1447
|
+
throw new Error("Attribute local name contains invalid characters (well-formed required).");
|
|
1448
|
+
}
|
|
1449
|
+
/**
|
|
1450
|
+
* 3.9. Append the following strings to result, in the order listed:
|
|
1451
|
+
* 3.9.1. The value of attr's localName;
|
|
1452
|
+
* 3.9.2. "="" (U+003D EQUALS SIGN, U+0022 QUOTATION MARK);
|
|
1453
|
+
* 3.9.3. The result of serializing an attribute value given attr's value
|
|
1454
|
+
* attribute and the require well-formed flag as input;
|
|
1455
|
+
* 3.9.4. """ (U+0022 QUOTATION MARK).
|
|
1456
|
+
*/
|
|
1457
|
+
result += " " + attr.localName + "=\"" +
|
|
1458
|
+
this._serializeAttributeValue(attr.value, requireWellFormed) + "\"";
|
|
1459
|
+
}
|
|
1460
|
+
}
|
|
1461
|
+
catch (e_9_1) { e_9 = { error: e_9_1 }; }
|
|
1462
|
+
finally {
|
|
1463
|
+
try {
|
|
1464
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1465
|
+
}
|
|
1466
|
+
finally { if (e_9) throw e_9.error; }
|
|
1467
|
+
}
|
|
1468
|
+
/**
|
|
1469
|
+
* 4. Return the value of result.
|
|
1470
|
+
*/
|
|
1471
|
+
return result;
|
|
1472
|
+
};
|
|
1473
|
+
XMLSerializerImpl._VoidElementNames = new Set(['area', 'base', 'basefont',
|
|
1474
|
+
'bgsound', 'br', 'col', 'embed', 'frame', 'hr', 'img', 'input', 'keygen',
|
|
1475
|
+
'link', 'menuitem', 'meta', 'param', 'source', 'track', 'wbr']);
|
|
1476
|
+
return XMLSerializerImpl;
|
|
1477
|
+
}());
|
|
1478
|
+
exports.XMLSerializerImpl = XMLSerializerImpl;
|
|
1479
|
+
//# sourceMappingURL=XMLSerializerImpl.js.map
|