getChildrenNodes = function (name) {
const n = [];
let p;
for ( p in x3dschema.definitions[name]?.properties) {
if (! p.startsWith("@")) {
const v = x3dschema.definitions[name].properties[p];
if (p.startsWith("-")) {
let children=[];
if ( v.properties ) {
children = Object.keys( v.properties );
}
if ( v.items ) {
children = Object.keys( v.items.properties );
}
else {
const path = v['$ref']?.split('/');
if (path) {
const nfield = x3dschema.definitions[path.slice(-1)];
if (nfield.properties) {
children = Object.keys(nfield.properties);
}
if (nfield.items) {
children = Object.keys(nfield.items.properties);
}
}
}
n.push(...children);
}
else {
if (! (v.type && v.type === 'string')) n.push(p);
}
}
}
return n.filter( n => n !== "#comment" )
}