DEV Community

Andrey
Andrey

Posted on

Codefunk XML Editor

Hey, so I finally used Codefunk XML Editor to debug that massive configuration file...

You know the one – 15,000 lines of XML defining our entire data transformation pipeline, and it kept failing with some cryptic validation error. Yeah. So I tried Codefunk – that native macOS XML editor with the split tree/text view – and honestly, it saved me hours. But of course, getting the XSD validation to actually point to the right schema was a whole thing.

The "validation shows errors everywhere" wall

So I opened the XML file in Codefunk – looked great, nice syntax highlighting, tree view on the left made the structure actually understandable. But then I turned on validation against our XSD schema, and... every single element was underlined in red. Like the whole file was invalid. Which I knew wasn't true, because the same file passes validation in our build pipeline.

First dumb move: I assumed the schema file was corrupted. Downloaded a fresh copy from the repo. Same thing. Checked the XML declaration – looked fine. Spent way too long comparing line by line.

What I didn't realize is that Codefunk, by default, expects the schema reference to be in the XML file itself (using xsi:schemaLocation). Our build pipeline passes the schema separately as a command-line argument, so the file doesn't have that reference embedded.

What actually fixed it

In Codefunk's validation settings, there's a section for "External Schemas" that I completely missed. I added our XSD file there, associated it with the correct namespace, and suddenly validation worked perfectly – showing only the real errors (turns out there were two, not thousands).

The Codefunk validation guide explained this, and the W3C XML Schema docs helped me understand the difference between embedded and external schema references.

Quick checklist for next time

  • If validation shows too many errors, check if the schema is actually being found
  • Use "External Schemas" in preferences for files without embedded references
  • The tree view is great for spotting structural issues (I found a misplaced closing tag immediately)
  • Real-time validation catches errors as you type – leave it on

Once I got validation working, Codefunk is genuinely a great tool. The synchronized tree/text view alone is worth it – I could see the hierarchy while editing raw XML. The Codefunk tutorials have some good examples for working with large files.

Anyway, if you ever have to wrestle with massive XML files, this is the tool. Let me know if you need help with the external schema setup.

Catch you later

Top comments (0)