Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
&引用;前缀';增值税';在XPath中无法解析;验证XML架构实例时_Xml_Xpath_Namespaces_Schema - Fatal编程技术网

&引用;前缀';增值税';在XPath中无法解析;验证XML架构实例时

&引用;前缀';增值税';在XPath中无法解析;验证XML架构实例时,xml,xpath,namespaces,schema,Xml,Xpath,Namespaces,Schema,我在尝试验证模式上的XML文档时遇到上述错误。下面是我的模式中的一个示例。前缀“vat”用于FileReference元素,但从我看到的情况来看,它是在架构头中声明的,并且与targetNamespace具有相同的值 <?xml version="1.0" encoding="UTF-16"?> -<xs:schema xml:lang="en" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" tar

我在尝试验证模式上的XML文档时遇到上述错误。下面是我的模式中的一个示例。前缀“vat”用于FileReference元素,但从我看到的情况来看,它是在架构头中声明的,并且与targetNamespace具有相同的值

<?xml version="1.0" encoding="UTF-16"?>
-<xs:schema xml:lang="en" 
    xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" targetNamespace="targetNamespace" elementFormDefault="qualified" 
    xmlns:vat="targetNamespace" 
    xmlns:b="http://schemas.microsoft.com/BizTalk/2003">
    <xs:element name="VATRefund">
        <xs:annotation>
            <xs:documentation>VAT Refund XML file root element.</xs:documentation>
        </xs:annotation>
        <xs:complexType>   
            <xs:sequence>
                <xs:element name="FileReference" type="vat:FileReference_Type">
                    <xs:annotation>
                        <xs:documentation>Unique file reference. May be chosen freely as long as it is different from all previous ones.</xs:documentation>
                    </xs:annotation>
                </xs:element>

-
增值税退税XML文件根元素。
唯一的文件引用。可以自由选择,只要它不同于以前所有的。
我如何解决此错误以及可能导致此错误的原因?下面是我用于验证的文件中的一个示例

<?xml version="1.0" encoding="utf-8"?>
<ns0:VATRefundUpload xmlns:ns0="targetNamespace">
    <ns0:FileReference>2064745</ns0:FileReference>

2064745

我看到的一个问题是,您的xsd和xml有不同的根节点—VATROUNT和VATROUNGUPLOAD。
如果这是一个输入错误,请提供一个正确的示例输入。

您的文件应该使用它,因为它抱怨XPath表达式中的前缀“vat”,所以我认为有问题的代码是不同的:也就是说,我认为错误出现在您没有向我们展示的代码中。如果您需要帮助,请发布一个。谢谢