@manuth/woltlab-compiler
Version:
A compiler for generating WoltLab-Package `.tar` Archives and other WoltLab-Package Components
38 lines • 1.14 kB
JavaScript
import { XMLFileCompiler } from "./XMLFileCompiler.js";
/**
* Provides the functionality to compile components to `.xml`-files optimized for woltlab.
*
* @template T
* The type of the item which can be compiled by this compiler.
*/
export class WoltLabXMLCompiler extends XMLFileCompiler {
/**
* Initializes a new instance of the {@link WoltLabXMLCompiler `WoltLabXMLCompiler<T>`} class.
*
* @param item
* The item to compile.
*/
constructor(item) {
super(item);
}
/**
* @inheritdoc
*/
get TagName() {
return "data";
}
/**
* @inheritdoc
*
* @returns
* The serialized document.
*/
CreateDocument() {
let document = super.CreateDocument();
document.documentElement.setAttribute("xmlns", "http://www.woltlab.com");
document.documentElement.setAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instace");
document.documentElement.setAttribute("xsi:schemaLocation", `http://www.woltlab.com ${this.SchemaLocation}`);
return document;
}
}
//# sourceMappingURL=WoltLabXMLCompiler.js.map