Skip to content

Instantly share code, notes, and snippets.

@njh
Created May 27, 2021 15:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save njh/9bd992f5cb08a0f26304c982a3457d67 to your computer and use it in GitHub Desktop.
Save njh/9bd992f5cb08a0f26304c982a3457d67 to your computer and use it in GitHub Desktop.
Validate an RadioDNS (ETSI TS 102 818) SI.xml file offline using xmllint
<?xml version="1.0" encoding="UTF-8"?>
<schema elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>
<import namespace="http://www.worlddab.org/schemas/spi/33" schemaLocation="spi_33.xsd"/>
</schema>
#!/bin/sh
wget -nc -q -O ./xml.xsd http://www.w3.org/2001/xml.xsd
wget -nc -q -O ./spi_33.xsd https://www.worlddab.org/schemas/spi/33/spi_33.xsd
xmllint --nonet --noout --schema combined.xsd ./SI.xml
@njh
Copy link
Author

njh commented May 27, 2021

There is a warning that a schema has already been imported:

spi_33.xsd:8: element import: Schemas parser warning : Element '{http://www.w3.org/2001/XMLSchema}import': Skipping import of schema located at 'http://www.w3.org/2001/xml.xsd' for the namespace 'http://www.w3.org/XML/1998/namespace', since this namespace was already imported with the schema located at 'xml.xsd'.

This can be hidden by adding --nowarning but that might hide other useful warnings too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment