PageSourceSearch

https://exploremydata.com/assets/xmlToCsv-DiDxuxdQ.js

js exploremydata.com collected 2026-09-25 20:07:33 UTC 1,745 bytes, 1 lines download raw bytes

1import{parseXmlToJson as l}from"./xmlParser-BQP2i025.js";import{formatCount as a,previewFrom as d,textBlob as u,replaceExtension as h}from"./util-CkZ8KZK2.js";import{readText as f,outputDelimiterFrom as w,serializeTable as g}from"./csvShared-8k83eY5V.js";import{ndjsonToTable as p}from"./jsonFlatten-BvwKgkrC.js";import"./vendor-papaparse-Btpkh8vH.js";import"./cjs-helpers-D6-XlEtG.js";import"./detectTableRegion-B60ufQHb.js";import"./jsonRelaxed-DdfPn7XG.js";function P(r){return r==="at"?"@":""}function x(r,o={}){const{json:s,warning:t,paths:e,recordPath:c}=l(r,{recordPath:o.recordPath,attributePrefix:P(o.attributePrefix)}),n=p(s);return{columns:n.columns,rows:n.rows,warnings:t?[t,...n.warnings]:n.warnings,paths:e??[],recordPath:c??""}}function b(r,o){if(r.length<2)return;const s=r.map(e=>`${e.path} (${a(e.count)})`),t=r.find(e=>e.path===o);return{kind:"fields",columns:s,selected:t?{recordPath:`${t.path} (${a(t.count)})`}:{}}}function v(r){const o=(r.recordPath??"").trim();return o===""?r:{...r,recordPath:o.replace(/\s*\(\d[\d,]*\)$/,"")}}const z=async r=>{r.ctx.onProgress("Reading the XML…");const o=await f(r);r.ctx.onProgress("Detecting rows…");const s=x(o,v(r.options)),{columns:t,rows:e,warnings:c}=s,n=w(r.options),i=g(t,e,n.char),m=b(s.paths,s.recordPath);return{status:"ok",output:{filename:h(r.filename,n.extension),blob:u(i,n.extension==="tsv"?"text/tab-separated-values":"text/csv"),text:i,copyKind:"csv",preview:d(t,e,20),warnings:[...n.warnings,...c],summary:[`rows from <${s.recordPath}>`,`${a(e.length)} row${e.length===1?"":"s"}`,`${a(t.length)} column${t.length===1?"":"s"}`],...m?{discovered:m}:{}}}};export{z as default,P as readAttributePrefix,b as recordPathDiscovery,v as recordPathFrom,x as xmlToTable};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.