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

{
  "context": "Evaluates how the solution leverages xml2json to convert XML into JS objects with forced array notation, both globally and for selected tag names. Checks that results preserve source ordering and rely on package options instead of manual parsing.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "API usage",
      "description": "Parses XML via xml2json.toJson instead of manual XML handling, showing direct reliance on the package for conversions.",
      "max_score": 15
    },
    {
      "name": "Object output",
      "description": "Calls xml2json.toJson with the object option enabled to return plain objects without extra JSON.parse steps.",
      "max_score": 15
    },
    {
      "name": "Global arrays",
      "description": "Implements parseAllArrays using xml2json.toJson with arrayNotation: true so every element name becomes an array, including single occurrences.",
      "max_score": 30
    },
    {
      "name": "Selective arrays",
      "description": "Implements parseSelectiveArrays by passing the provided tag list to arrayNotation (as a string array) and leaving other element names untouched when they appear once.",
      "max_score": 30
    },
    {
      "name": "Order kept",
      "description": "Outputs keep the XML order of repeated elements from xml2json (no resorting or restructuring after conversion).",
      "max_score": 10
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/npm-xml2json

tile.json