<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/parsing-xml-without-library---tsoding-9tvih5rw6" -->

---
title: Parsing XML without Library - Tsoding | daily.dev
description: A live-coding stream walks through writing a minimal, dependency-free XML parser in the Jai programming language to extract layer information from an...
canonical: https://daily.dev/posts/parsing-xml-without-library---tsoding-9tvih5rw6
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Parsing XML without Library - Tsoding | daily.dev
og:description: A live-coding stream walks through writing a minimal, dependency-free XML parser in the Jai programming language to extract layer information from an...
og:url: https://daily.dev/posts/parsing-xml-without-library---tsoding-9tvih5rw6
og:image: https://api.daily.dev/og/posts/9tvih5rW6.png
og:image:alt: Parsing XML without Library - Tsoding
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Parsing XML without Library - Tsoding

**[Tsoding Daily](https://daily.dev/sources/tsoding_daily)** · 150 min read · 1 upvotes · 0 comments

## Summary

A live-coding stream walks through writing a minimal, dependency-free XML parser in the Jai programming language to extract layer information from an OpenRaster (.ora) file used in a pixel-art animation tool. The host argues against pulling in a full XML library when only a narrow subset of the spec is actually needed, iterating from a state-machine design to a simpler recursive-descent approach with functions like trim_name, expect_char, and skip_until_char, ultimately building a tree/DOM structure from tags and their properties in about 127 lines of code.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=j6Zt6cyJSXc>

## Questions this post answers

### How can I write a minimal XML parser without using a full XML library?

A minimal XML parser can be built by implementing only the subset of the spec actually needed, skipping full spec compliance like CDATA, entity escaping, or general text node handling. A working example extracting layer names, positions, and image paths from an OpenRaster stack.xml file was implemented in roughly 127 lines of code with no XML-specific dependency, using string trimming and a simple stack-based approach to build a tree of nodes with name and property fields.

_See how daily.dev surfaces similar hands-on parsing walkthroughs for developers weighing custom code versus a library._

### What is the OpenRaster (.ora) file format and how is it structured?

An OpenRaster file is a zip archive containing a mimetype file, a merged preview image, thumbnails, layer PNG images, and a stack.xml file describing how those layer images are grouped and positioned. It functions as an open-source equivalent to Photoshop's PSD format and can be edited in tools like Krita, making it useful for asset pipelines that need to reconstruct sprite atlases from individually editable layers.

_Developers building custom asset pipelines can find more format deep-dives like this through daily.dev._

### What is stride in image processing and how does it differ from width?

Stride is the number of elements you must skip in a linear pixel array to reach the start of the next row, while width is simply the number of pixels in one row of the visible image. They differ when working with sub-images inside a larger atlas: a sub-image might have a width of eight pixels but a stride of sixteen if it sits inside a wider parent image, since the linear memory layout still requires skipping the full parent row length.

_Anyone implementing image atlas or sub-image logic can dig into fundamentals like this via daily.dev._

## Similar posts on daily.dev

- [XML is a cheap DSL](https://daily.dev/posts/xml-is-a-cheap-dsl-nzs8ti7hg) · Lobsters · 0 upvotes · 0 comments
- [Parsers don’t have to be complicated](https://daily.dev/posts/parsers-don-t-have-to-be-complicated-hiriempgp) · Hacker News · 0 upvotes · 0 comments
- [Writing a tiny JSON Parser - Mostly nerdless](https://daily.dev/posts/writing-a-tiny-json-parser---mostly-nerdless-ozlnpgl7z) · Mostly Nerdless · 0 upvotes · 0 comments
- [Parsing Taiwanese Like Code](https://daily.dev/posts/parsing-taiwanese-like-code-cf3ktfvls) · Ruby Flow · 1 upvotes · 0 comments

---

[View this post on daily.dev](https://daily.dev/posts/parsing-xml-without-library---tsoding-9tvih5rw6)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Parsing XML without Library - Tsoding","url":"https://daily.dev/posts/parsing-xml-without-library---tsoding-9tvih5rw6","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/parsing-xml-without-library---tsoding-9tvih5rw6"},"datePublished":"2026-09-07T12:44:02.341Z","dateModified":"2026-09-14T08:35:48.836Z","description":"A live-coding stream walks through writing a minimal, dependency-free XML parser in the Jai programming language to extract layer information from an...","image":"https://i.ytimg.com/vi/j6Zt6cyJSXc/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/j6Zt6cyJSXc/sddefault.jpg","isAccessibleForFree":true,"articleSection":"Tsoding Daily","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Tsoding Daily","logo":"https://media.daily.dev/image/upload/s--6msWm9pp--/f_auto/v1728806157/logos/tsoding_daily","url":"https://daily.dev/sources/tsoding_daily"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/parsing-xml-without-library---tsoding-9tvih5rw6","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"","timeRequired":"PT150M","video":{"@type":"VideoObject","name":"Parsing XML without Library - Tsoding","description":"A live-coding stream walks through writing a minimal, dependency-free XML parser in the Jai programming language to extract layer information from an...","thumbnailUrl":"https://i.ytimg.com/vi/j6Zt6cyJSXc/sddefault.jpg","uploadDate":"2026-09-07T12:44:02.341Z","duration":"PT150M","url":"https://api.daily.dev/r/9tvih5rW6","embedUrl":"https://www.youtube.com/embed/j6Zt6cyJSXc"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Tsoding Daily","item":"https://daily.dev/sources/tsoding_daily"},{"@type":"ListItem","position":3,"name":"Parsing XML without Library - Tsoding"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/parsing-xml-without-library---tsoding-9tvih5rw6#faq","mainEntity":[{"@type":"Question","name":"How can I write a minimal XML parser without using a full XML library?","acceptedAnswer":{"@type":"Answer","text":"A minimal XML parser can be built by implementing only the subset of the spec actually needed, skipping full spec compliance like CDATA, entity escaping, or general text node handling. A working example extracting layer names, positions, and image paths from an OpenRaster stack.xml file was implemented in roughly 127 lines of code with no XML-specific dependency, using string trimming and a simple stack-based approach to build a tree of nodes with name and property fields. See how daily.dev surfaces similar hands-on parsing walkthroughs for developers weighing custom code versus a library."}},{"@type":"Question","name":"What is the OpenRaster (.ora) file format and how is it structured?","acceptedAnswer":{"@type":"Answer","text":"An OpenRaster file is a zip archive containing a mimetype file, a merged preview image, thumbnails, layer PNG images, and a stack.xml file describing how those layer images are grouped and positioned. It functions as an open-source equivalent to Photoshop's PSD format and can be edited in tools like Krita, making it useful for asset pipelines that need to reconstruct sprite atlases from individually editable layers. Developers building custom asset pipelines can find more format deep-dives like this through daily.dev."}},{"@type":"Question","name":"What is stride in image processing and how does it differ from width?","acceptedAnswer":{"@type":"Answer","text":"Stride is the number of elements you must skip in a linear pixel array to reach the start of the next row, while width is simply the number of pixels in one row of the visible image. They differ when working with sub-images inside a larger atlas: a sub-image might have a width of eight pixels but a stride of sixteen if it sits inside a wider parent image, since the linear memory layout still requires skipping the full parent row length. Anyone implementing image atlas or sub-image logic can dig into fundamentals like this via daily.dev."}}]}
```

