|
@@ -24,7 +24,7 @@ export class UANodeSet implements IToXML{
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- resolveChildren(nm: Map<string, UABaseNode>) {
|
|
|
|
|
|
+ resolveReferences(nm: Map<string, UABaseNode>) {
|
|
for(const node of this.nodes) {
|
|
for(const node of this.nodes) {
|
|
node.resolveReferences(nm);
|
|
node.resolveReferences(nm);
|
|
}
|
|
}
|
|
@@ -50,11 +50,8 @@ export class UANodeSet implements IToXML{
|
|
static async parse(xml: string, fileName: string): Promise<UANodeSet> {
|
|
static async parse(xml: string, fileName: string): Promise<UANodeSet> {
|
|
const parseOptions:Partial<X2jOptions>={
|
|
const parseOptions:Partial<X2jOptions>={
|
|
ignoreAttributes: false,
|
|
ignoreAttributes: false,
|
|
- numberParseOptions: {
|
|
|
|
- hex: false,
|
|
|
|
- leadingZeros: false,
|
|
|
|
- skipLike: /./ //disable number detection. Otherwise string values might end up as numbers.
|
|
|
|
- },
|
|
|
|
|
|
+ alwaysCreateTextNode: true, //force consistent result
|
|
|
|
+ parseTagValue:false, //disable number detection. Otherwise string values might end up as numbers.
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
isArray: (name, jpath, isLeafNode, isAttribute):boolean => {
|
|
isArray: (name, jpath, isLeafNode, isAttribute):boolean => {
|
|
switch(jpath) {
|
|
switch(jpath) {
|
|
@@ -90,7 +87,7 @@ export class UANodeSet implements IToXML{
|
|
const nst=new NamespaceTable();
|
|
const nst=new NamespaceTable();
|
|
if(uaNamespaceUris) {
|
|
if(uaNamespaceUris) {
|
|
for(const nsUri of uaNamespaceUris['Uri']) {
|
|
for(const nsUri of uaNamespaceUris['Uri']) {
|
|
- nst.addUri(nsUri)
|
|
|
|
|
|
+ nst.addUri(nsUri['#text'])
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return new UANodeSet(fileName, models, nodes, nst);
|
|
return new UANodeSet(fileName, models, nodes, nst);
|