Download packages/schema-engine/src/schematron.ts from AnthropicallyHuggingFaces/ProjectOS: direct link, hf CLI and curl.
- Browser
- Download file 372 Bytes
-
https://huggingface.co/spaces/AnthropicallyHuggingFaces/ProjectOS/resolve/main/packages/schema-engine/src/schematron.ts
- Command line
-
hf download hf://spaces/AnthropicallyHuggingFaces/ProjectOS/packages/schema-engine/src/schematron.ts
-
curl -L -o schematron.ts https://huggingface.co/spaces/AnthropicallyHuggingFaces/ProjectOS/resolve/main/packages/schema-engine/src/schematron.ts
372 Bytes
| import { validateSchematronXml } from './validator/schematron-validator.js'; | |
| export class SchematronEngine { | |
| constructor(private readonly schemaXml: string) {} | |
| validate(xml: string): string[] { | |
| try { | |
| return validateSchematronXml(xml, this.schemaXml); | |
| } catch (error) { | |
| return [error instanceof Error ? error.message : String(error)]; | |
| } | |
| } | |
| } | |