@plurnk/plurnk-mimetypes-application-xml
v0.1.2
Published
application/xml and text/xml mimetype handler for plurnk-service. DOM-tree extraction via @xmldom/xmldom; xpath via the xpath package; deep-json projection per framework #10.
Readme
@plurnk/plurnk-mimetypes-application-xml
application/xml AND text/xml mimetype handler for the plurnk ecosystem. DOM-tree extraction via @xmldom/xmldom; XPath 1.0 via xpath.
install
npm i @plurnk/plurnk-mimetypes-application-xmlwhat it does
Provides three channels per the framework's #10 contract:
- symbols (
extractRaw/preview) — root element as amodule; immediate children asfieldsymbols named byidattribute,nameattribute, or tag name (in that order of preference). Surfaces enough shape for the model to recognize "this is RSS / this is SOAP / this is a Maven pom" without dumping every leaf. - deep-json (
deepJson) — full DOM tree as nested objects. Each element:{ type: tagName, attrs: {...}, children: [...] }per the framework'sattrsconvention. Text-only elements collapse to atextfield; mixed content keeps text nodes as{ type: "#text", text }siblings. - deep-xml (framework-projected) — the deep-json projected back to XML via
projectJsonToXml. xpath queries like//book[@id='b1']/titlework naturally.
query() overrides the xpath dialect to run against the real DOM (via the xpath package's XPath 1.0 engine over xmldom). jsonpath inherits the framework's default dispatch against deepJson. regex and glob inherit text-based scanning.
license
MIT.
