【发布时间】:2021-08-31 07:17:37
【问题描述】:
如果我从 xmlSchemaNewParserCtxt() 开始,解析器很好,可以找到所有引用的模式,但我想知道如果我使用 xmlSchemaNewMemParserCtxt(),我是否能以某种方式告诉它模式在哪里。
问题是,如果我已经在内存中下载了 XSD,我可以将文档 URL 传递给解析器以便它找到相关的东西吗?
一)
char *urlPath = "http://docs.oasis-open.org/ubl/os-UBL-2.1/xsd/maindoc/UBL-Invoice-2.1.xsd";
xmlSchemaNewParserCtxt (urlPath);
b)
xmlSchemaNewMemParserCtxt (schemaBuffer, buffSize);
变体 a) 工作正常,变体 b) 产生错误 I/O 警告:未能加载外部实体“../common/UBL-CommonAggregateComponents-2.1.xsd”
【问题讨论】:
标签: c validation xsd libxml2