Skip to main content

A script to validate XML files for the game 'The Binding of Isaac: Repentance'

Project description

isaac-xml-validator

This repo contains:

Using the Website

You can view the website here.

Usage in VSCode and Other IDEs

Most people create Binding of Isaac mods (and other software) using VSCode, which is a very nice text editor / IDE.

If you make a typo (or some other error) in your XML file, you can get VSCode to automatically show you the error with a little red squiggly line, which is really helpful. This is accomplished by specifying a link to the corresponding schema at the top of the file.

First, make sure that you have the XML extension by Red Hat installed. Next, add the following to the top of your XML file:

<?xml-model href="https://wofsauge.github.io/isaac-xml-validator/xsd/[NAME OF THE FILE].xsd" ?>

For example, this is how it would look for a "babies.xml" file:

<?xml-model href="https://wofsauge.github.io/isaac-xml-validator/xsd/babies.xsd" ?>
<babies root="gfx/Characters/Player2/">
  <baby id="0" name="Spider Baby" skin="000_Baby_Spider.png" />
  <baby id="1" name="Love Baby" skin="001_Baby_Love.pngz" /> <!-- shows an error, because the "skin" attribute doesn't contain a .png file, but a .pngz-->
  <baby id="2" name="Bloat Baby" skin="002_Baby_Bloat.png" />
</babies>

Note that by default, the XML extension caches the XSD files in the following location:

C:\Users\%USERNAME%\.lemminx\cache\https\wofsauge.github.io\isaac-xml-validator

You can remove this directory if you want to purge the cache to download any potentially updated XSD files.

Using the Python Script

The tool is published to PyPI, so you can install it via:

pip install isaac-xml-validator

Then, you can run it via:

isaac-xml-validator

By default, it will recursively scan for all XML files in the current working directory.

You will likely want to set up your repository so that the script runs in CI (e.g. GitHub Actions).

Usage in GitHub Actions

For most users, you will probably want to manually integrate the Python script into your existing lint routine. Alternatively, you can use a GitHub action that automatically invokes the script.

Creating New XSD Files

If you need to create new XSD files, you can import our common XML schema like this:

<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsisaac="https://wofsauge.github.io/isaac-xml-validator">
  <xs:import schemaLocation="https://wofsauge.github.io/isaac-xml-validator/xsd/isaacTypes.xsd" namespace="https://wofsauge.github.io/isaac-xml-validator" />
  <xs:element name="Test">
    <xs:complexType>
      <xs:attribute name="root" type="xsisaac:pngFile" />
    </xs:complexType>
  </xs:element>
</xs:schema>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

isaac-xml-validator-1.7.0.tar.gz (12.8 kB view details)

Uploaded Source

Built Distribution

isaac_xml_validator-1.7.0-py3-none-any.whl (27.0 kB view details)

Uploaded Python 3

File details

Details for the file isaac-xml-validator-1.7.0.tar.gz.

File metadata

  • Download URL: isaac-xml-validator-1.7.0.tar.gz
  • Upload date:
  • Size: 12.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for isaac-xml-validator-1.7.0.tar.gz
Algorithm Hash digest
SHA256 f7195c752c95b5dc7b4c496a0850cd66207cc56cfc2d7ff1cbcbfcb3ac6d35e3
MD5 bb07f13c95f2f47200a0d3a8653609a3
BLAKE2b-256 f6249717d70e31385665a8977da64404c8f8a06d7a83fac2228cff2cddae4f8e

See more details on using hashes here.

File details

Details for the file isaac_xml_validator-1.7.0-py3-none-any.whl.

File metadata

File hashes

Hashes for isaac_xml_validator-1.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8095672865b69dd6c1f043f2f4db570349e00971c0d8e1cc68e277831eabb4d3
MD5 2e6f76dc40f7c757533d344938c1baff
BLAKE2b-256 09f5c945c779383fce957895fdc02fd4b85b58a74dceacb79daa1b8d99958d42

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page