Closed eduardnegru closed 4 years ago
I have a YANG model on disk. I want to validate an XML file against that YANG mode. Is there a way to accomplish this? I saw there is the validate function.
async validateModel() { const yangModelData = await fs.readFile(yangModelFilePath, 'utf8'); const xmlData = await fs.readFile(xmlDataFilePath, 'utf8'); const yang = new Yang(yangModelData); const nConfigJSON = JSON.parse(XmlParser.toJson(xmlData)); yang.validate(xmlData); }
But whenever I pass a JSON representation of the XML file I get :
Expression error unknown expression
Please see recent fix for validate at #121. Also, you should be passing in nConfigJSON as input to yang.validate.
nConfigJSON
yang.validate
I have a YANG model on disk. I want to validate an XML file against that YANG mode. Is there a way to accomplish this? I saw there is the validate function.
But whenever I pass a JSON representation of the XML file I get :
Expression error unknown expression