Try using GitHub Action validator
This commit is contained in:
2
scripts/schema-validator/.gitignore
vendored
2
scripts/schema-validator/.gitignore
vendored
@ -1,2 +0,0 @@
|
||||
work-area/
|
||||
!work-area/.gitkeep
|
@ -1,18 +1,10 @@
|
||||
import * as fs from "fs";
|
||||
import * as unzipper from "unzipper";
|
||||
import { validateXMLWithXSD } from "validate-with-xmllint";
|
||||
|
||||
const main = async () => {
|
||||
fs.copyFileSync("My Document.docx", "scripts/schema-validator/work-area/doc.zip");
|
||||
|
||||
const zip = await unzipper.Open.file("scripts/schema-validator/work-area/doc.zip");
|
||||
const zip = await unzipper.Open.file("My Document.docx");
|
||||
await zip.extract({
|
||||
path: "scripts/schema-validator/work-area/doc",
|
||||
path: "build/extracted-doc",
|
||||
});
|
||||
|
||||
const xml = fs.readFileSync("scripts/schema-validator/work-area/doc/word/document.xml", "ascii");
|
||||
|
||||
await validateXMLWithXSD(xml, "scripts/schema-validator/schemas/microsoft/wml-2010.xsd");
|
||||
};
|
||||
|
||||
main();
|
||||
|
Reference in New Issue
Block a user