UNPKG

isoxml

Version:

JavaScript library to parse and generate ISOXML (ISO11783-10) files

35 lines (34 loc) 1.07 kB
import { TAGS } from './constants'; import { registerEntityClass } from '../classRegistry'; import { fromXML, toXML } from '../utils'; const ATTRIBUTES = { A: { name: 'CodedCommentListValueId', type: 'xs:ID', isPrimaryId: true, isOptional: false, isOnlyV4: false, }, B: { name: 'CodedCommentListValueDesignator', type: 'xs:string', isPrimaryId: false, isOptional: false, isOnlyV4: false, }, }; const CHILD_TAGS = {}; export class CodedCommentListValue { constructor(attributes, isoxmlManager) { this.attributes = attributes; this.isoxmlManager = isoxmlManager; this.tag = TAGS.CodedCommentListValue; } static fromXML(xml, isoxmlManager, internalId, targetClass = CodedCommentListValue) { return fromXML(xml, isoxmlManager, targetClass, ATTRIBUTES, CHILD_TAGS, internalId); } toXML() { return toXML(this, ATTRIBUTES, CHILD_TAGS); } } registerEntityClass('main', TAGS.CodedCommentListValue, CodedCommentListValue);