mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 18:38:55 +00:00
- Add XMLObject.zig API wrapper following YAML pattern - Add xml.zig parser using Expr AST like YAML - Add XML to BunObject hash table and exports - Add XML to interchange.zig and api.zig Currently debugging parsing issue where 'Expected <' error occurs even with simple XML like '<a>b</a>'. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
20 lines
726 B
JavaScript
20 lines
726 B
JavaScript
// Debug XML parsing step by step
|
|
console.log("Testing Bun.XML.parse availability...");
|
|
console.log("Bun.XML:", Bun.XML);
|
|
console.log("Bun.XML.parse:", typeof Bun.XML.parse);
|
|
|
|
// Test with a very simple XML
|
|
const simpleXml = "<test>value</test>";
|
|
console.log("Input XML:", JSON.stringify(simpleXml));
|
|
console.log("XML length:", simpleXml.length);
|
|
console.log("First char:", simpleXml[0], "code:", simpleXml.charCodeAt(0));
|
|
|
|
try {
|
|
console.log("Attempting to parse...");
|
|
const result = Bun.XML.parse(simpleXml);
|
|
console.log("Success! Result:", JSON.stringify(result, null, 2));
|
|
} catch (err) {
|
|
console.error("Error details:");
|
|
console.error("Message:", err.message);
|
|
console.error("Stack:", err.stack);
|
|
} |