Thank you @rolfkleef and @mato74 - I see what mistake I’ve made: I’ve been thinking that the reason these files are valid is that their namespace URI is also a URL which points to an actual schema extension. Not so. Even though the files which use this method will validate via the IATI Validator, they don’t actually strictly validate if you use something like xmllint -valid <file> -schema <iati-activities.xsd>
:
### Validate agains the XML standards and the IATI activities schema
xmllint -valid http://iati.openaid.se/xml/189.xml -schema /IATI-Schemas/iati-activities-schema.xsd -noout
# -valid: validate this file
# -schema: fetch the xsd file from this address
# -noout: don't print the whole file to console afterwards!
######## Output ########
# http://iati.openaid.se/xml/189.xml:1: validity error : Validation failed: no DTD found!
# <iati-activities version="2.01" generated-datetime="2017-03-17T13:53:14">
# ^
# http://iati.openaid.se/xml/189.xml validates
Similarly, when the namespace is declared at the top of the file: validator, versus terminal:
xmllint -valid http://beta.foreignassistance.gov/assets/IATI/Argentina.xml -schema http://iatistandard.org/202/schema/downloads/iati-activities-schema.xsd -noout
######## Output ########
# http://beta.foreignassistance.gov/assets/IATI/Argentina.xml:1: validity error: Validation failed: no DTD found!
# /web/IATI/usg-extension" generated-datetime="2017-03-22T23:18:00" version="2.01"
# ^
# http://beta.foreignassistance.gov/assets/IATI/Argentina.xml validates
So the questions is, is this a problem? If not, I could happily just get around validation of an extension in this way, but it doesn’t seem ideal. For instance if I was extending a transaction to have a new date value within it, I would prefer to be able to extend the IATI schema so that when I run a validation procedure, I can tell if I’ve violated the original IATI specification or my own extension within one validation…