Closed zuttedr closed 7 months ago
@zuttedr, can you provide a piece of your code? How is validateSchema
imported and called?
I just followed your readme
import validateSchema from 'xsd-validator'
// returns true for valid documents validateSchema( myXml, myXmlSchema) // -> true
Can you give me a little more, like a reproducible example of your code? So far, this should simply work.
Well, I just installed it with npm and created a js file containing this code: import validateSchema from 'xsd-validator'
// returns true for valid documents validateSchema("xml", "xml");
I just saw that this is a package for typescript, but want to use it in a nodejs application. Could this be the cause of the problem?
For pure javascript, try with
const validateSchema = require('xsd-validator')
instead of
import validateSchema from 'xsd-validator'
Hi @deltazero-cz ,
Was able to make it work by calling the function like this: validateSchema["validateSchema"](xml,schema)
Thanks for the help
Hi, I've installed the package but when i'm trying to use it, it gives an error "TypeError: validateSchema is not a function". What could be the problem? Thanks