DTD and XML Schema are often used to define tags and attributes the should be used to properly write an XML files. Using them, it is thus possible to validate the content of XML files not just against the strict XML language syntax, but also looking at the content of each tag.
Is there an equivalent to this for other languages like JSON and YAML?