# Esquemas del NUC — Panamá

> Definiciones oficiales del NUC para validación local: XSD para XML, JSON Schema para JSON.


## NUCSchema.xsd (XML)

- **Descarga:** [undefined](undefined)
- **Tipo:** XML Schema Definition
- **Uso típico:**
  - `xmllint --schema NUCSchema.xsd documento.xml --noout`
  - .NET: `XmlSchemaSet.Add("", "NUCSchema.xsd")`
  - Java: `SchemaFactory.newSchema(new File("NUCSchema.xsd"))`
  - Python: `etree.XMLSchema(etree.parse("NUCSchema.xsd"))`

## NUCSchema.json (JSON Schema draft-04)

- **Descarga:** [undefined](undefined)
- **Tipo:** JSON Schema draft-04
- **Uso típico:**
  - ajv (JS): `new Ajv().compile(require("./NUCSchema.json"))`
  - Python: `jsonschema.validate(data, schema)`
  - .NET: `JSchema.Parse(File.ReadAllText("NUCSchema.json"))`
  - CLI: `ajv validate -s NUCSchema.json -d documento.json`

> ⚠️ Validar contra el schema es necesario pero no suficiente. La API también valida reglas de negocio FEL (NIT existente, frases válidas, totales coherentes).
