Neurotoxin Powered Marketing

    This package has been deprecated

    xml-trident

    1.0.3 • Public • Published

    xml-trident

    Three-way conversion between XML strings, DOM objects and JSONML representations of a DOM.

    Deprecation warning: This module is not maintained. Please see slimdom-sax-parser for the DOM parsing, or use the code in src/domToJsonml.js.

    API

    toString (input: Node|JsonML) : string
    
    toDom (input: string|JsonML) : DocumentNode
    
    toJsonml (input: string|Node) : JsonML
    

    JsonML additions

    While JsonML only provides an encoding for elements, attributes and text nodes, a secondary goal of this module is to losslessly convert to-and-fro as much as you want. Therefore some additions to JsonML have been made.

    • Elements, attributes, text nodes

      <p class="example">Paragraph</p>
      [
        "p",
        { "class": "example" },
        "Paragraph"
      ]
    • Processing instruction

      <?my-pi as an example ?>
      [
        "?my-pi",
        "as an example "
      ]
    • Comment

      <!-- an XML comment -->
      [
        "!",
        " an XML comment "
      ]
    • Document Type

      <!DOCTYPE html PUBLIC
          "-//W3C//DTD XHTML 1.0 Strict//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
      [
        "!DOCTYPE",
        "html",
        "-//W3C//DTD XHTML 1.0 Strict//EN",
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
      ]
    • Document node

      [
        "#document"
      ]

    Wishlist

    • CDATA

    Install

    npm i xml-trident

    DownloadsWeekly Downloads

    5

    Version

    1.0.3

    License

    MIT

    Unpacked Size

    7.28 kB

    Total Files

    3

    Last publish

    Collaborators

    • wybe.pizza