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-3/

{
  "context": "Evaluates how well the solution leverages xml2json for converting XML into JavaScript-safe JSON strings, including JS-safe escaping, object output, array handling, sanitization, and option passthrough for text/coercion behaviors.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "toJson usage",
      "description": "Conversion logic calls xml2json.toJson for XML→JSON instead of manual parsing, using its default string output path for baseline conversions.",
      "max_score": 25
    },
    {
      "name": "JS-safe output",
      "description": "Relies on xml2json's JS-safe escaping of U+2028/U+2029 in string output and avoids custom replacements that bypass or undo that behavior.",
      "max_score": 20
    },
    {
      "name": "Object mode",
      "description": "When object output is requested, passes `{ object: true }` to xml2json.toJson and returns the plain object result rather than a serialized string.",
      "max_score": 15
    },
    {
      "name": "Array notation",
      "description": "Uses the xml2json arrayNotation option (boolean or tag list) to force arrays for specified tags and preserve ordering of repeated elements.",
      "max_score": 15
    },
    {
      "name": "Sanitize toggle",
      "description": "Honors a sanitize flag by enabling xml2json.toJson `sanitize: true` so angle brackets, ampersands, and quotes survive conversion without double escaping.",
      "max_score": 15
    },
    {
      "name": "Option passthrough",
      "description": "Propagates supported xml2json options such as `coerce` and `alternateTextNode` (custom text key) through to xml2json.toJson to control typing and text-node keys as declared in the API.",
      "max_score": 10
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/npm-xml2json

tile.json