Node.js libxmljs:如何使用xinclude?
我尝试将libxmljs与nodejs一起使用。 在我的示例中,我想使用xi:includeNode.js libxmljs:如何使用xinclude?,node.js,xml,xsd,libxml-js,Node.js,Xml,Xsd,Libxml Js,我尝试将libxmljs与nodejs一起使用。 在我的示例中,我想使用xi:include <ord:order xmlns:ord="http://example.org/ord" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://example.org/ord chapter04ord1.xsd" xmlns:xi="http:
<ord:order xmlns:ord="http://example.org/ord"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://example.org/ord chapter04ord1.xsd"
xmlns:xi="http://www.w3.org/2001/XInclude">
<number>123ABBCC123</number>
<customer>
<name>Priscilla Walmsley</name>
<number>15466</number>
</customer>
<items>
<xi:include href="/Users/mar/ws_e/libxml/test/resources/chapter5prod.xml" />
</items>
</ord:order>
然后我得到一个错误:
Document {
errors: [],
validationErrors:
[ { Error: Element '{http://www.w3.org/2001/XInclude}include': This element is not expected. Expected is ( product ).
所以我的问题是如何在libxmljs中使用x:include
问候
Markus见“XInclude不工作”:。谢谢。那么,您找到合适的工作环境了吗?我认为您不应该在libxmljs中使用XInclude。以其他方式组合XML文档的各个部分。
var xsdDoc = libxml.parseXml(schemaSource);
var xmlDocValid = libxml.parseXml(docSource);
var xmlDocInvalid = libxml.parseXml(xml_invalid);
xmlDocValid.validate(xsdDoc);
console.dir(xmlDocValid);
console.dir(xmlDocValid.validationErrors);
Document {
errors: [],
validationErrors:
[ { Error: Element '{http://www.w3.org/2001/XInclude}include': This element is not expected. Expected is ( product ).