xi include part 1

This commit is contained in:
2026-08-01 14:30:14 +02:00
parent 656fab349d
commit 429ea367f3
7 changed files with 345 additions and 36 deletions
+23
View File
@@ -212,3 +212,26 @@ export const STRUCTURAL_ELEMENTS = [
"Defines",
"Define",
];
/**
* Element names that live outside the RA3 XSD model's namespace. The model
* only covers `uri:ea.com:eala:asset`; other namespaces (so far the W3C
* XInclude `xi:`) must not be validated against it.
*/
const FOREIGN_ELEMENT_PREFIXES = ["xi:"];
/** True when an element name belongs to the RA3 XSD model's namespace. */
export function isXsdElementName(name: string): boolean {
const lower = name.toLowerCase();
return !FOREIGN_ELEMENT_PREFIXES.some((p) => lower.startsWith(p));
}
/**
* True when an attribute name can be validated against the RA3 XSD model.
* EA schema attributes are unprefixed; prefixed attributes (`xai:`,
* `xi:`, `xlink:`, `xml:`, `xsi:`, `xmlns:*`) are namespace machinery and
* are not defined by the XSD.
*/
export function isXsdAttributeName(name: string): boolean {
return !name.includes(":");
}