Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
},
finish(this: any) {
_internal_createNode(this.obj);
},
parser: {
DisplayName: {
finish(this: any) {
this.parent.obj.displayName = this.text;
}
},
References: references_parser
}
};
const state_ModelTableEntry = new ReaderState({ // ModelTableEntry
init(this: any) {
this._requiredModels = [];
},
parser: {
// xx "RequiredModel": null
},
finish(this: any) {
const modelUri = this.attrs.ModelUri; // //"http://opcfoundation.org/UA/"
const version = this.attrs.Version; // 1.04
const publicationDate = this.attrs.PublicationDate; // "2018-05-15T00:00:00Z" "
// optional,
const symbolicName = this.attrs.SymbolicName;
const accessRestrictions = this.attrs.AccessRestrictions;
},
UADataType: state_UADataType,
UAMethod: state_UAMethod,
UAObject: state_UAObject,
UAObjectType: state_UAObjectType,
UAReferenceType: state_UAReferenceType,
UAVariable: state_UAVariable,
UAVariableType: state_UAVariableType
}
};
if (!_.isArray(xmlFiles)) {
xmlFiles = [xmlFiles];
}
const parser = new Xml2Json(state_0);
addressSpace1.suspendBackReference = true;
async.mapSeries(xmlFiles, (xmlFile: string, callback1: (err?: Error) => void) => {
// istanbul ignore next
if (!fs.existsSync(xmlFile)) {
throw new Error("generateAddressSpace : cannot file nodeset2 xml file at " + xmlFile);
}
debugLog(" parsing ", xmlFile);
_reset_namespace_translation();
parser.parse(xmlFile, callback1);
}, (err?: Error | null) => {
make_back_references(addressSpace1);
export function parseBinaryXSD(
xmlString: string,
dataTypeFactories: DataTypeFactory[],
callback: (err: Error | null, typeDictionary: TypeDictionary
) => void) {
const typeDictionary = new TypeDictionary(dataTypeFactories);
const parser = new Xml2Json(state0);
(parser as any).typeDictionary = typeDictionary;
parser.parseString(xmlString, (err?: Error | null) => {
// resolve and prepare enumerations
for (const key in typeDictionary.enumeratedTypesRaw) {
if (!typeDictionary.enumeratedTypesRaw.hasOwnProperty(key)) {
continue;
}
const enumeratedType = typeDictionary.enumeratedTypesRaw[key];
prepareEnumeratedType(enumeratedType, typeDictionary);
}
// resolve complex types
for (const key in typeDictionary.structuredTypesRaw) {
if (!typeDictionary.structuredTypesRaw.hasOwnProperty(key)) {
continue;
}
},
finish: function () {
_internal_createNode(this.obj);
},
parser: {
"DisplayName": {
finish: function () {
this.parent.obj.displayName = this.text;
}
},
"References": references_parser
}
};
const state_ModelTableEntry = new ReaderState({ // ModelTableEntry
init: function() {
this._requiredModels = [];
},
parser: {
//xx "RequiredModel": null
},
finish: function () {
const modelUri = this.attrs.ModelUri; // //"http://opcfoundation.org/UA/"
const version = this.attrs.Version; // 1.04
const publicationDate = this.attrs.PublicationDate; //"2018-05-15T00:00:00Z" "
// optional,
const symbolicName = this.attrs.SymbolicName;
const accessRestrictions = this.attrs.AccessRestrictions;
},
"Aliases": {parser: {"Alias": state_Alias}},
"UAObject": state_UAObject,
"UAObjectType": state_UAObjectType,
"UAReferenceType": state_UAReferenceType,
"UADataType": state_UADataType,
"UAVariable": state_UAVariable,
"UAVariableType": state_UAVariableType,
"UAMethod": state_UAMethod
}
};
if (!_.isArray(xmlFiles)) {
xmlFiles = [xmlFiles];
}
const parser = new Xml2Json(state_0);
addressSpace.suspendBackReference = true;
async.mapSeries(xmlFiles, function (xmlFile, callback) {
if (!fs.existsSync(xmlFile)) {
throw new Error("generate_address_space : cannot file nodeset2 xml file at " + xmlFile);
}
debugLog(" parsing ",xmlFile);
_reset_namespace_translation();
parser.parse(xmlFile, callback);
}, function () {
make_back_references(addressSpace);
assert(!addressSpace.suspendBackReference);
callback.apply(this, arguments);
});