UNPKG

typesxml

Version:

Open source XML library written in TypeScript

57 lines (56 loc) 2.77 kB
/******************************************************************************* * Copyright (c) 2023-2026 Maxprograms. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 1.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/org/documents/epl-v10.html * * Contributors: * Maxprograms - initial API and implementation *******************************************************************************/ import { AttributeInfo, Grammar, GrammarType, ValidationResult } from '../grammar/Grammar.js'; import { AttDecl } from './AttDecl.js'; import { ContentModel } from './ContentModel.js'; import { ElementDecl } from './ElementDecl.js'; import { EntityDecl } from './EntityDecl.js'; import { NotationDecl } from './NotationDecl.js'; export declare class DTDGrammar implements Grammar { private models; private entitiesMap; private attributesMap; private elementDeclMap; private notationsMap; constructor(); addPredefinedEntities(): void; getContentModel(elementName: string): ContentModel | undefined; toString(): string; addElement(elementDecl: ElementDecl, override?: boolean): void; addAttributes(element: string, attributes: Map<string, AttDecl>, override?: boolean, preexistingKeys?: Set<string>): void; resolveParameterEntities(text: string): string; addEntity(entityDecl: EntityDecl, override?: boolean): void; getEntity(entityName: string): EntityDecl | undefined; getParameterEntity(entityName: string): EntityDecl | undefined; addNotation(notation: NotationDecl, override?: boolean): void; merge(grammar: DTDGrammar): void; getNotationsMap(): Map<string, NotationDecl>; getElementDeclMap(): Map<string, ElementDecl>; getEntitiesMap(): Map<string, EntityDecl>; processModels(): void; getAttributesMap(): Map<string, Map<string, AttDecl>>; getElementAttributesMap(element: string): Map<string, AttDecl> | undefined; validateElement(element: string, namespace: string, children: string[], text: string): ValidationResult; validateAttributes(element: string, attributes: Map<string, string>): ValidationResult; private validateAttributeValue; private entityExists; private notationExists; private extractEntityReferences; getElementAttributes(element: string): Map<string, AttributeInfo>; getDefaultAttributes(element: string): Map<string, string>; resolveEntity(name: string): string | undefined; getGrammarType(): GrammarType; getTargetNamespaces(): Set<string>; getElementTextDefault(_element: string): string | undefined; getNamespaceDeclarations(): Map<string, string>; private mapDTDAttributeUse; }