CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-xml2json

Converts XML to JSON and vice-versa using node-expat parser

Overall
score

93%

Overview
Eval results
Files

rubric.jsonevals/scenario-8/

{
  "context": "Evaluates whether the solution leverages xml2json to produce reversible JSON with caller-controlled text node keys. Checks correct optioning for custom string keys, the `_t` shortcut, and the default `$t` behavior while preserving attributes in object output.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Library parsing",
      "description": "Uses xml2json's parsing API (not a custom XML parser) to perform the XML-to-JSON conversion.",
      "max_score": 15
    },
    {
      "name": "Object output",
      "description": "Invokes xml2json with `object: true` so the converter returns a JavaScript object rather than a JSON string.",
      "max_score": 15
    },
    {
      "name": "Reversible mode",
      "description": "Sets `reversible: true` when converting so text nodes are emitted under a dedicated key instead of collapsing element content.",
      "max_score": 15
    },
    {
      "name": "Custom string key",
      "description": "When `textKey` is a string, passes that value to xml2json via `alternateTextNode` to place text content under the requested property name.",
      "max_score": 20
    },
    {
      "name": "Short key toggle",
      "description": "When `textKey` is true, sets `alternateTextNode: true` so xml2json emits `_t` for text content as expected.",
      "max_score": 15
    },
    {
      "name": "Default `$t` fallback",
      "description": "When no text key is provided, relies on xml2json defaults (no `alternateTextNode` override) so text nodes appear under `$t` while attributes remain intact.",
      "max_score": 20
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/npm-xml2json

tile.json