1. Save the schema dependencies
Download the eight XSD files in the contract authoring schema set into one local directory. Use the filenames listed in the catalog. The schema manifest records each exact namespace, source URL, dependency, and SHA-256 checksum. Compare downloaded files with these checksums to confirm you have the documented revision. For a LegalLab example with extra namespaces, also save its listed additional schemas. A custom payload requires its own XSD; follow custom schema authoring.2. Associate namespaces with local files
In your validator’s schema-set or XML-catalog settings, associate each namespace with the corresponding local XSD from the catalog. Load all dependencies before validating the contract. For example, associateurn:nf:iot:leg:sc:1.0 with SmartContracts.xsd. That schema imports identity, key, and XML-attribute definitions; the key schema also imports peer-address types. Some imports omit a file location, so opening only SmartContracts.xsd is insufficient.
Use the exact namespace strings. A namespace identifies the vocabulary; the downloaded file is its local schema location. Keep these associations in your validator configuration without changing the contract’s namespaces.
Disable DTD processing and external network resolution for an offline check. Configure the validator to report elements with missing schemas, including machine-readable content inside the contract.
3. Validate the complete XML
Save the complete document asMyContract.xml, select the loaded schema set, and run XSD validation. Check the document root, required attributes, element ordering, and value types.
Expected result: the schema set compiles and the document has no validation errors. A message that XML is merely well-formed does not establish XSD validity.
As a check that your schema configuration is active, temporarily remove a required attribute such as startState from a state-machine definition. Validation should fail. Restore the original document before continuing.
4. Check machine references
For a contract containing a state machine, check references separately from the XSD result:startStateand transitionnewStatevalues must name defined states in the same machine.- Each
actionRefmust name a defined action in that machine. - Event references must match their declared event identifiers.
Diagnose validation failures
Continue with the Agent API
XML validation checks structure. It does not evaluate Script, verify signatures, approve templates, or execute a token’s lifecycle. Submit the validated file through the contract authoring workflow, then observe approval and execution separately. For a custom vocabulary, confirm the provider can resolve its schema before submission. Your local namespace-to-file associations do not configure the provider’s schema resolver.Original references
- Neuro Foundation documentation: specifications and technical reference material.
- Script syntax and function reference: the full language reference.