STILTS-XSDVALIDATE(1)

πŸ’– stilts-xsdvalidate πŸ’–

okay bestie, you found the stilts-xsdvalidate page in section 1 of the Stilts commands manual, and honestly? it's giving XML-bouncer energy. it validates XML documents against XML Schemas. that's it, that's the whole vibe. let's go ✨


✨ NAME ✨

stilts-xsdvalidate β€” validates against XML Schema πŸ¦‹


🌸 SYNOPSIS 🌸

stilts xsdvalidate [doc=<location>] [schemaloc=<namespace>=<location>
                   ...] [topel=[{<ns-uri>}][<local-name>]]
                   [verbose=true|false] [uselocals=true|false]
                   [nsurl=true|false]

πŸ’… DESCRIPTION πŸ’…

okay so xsdvalidate is a utility for validating XML documents against XML Schemas. that's the whole job. and like, real talk? this is not very specific to STILTS, and it does not claim to do a better job than other XSD validators out there. so if you can find another one that suits your purposes, please use it, no hard feelings fr fr. it was added to the package however since it seems hard to find suitable tools that do this job β€” the struggle was real 😭

here's the thing though. the schema is not specified by runtime parameters. elements in a given XML document are validated against any schemas associated with the namespaces defined in that document. iconic behaviour, honestly.

BUT 😌 it is possible to override the locations of schemas using runtime parameters. by using the schemaloc parameter, you can tell the validator to validate against a local copy of a schema or one at a given URL, rather than the copy that is referenced by xsi:schemaLocation attributes in the document itself. that can be convenient when developing a schema with a public namespace that is fixed, but content which is still subject to change. dev life, yk? moreover, some local copies of W3C and IVOA schemas are kept within the application, so that external network accesses are not required during validation. no wifi, no problem 🧚

by default, successful validation results in no output and a success exit status, but if there are validation errors then some indication of what went wrong is printed to standard output and the command exits with an error. this makes it suitable for use in makefiles. periodt. πŸ’…


πŸŽ€ OPTIONS πŸŽ€

  • doc=<location> β€” location of XML document to validate. yeah, that's the thing you're checking. give it a filename or URL, bestie. πŸ“„
  • schemaloc=<namespace>=<location> ... β€” assignments of override schema locations to XML namespaces. one or more assignments may be supplied, each of the form <namespace>=<location> where the location may be a filename or URL. multiple assignments may be made by supplying the parameter multiple times, or using a space character as a separator.

each assignment causes any reference to the given namespace in the validated document to be validated with reference to the XSD schema at the given location rather than to a schema acquired in the default way (using xsi:schemaLocation attributes or using the namespace as a retrieval URL). you're basically telling it where the real tea is at πŸ”₯

  • topel=[{<ns-uri>}][<local-name>] β€” local name of the top-level element expected in the parsed document. if the actual parsed top-level element has a local name differing from this, an error will be reported. if no value is specified (the default) no checking is done. so like, it's optional, live your truth. πŸ¦‹
  • verbose=true|false β€” if true, some INFO reports will be displayed alongside any ERROR reports resulting from the parse. this may be useful for diagnosis or reassurance. she's chatty and we love that πŸ™ˆ
  • uselocals=true|false β€” whether to use local copies of VO schemas where available. if true, copies of some IVOA schemas stored within the application are used instead of retrieving them from their http://www.ivoa.net/ URLs. setting this true is generally faster and more robust against network issues, though it may risk retrieving out of date copies of the schemas. bestie said offline mode but make it schemas 🧚
  • nsurl=true|false β€” whether to use the namespace URI itself as a dereferencable URL to download a schema if no location has been supplied from elsewhere. for a namespace http://example.com/ns1 this is like assuming the presence of a xsi:schemaLocation="http://example.com/ns1 http://example.com/ns1" entry. of course the XSD must be available at the location given by the namespace URI for this to work. no schema, no service πŸ’€

setting this true usually does the right thing, but it may risk hitting schema-hosting web servers too hard, and maybe it's too lenient on XML documents that don't have the right xsi:schemaLocation attributes; but XMLSchema-1 Sec 4.3.2 says it's up to the processor (i.e. this command) to figure out where to get schemas from. so if it goes feral, that's technically allowed 😭


πŸ” SEE ALSO πŸ”

if the package stilts-doc is installed, the full documentation SUN/256 is available in HTML format: file:///usr/share/doc/stilts/sun256/index.html


⭐ VERSION ⭐

STILTS version 3.5.4-debian

this is the Debian version of Stilts, which lack the support of some file formats and network protocols. for differences see file:///usr/share/doc/stilts/README.Debian


πŸ‘‘ AUTHOR πŸ‘‘

Mark Taylor (Bristol University)


okay so that's the whole page, and before you go β€” this one is dated Mar 2017, it's running STILTS version 3.5.4-debian, and it lives in the Stilts commands manual. go validate something and slay πŸ’–βœ¨

πŸ“¦ where this page comes from