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

{
  "context": "Evaluates whether the solution uses xml2json to turn catalog XML into JavaScript objects directly. Focuses on the object-return capability, attribute capture, array handling for repeated products, and trimmed text.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Object mode",
      "description": "Calls xml2json.toJson with the { object: true } option (or equivalent) so the converter returns a plain JS object instead of a JSON string, without relying on JSON.parse of string output.",
      "max_score": 45
    },
    {
      "name": "Attributes kept",
      "description": "Uses xml2json's attribute mapping so store name and product sku attributes survive in the returned object without custom XML parsing logic.",
      "max_score": 15
    },
    {
      "name": "Product array",
      "description": "Leverages xml2json's handling of repeated tags (default or arrayNotation for \"product\") so multiple <product> nodes become an ordered array in the object result.",
      "max_score": 15
    },
    {
      "name": "Trimmed text",
      "description": "Relies on xml2json's trimming behavior (default trim or explicit option) to remove leading/trailing whitespace from product names and prices instead of manual string cleanup after conversion.",
      "max_score": 15
    },
    {
      "name": "Buffer input",
      "description": "Accepts Buffer input by passing it directly to xml2json.toJson (or converting via package-supported flow) rather than pre-stringifying or rejecting Buffers.",
      "max_score": 10
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/npm-xml2json

tile.json