Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/13.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
如何更正XSD以便XML验证?_Xml_Xsd_Xml Validation - Fatal编程技术网

如何更正XSD以便XML验证?

如何更正XSD以便XML验证?,xml,xsd,xml-validation,Xml,Xsd,Xml Validation,在我的应用程序中,我有如下所示的XSD。这些是对我的应用程序中现有XSD的修改,它们是我的出发点 GPSInformation.xsd <?xml version="1.0" encoding="utf-8"?> <xs:schema xmlns="aNamespace" elementFormDefault="qualified" targetNamespace="aNamespace" xmlns:xs="http://www.w3.org/2001/XMLSchema"&

在我的应用程序中,我有如下所示的XSD。这些是对我的应用程序中现有XSD的修改,它们是我的出发点

GPSInformation.xsd

<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns="aNamespace" elementFormDefault="qualified" targetNamespace="aNamespace" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:complexType name="gps">
    <xs:annotation>
      <xs:documentation>An instance of this class contains all of the information we want to retrieve from the GPS device.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
       <xs:element minOccurs="0" maxOccurs="1" name="position" type="gpsposition">
        <xs:annotation>
          <xs:documentation>The determined position of the GPS receiver.</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="gpsposition">
    <xs:annotation>
      <xs:documentation>This class represents the GPS coordinates read from the GPS device that is connected to the computer.  An instance of the class represents the position information returned from the GPS device when it is queried for a position.</xs:documentation>
    </xs:annotation>
    <xs:attribute name="lat" use="required">
      <xs:annotation>
        <xs:documentation>The current position's latitude, in decimal degrees.  Range is -90.000 to +90.000.</xs:documentation>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:double">
          <xs:minInclusive value="-90"/>
          <xs:maxInclusive value="90"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="long" use="required">
      <xs:annotation>
        <xs:documentation>The current position's longitude, in decimal degrees.  Range is +180.000 to -180.000.</xs:documentation>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:double">
          <xs:minInclusive value="-180"/>
          <xs:maxInclusive value="180"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:complexType>
</xs:schema>
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns="aNamespace" elementFormDefault="qualified" targetNamespace="aNamespace" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:complexType name="snapshot">
    <xs:annotation>
      <xs:documentation>One snapshot taken by a camera in the system.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="1" name="imagedata" type="xs:base64Binary">
        <xs:annotation>
          <xs:documentation>The binary image representation.</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
    <xs:attribute name="camera" type="xs:string">
      <xs:annotation>
        <xs:documentation>The ID or name of the camera that captured this image.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>
</xs:schema>
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns="aNamespace" elementFormDefault="qualified" targetNamespace="aNamespace" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:include schemaLocation="Snapshot.xsd"/>
    <xs:include schemaLocation="GPSInformation.xsd"/>
    <xs:simpleType name="guid">
        <xs:restriction base="xs:string">
            <xs:pattern value="[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}" />
        </xs:restriction>
    </xs:simpleType>
    <xs:element name="read" type="read"/>
    <xs:complexType name="read">
        <xs:annotation>
            <xs:documentation>Represents a read generated from an LPR camera.</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="snapshot">
                <xs:sequence>
                    <xs:element minOccurs="1" maxOccurs="1" name="timestamp" type="xs:dateTime">
                        <xs:annotation>
                            <xs:documentation>The timestamp of the time this item was generated.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="plate" type="xs:string">
                        <xs:annotation>
                            <xs:documentation>The OCR of the plate read.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="confidence" type="xs:int">
                        <xs:annotation>
                            <xs:documentation>The confidence level of the OCR. Usually from 1 to 100.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="overviews">
                        <xs:annotation>
                            <xs:documentation>All secondary images associated with this item.</xs:documentation>
                        </xs:annotation>
                        <xs:complexType>
                            <xs:sequence>
                                <xs:element minOccurs="0" maxOccurs="unbounded" name="snapshot" type="snapshot"/>
                            </xs:sequence>
                        </xs:complexType>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="gps" type="gps">
                        <xs:annotation>
                            <xs:documentation>The GPS information of the reader when this read was taken.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
                <xs:attribute name="id" type="guid" use="required">
                    <xs:annotation>
                        <xs:documentation>A unique ID to represent this read.</xs:documentation>
                    </xs:annotation>
                </xs:attribute>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
</xs:schema>
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns="aNamespace" elementFormDefault="qualified" targetNamespace="aNamespace" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
  <xs:include schemaLocation="Read.xsd" />
  <xs:element name="reads" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msdata:Prefix="x">
    <xs:complexType>
      <xs:annotation>
        <xs:documentation>Contains one or more reads generated from one or more LPR cameras.</xs:documentation>
      </xs:annotation>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="read" msdata:Prefix="x" type="read" minOccurs="0" maxOccurs="unbounded">
          <xs:annotation>
            <xs:documentation>Contains information for 0 or more reads.</xs:documentation>
          </xs:annotation>
        </xs:element>
      </xs:choice>
    </xs:complexType>
  </xs:element>
</xs:schema>
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns="aNamespace"
           elementFormDefault="qualified"
           targetNamespace="aNamespace"
           xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="imagedata" type="xs:string">
    <xs:annotation>
      <xs:documentation>The binary image
      representation.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="snapshot">
    <xs:annotation>
      <xs:documentation>One snapshot taken by a camera in the
      system.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="1" ref="imagedata"/>
    </xs:sequence>
    <xs:attribute name="camera" type="xs:string">
      <xs:annotation>
        <xs:documentation>The ID or name of the camera that captured
        this image.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>
</xs:schema>
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns="aNamespace"
           elementFormDefault="qualified"
           targetNamespace="aNamespace"
           xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:include schemaLocation="Snapshot.xsd"/>
  <xs:include schemaLocation="GPSInformation.xsd"/>
  <xs:simpleType name="guid">
    <xs:restriction base="xs:string">
      <xs:pattern value="[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}" />
    </xs:restriction>
  </xs:simpleType>
  <xs:element name="read" type="read"/>
  <xs:complexType name="read">
    <xs:annotation>
      <xs:documentation>Represents a read generated from an LPR
      camera.</xs:documentation>
    </xs:annotation>
    <xs:complexContent mixed="false">
      <xs:extension base="snapshot">
        <xs:sequence>
          <xs:element minOccurs="1" maxOccurs="1"
                      name="timestamp" type="xs:dateTime">
            <xs:annotation>
              <xs:documentation>The timestamp of the time this item
              was generated.</xs:documentation>
            </xs:annotation>
          </xs:element>

          <xs:element minOccurs="0" maxOccurs="1" ref="imagedata"/>

          <xs:element minOccurs="0" maxOccurs="1" name="plate" type="xs:string">
            <xs:annotation>
              <xs:documentation>The OCR of the plate read.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element minOccurs="0" maxOccurs="1" name="confidence" type="xs:int">
            <xs:annotation>
              <xs:documentation>The confidence level of the
              OCR. Usually from 1 to 100.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element minOccurs="0" maxOccurs="1" name="overviews">
            <xs:annotation>
              <xs:documentation>All secondary images associated with
              this item.</xs:documentation>
            </xs:annotation>
            <xs:complexType>
              <xs:sequence>
                <xs:element minOccurs="0" maxOccurs="unbounded"
                            name="snapshot" type="snapshot"/>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
          <xs:element minOccurs="0" maxOccurs="1" name="gps" type="gps">
            <xs:annotation>
              <xs:documentation>The GPS information of the reader when
              this read was taken.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
        <xs:attribute name="id" type="guid" use="required">
          <xs:annotation>
            <xs:documentation>A unique ID to represent this
            read.</xs:documentation>
          </xs:annotation>
        </xs:attribute>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
</xs:schema>

此类的实例包含我们希望从GPS设备检索的所有信息。
GPS接收机的确定位置。
此类表示从连接到计算机的GPS设备读取的GPS坐标。该类的实例表示在查询GPS设备的位置时从该设备返回的位置信息。
当前位置的纬度,以十进制度数表示。范围为-90.000至+90.000。
当前位置的经度,以十进制度数表示。范围为+180.000至-180.000。

Snapshot.xsd

<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns="aNamespace" elementFormDefault="qualified" targetNamespace="aNamespace" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:complexType name="gps">
    <xs:annotation>
      <xs:documentation>An instance of this class contains all of the information we want to retrieve from the GPS device.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
       <xs:element minOccurs="0" maxOccurs="1" name="position" type="gpsposition">
        <xs:annotation>
          <xs:documentation>The determined position of the GPS receiver.</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="gpsposition">
    <xs:annotation>
      <xs:documentation>This class represents the GPS coordinates read from the GPS device that is connected to the computer.  An instance of the class represents the position information returned from the GPS device when it is queried for a position.</xs:documentation>
    </xs:annotation>
    <xs:attribute name="lat" use="required">
      <xs:annotation>
        <xs:documentation>The current position's latitude, in decimal degrees.  Range is -90.000 to +90.000.</xs:documentation>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:double">
          <xs:minInclusive value="-90"/>
          <xs:maxInclusive value="90"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="long" use="required">
      <xs:annotation>
        <xs:documentation>The current position's longitude, in decimal degrees.  Range is +180.000 to -180.000.</xs:documentation>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:double">
          <xs:minInclusive value="-180"/>
          <xs:maxInclusive value="180"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:complexType>
</xs:schema>
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns="aNamespace" elementFormDefault="qualified" targetNamespace="aNamespace" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:complexType name="snapshot">
    <xs:annotation>
      <xs:documentation>One snapshot taken by a camera in the system.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="1" name="imagedata" type="xs:base64Binary">
        <xs:annotation>
          <xs:documentation>The binary image representation.</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
    <xs:attribute name="camera" type="xs:string">
      <xs:annotation>
        <xs:documentation>The ID or name of the camera that captured this image.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>
</xs:schema>
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns="aNamespace" elementFormDefault="qualified" targetNamespace="aNamespace" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:include schemaLocation="Snapshot.xsd"/>
    <xs:include schemaLocation="GPSInformation.xsd"/>
    <xs:simpleType name="guid">
        <xs:restriction base="xs:string">
            <xs:pattern value="[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}" />
        </xs:restriction>
    </xs:simpleType>
    <xs:element name="read" type="read"/>
    <xs:complexType name="read">
        <xs:annotation>
            <xs:documentation>Represents a read generated from an LPR camera.</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="snapshot">
                <xs:sequence>
                    <xs:element minOccurs="1" maxOccurs="1" name="timestamp" type="xs:dateTime">
                        <xs:annotation>
                            <xs:documentation>The timestamp of the time this item was generated.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="plate" type="xs:string">
                        <xs:annotation>
                            <xs:documentation>The OCR of the plate read.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="confidence" type="xs:int">
                        <xs:annotation>
                            <xs:documentation>The confidence level of the OCR. Usually from 1 to 100.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="overviews">
                        <xs:annotation>
                            <xs:documentation>All secondary images associated with this item.</xs:documentation>
                        </xs:annotation>
                        <xs:complexType>
                            <xs:sequence>
                                <xs:element minOccurs="0" maxOccurs="unbounded" name="snapshot" type="snapshot"/>
                            </xs:sequence>
                        </xs:complexType>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="gps" type="gps">
                        <xs:annotation>
                            <xs:documentation>The GPS information of the reader when this read was taken.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
                <xs:attribute name="id" type="guid" use="required">
                    <xs:annotation>
                        <xs:documentation>A unique ID to represent this read.</xs:documentation>
                    </xs:annotation>
                </xs:attribute>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
</xs:schema>
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns="aNamespace" elementFormDefault="qualified" targetNamespace="aNamespace" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
  <xs:include schemaLocation="Read.xsd" />
  <xs:element name="reads" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msdata:Prefix="x">
    <xs:complexType>
      <xs:annotation>
        <xs:documentation>Contains one or more reads generated from one or more LPR cameras.</xs:documentation>
      </xs:annotation>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="read" msdata:Prefix="x" type="read" minOccurs="0" maxOccurs="unbounded">
          <xs:annotation>
            <xs:documentation>Contains information for 0 or more reads.</xs:documentation>
          </xs:annotation>
        </xs:element>
      </xs:choice>
    </xs:complexType>
  </xs:element>
</xs:schema>
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns="aNamespace"
           elementFormDefault="qualified"
           targetNamespace="aNamespace"
           xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="imagedata" type="xs:string">
    <xs:annotation>
      <xs:documentation>The binary image
      representation.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="snapshot">
    <xs:annotation>
      <xs:documentation>One snapshot taken by a camera in the
      system.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="1" ref="imagedata"/>
    </xs:sequence>
    <xs:attribute name="camera" type="xs:string">
      <xs:annotation>
        <xs:documentation>The ID or name of the camera that captured
        this image.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>
</xs:schema>
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns="aNamespace"
           elementFormDefault="qualified"
           targetNamespace="aNamespace"
           xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:include schemaLocation="Snapshot.xsd"/>
  <xs:include schemaLocation="GPSInformation.xsd"/>
  <xs:simpleType name="guid">
    <xs:restriction base="xs:string">
      <xs:pattern value="[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}" />
    </xs:restriction>
  </xs:simpleType>
  <xs:element name="read" type="read"/>
  <xs:complexType name="read">
    <xs:annotation>
      <xs:documentation>Represents a read generated from an LPR
      camera.</xs:documentation>
    </xs:annotation>
    <xs:complexContent mixed="false">
      <xs:extension base="snapshot">
        <xs:sequence>
          <xs:element minOccurs="1" maxOccurs="1"
                      name="timestamp" type="xs:dateTime">
            <xs:annotation>
              <xs:documentation>The timestamp of the time this item
              was generated.</xs:documentation>
            </xs:annotation>
          </xs:element>

          <xs:element minOccurs="0" maxOccurs="1" ref="imagedata"/>

          <xs:element minOccurs="0" maxOccurs="1" name="plate" type="xs:string">
            <xs:annotation>
              <xs:documentation>The OCR of the plate read.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element minOccurs="0" maxOccurs="1" name="confidence" type="xs:int">
            <xs:annotation>
              <xs:documentation>The confidence level of the
              OCR. Usually from 1 to 100.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element minOccurs="0" maxOccurs="1" name="overviews">
            <xs:annotation>
              <xs:documentation>All secondary images associated with
              this item.</xs:documentation>
            </xs:annotation>
            <xs:complexType>
              <xs:sequence>
                <xs:element minOccurs="0" maxOccurs="unbounded"
                            name="snapshot" type="snapshot"/>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
          <xs:element minOccurs="0" maxOccurs="1" name="gps" type="gps">
            <xs:annotation>
              <xs:documentation>The GPS information of the reader when
              this read was taken.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
        <xs:attribute name="id" type="guid" use="required">
          <xs:annotation>
            <xs:documentation>A unique ID to represent this
            read.</xs:documentation>
          </xs:annotation>
        </xs:attribute>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
</xs:schema>

系统中的摄像头拍摄的一张快照。
二值图像表示法。
捕获此图像的照相机的ID或名称。

Read.xsd

<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns="aNamespace" elementFormDefault="qualified" targetNamespace="aNamespace" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:complexType name="gps">
    <xs:annotation>
      <xs:documentation>An instance of this class contains all of the information we want to retrieve from the GPS device.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
       <xs:element minOccurs="0" maxOccurs="1" name="position" type="gpsposition">
        <xs:annotation>
          <xs:documentation>The determined position of the GPS receiver.</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="gpsposition">
    <xs:annotation>
      <xs:documentation>This class represents the GPS coordinates read from the GPS device that is connected to the computer.  An instance of the class represents the position information returned from the GPS device when it is queried for a position.</xs:documentation>
    </xs:annotation>
    <xs:attribute name="lat" use="required">
      <xs:annotation>
        <xs:documentation>The current position's latitude, in decimal degrees.  Range is -90.000 to +90.000.</xs:documentation>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:double">
          <xs:minInclusive value="-90"/>
          <xs:maxInclusive value="90"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="long" use="required">
      <xs:annotation>
        <xs:documentation>The current position's longitude, in decimal degrees.  Range is +180.000 to -180.000.</xs:documentation>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:double">
          <xs:minInclusive value="-180"/>
          <xs:maxInclusive value="180"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:complexType>
</xs:schema>
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns="aNamespace" elementFormDefault="qualified" targetNamespace="aNamespace" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:complexType name="snapshot">
    <xs:annotation>
      <xs:documentation>One snapshot taken by a camera in the system.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="1" name="imagedata" type="xs:base64Binary">
        <xs:annotation>
          <xs:documentation>The binary image representation.</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
    <xs:attribute name="camera" type="xs:string">
      <xs:annotation>
        <xs:documentation>The ID or name of the camera that captured this image.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>
</xs:schema>
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns="aNamespace" elementFormDefault="qualified" targetNamespace="aNamespace" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:include schemaLocation="Snapshot.xsd"/>
    <xs:include schemaLocation="GPSInformation.xsd"/>
    <xs:simpleType name="guid">
        <xs:restriction base="xs:string">
            <xs:pattern value="[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}" />
        </xs:restriction>
    </xs:simpleType>
    <xs:element name="read" type="read"/>
    <xs:complexType name="read">
        <xs:annotation>
            <xs:documentation>Represents a read generated from an LPR camera.</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="snapshot">
                <xs:sequence>
                    <xs:element minOccurs="1" maxOccurs="1" name="timestamp" type="xs:dateTime">
                        <xs:annotation>
                            <xs:documentation>The timestamp of the time this item was generated.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="plate" type="xs:string">
                        <xs:annotation>
                            <xs:documentation>The OCR of the plate read.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="confidence" type="xs:int">
                        <xs:annotation>
                            <xs:documentation>The confidence level of the OCR. Usually from 1 to 100.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="overviews">
                        <xs:annotation>
                            <xs:documentation>All secondary images associated with this item.</xs:documentation>
                        </xs:annotation>
                        <xs:complexType>
                            <xs:sequence>
                                <xs:element minOccurs="0" maxOccurs="unbounded" name="snapshot" type="snapshot"/>
                            </xs:sequence>
                        </xs:complexType>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="gps" type="gps">
                        <xs:annotation>
                            <xs:documentation>The GPS information of the reader when this read was taken.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
                <xs:attribute name="id" type="guid" use="required">
                    <xs:annotation>
                        <xs:documentation>A unique ID to represent this read.</xs:documentation>
                    </xs:annotation>
                </xs:attribute>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
</xs:schema>
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns="aNamespace" elementFormDefault="qualified" targetNamespace="aNamespace" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
  <xs:include schemaLocation="Read.xsd" />
  <xs:element name="reads" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msdata:Prefix="x">
    <xs:complexType>
      <xs:annotation>
        <xs:documentation>Contains one or more reads generated from one or more LPR cameras.</xs:documentation>
      </xs:annotation>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="read" msdata:Prefix="x" type="read" minOccurs="0" maxOccurs="unbounded">
          <xs:annotation>
            <xs:documentation>Contains information for 0 or more reads.</xs:documentation>
          </xs:annotation>
        </xs:element>
      </xs:choice>
    </xs:complexType>
  </xs:element>
</xs:schema>
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns="aNamespace"
           elementFormDefault="qualified"
           targetNamespace="aNamespace"
           xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="imagedata" type="xs:string">
    <xs:annotation>
      <xs:documentation>The binary image
      representation.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="snapshot">
    <xs:annotation>
      <xs:documentation>One snapshot taken by a camera in the
      system.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="1" ref="imagedata"/>
    </xs:sequence>
    <xs:attribute name="camera" type="xs:string">
      <xs:annotation>
        <xs:documentation>The ID or name of the camera that captured
        this image.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>
</xs:schema>
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns="aNamespace"
           elementFormDefault="qualified"
           targetNamespace="aNamespace"
           xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:include schemaLocation="Snapshot.xsd"/>
  <xs:include schemaLocation="GPSInformation.xsd"/>
  <xs:simpleType name="guid">
    <xs:restriction base="xs:string">
      <xs:pattern value="[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}" />
    </xs:restriction>
  </xs:simpleType>
  <xs:element name="read" type="read"/>
  <xs:complexType name="read">
    <xs:annotation>
      <xs:documentation>Represents a read generated from an LPR
      camera.</xs:documentation>
    </xs:annotation>
    <xs:complexContent mixed="false">
      <xs:extension base="snapshot">
        <xs:sequence>
          <xs:element minOccurs="1" maxOccurs="1"
                      name="timestamp" type="xs:dateTime">
            <xs:annotation>
              <xs:documentation>The timestamp of the time this item
              was generated.</xs:documentation>
            </xs:annotation>
          </xs:element>

          <xs:element minOccurs="0" maxOccurs="1" ref="imagedata"/>

          <xs:element minOccurs="0" maxOccurs="1" name="plate" type="xs:string">
            <xs:annotation>
              <xs:documentation>The OCR of the plate read.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element minOccurs="0" maxOccurs="1" name="confidence" type="xs:int">
            <xs:annotation>
              <xs:documentation>The confidence level of the
              OCR. Usually from 1 to 100.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element minOccurs="0" maxOccurs="1" name="overviews">
            <xs:annotation>
              <xs:documentation>All secondary images associated with
              this item.</xs:documentation>
            </xs:annotation>
            <xs:complexType>
              <xs:sequence>
                <xs:element minOccurs="0" maxOccurs="unbounded"
                            name="snapshot" type="snapshot"/>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
          <xs:element minOccurs="0" maxOccurs="1" name="gps" type="gps">
            <xs:annotation>
              <xs:documentation>The GPS information of the reader when
              this read was taken.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
        <xs:attribute name="id" type="guid" use="required">
          <xs:annotation>
            <xs:documentation>A unique ID to represent this
            read.</xs:documentation>
          </xs:annotation>
        </xs:attribute>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
</xs:schema>

表示从LPR相机生成的读取。
生成此项的时间戳。
车牌的光学字符识别显示。
OCR的置信水平。通常从1到100。
与此项目关联的所有次映像。
读取此读数时读取器的GPS信息。
表示此读取的唯一ID。

Main.xsd

<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns="aNamespace" elementFormDefault="qualified" targetNamespace="aNamespace" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:complexType name="gps">
    <xs:annotation>
      <xs:documentation>An instance of this class contains all of the information we want to retrieve from the GPS device.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
       <xs:element minOccurs="0" maxOccurs="1" name="position" type="gpsposition">
        <xs:annotation>
          <xs:documentation>The determined position of the GPS receiver.</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="gpsposition">
    <xs:annotation>
      <xs:documentation>This class represents the GPS coordinates read from the GPS device that is connected to the computer.  An instance of the class represents the position information returned from the GPS device when it is queried for a position.</xs:documentation>
    </xs:annotation>
    <xs:attribute name="lat" use="required">
      <xs:annotation>
        <xs:documentation>The current position's latitude, in decimal degrees.  Range is -90.000 to +90.000.</xs:documentation>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:double">
          <xs:minInclusive value="-90"/>
          <xs:maxInclusive value="90"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="long" use="required">
      <xs:annotation>
        <xs:documentation>The current position's longitude, in decimal degrees.  Range is +180.000 to -180.000.</xs:documentation>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:double">
          <xs:minInclusive value="-180"/>
          <xs:maxInclusive value="180"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:complexType>
</xs:schema>
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns="aNamespace" elementFormDefault="qualified" targetNamespace="aNamespace" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:complexType name="snapshot">
    <xs:annotation>
      <xs:documentation>One snapshot taken by a camera in the system.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="1" name="imagedata" type="xs:base64Binary">
        <xs:annotation>
          <xs:documentation>The binary image representation.</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
    <xs:attribute name="camera" type="xs:string">
      <xs:annotation>
        <xs:documentation>The ID or name of the camera that captured this image.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>
</xs:schema>
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns="aNamespace" elementFormDefault="qualified" targetNamespace="aNamespace" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:include schemaLocation="Snapshot.xsd"/>
    <xs:include schemaLocation="GPSInformation.xsd"/>
    <xs:simpleType name="guid">
        <xs:restriction base="xs:string">
            <xs:pattern value="[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}" />
        </xs:restriction>
    </xs:simpleType>
    <xs:element name="read" type="read"/>
    <xs:complexType name="read">
        <xs:annotation>
            <xs:documentation>Represents a read generated from an LPR camera.</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="snapshot">
                <xs:sequence>
                    <xs:element minOccurs="1" maxOccurs="1" name="timestamp" type="xs:dateTime">
                        <xs:annotation>
                            <xs:documentation>The timestamp of the time this item was generated.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="plate" type="xs:string">
                        <xs:annotation>
                            <xs:documentation>The OCR of the plate read.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="confidence" type="xs:int">
                        <xs:annotation>
                            <xs:documentation>The confidence level of the OCR. Usually from 1 to 100.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="overviews">
                        <xs:annotation>
                            <xs:documentation>All secondary images associated with this item.</xs:documentation>
                        </xs:annotation>
                        <xs:complexType>
                            <xs:sequence>
                                <xs:element minOccurs="0" maxOccurs="unbounded" name="snapshot" type="snapshot"/>
                            </xs:sequence>
                        </xs:complexType>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="gps" type="gps">
                        <xs:annotation>
                            <xs:documentation>The GPS information of the reader when this read was taken.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
                <xs:attribute name="id" type="guid" use="required">
                    <xs:annotation>
                        <xs:documentation>A unique ID to represent this read.</xs:documentation>
                    </xs:annotation>
                </xs:attribute>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
</xs:schema>
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns="aNamespace" elementFormDefault="qualified" targetNamespace="aNamespace" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
  <xs:include schemaLocation="Read.xsd" />
  <xs:element name="reads" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msdata:Prefix="x">
    <xs:complexType>
      <xs:annotation>
        <xs:documentation>Contains one or more reads generated from one or more LPR cameras.</xs:documentation>
      </xs:annotation>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="read" msdata:Prefix="x" type="read" minOccurs="0" maxOccurs="unbounded">
          <xs:annotation>
            <xs:documentation>Contains information for 0 or more reads.</xs:documentation>
          </xs:annotation>
        </xs:element>
      </xs:choice>
    </xs:complexType>
  </xs:element>
</xs:schema>
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns="aNamespace"
           elementFormDefault="qualified"
           targetNamespace="aNamespace"
           xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="imagedata" type="xs:string">
    <xs:annotation>
      <xs:documentation>The binary image
      representation.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="snapshot">
    <xs:annotation>
      <xs:documentation>One snapshot taken by a camera in the
      system.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="1" ref="imagedata"/>
    </xs:sequence>
    <xs:attribute name="camera" type="xs:string">
      <xs:annotation>
        <xs:documentation>The ID or name of the camera that captured
        this image.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>
</xs:schema>
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns="aNamespace"
           elementFormDefault="qualified"
           targetNamespace="aNamespace"
           xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:include schemaLocation="Snapshot.xsd"/>
  <xs:include schemaLocation="GPSInformation.xsd"/>
  <xs:simpleType name="guid">
    <xs:restriction base="xs:string">
      <xs:pattern value="[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}" />
    </xs:restriction>
  </xs:simpleType>
  <xs:element name="read" type="read"/>
  <xs:complexType name="read">
    <xs:annotation>
      <xs:documentation>Represents a read generated from an LPR
      camera.</xs:documentation>
    </xs:annotation>
    <xs:complexContent mixed="false">
      <xs:extension base="snapshot">
        <xs:sequence>
          <xs:element minOccurs="1" maxOccurs="1"
                      name="timestamp" type="xs:dateTime">
            <xs:annotation>
              <xs:documentation>The timestamp of the time this item
              was generated.</xs:documentation>
            </xs:annotation>
          </xs:element>

          <xs:element minOccurs="0" maxOccurs="1" ref="imagedata"/>

          <xs:element minOccurs="0" maxOccurs="1" name="plate" type="xs:string">
            <xs:annotation>
              <xs:documentation>The OCR of the plate read.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element minOccurs="0" maxOccurs="1" name="confidence" type="xs:int">
            <xs:annotation>
              <xs:documentation>The confidence level of the
              OCR. Usually from 1 to 100.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element minOccurs="0" maxOccurs="1" name="overviews">
            <xs:annotation>
              <xs:documentation>All secondary images associated with
              this item.</xs:documentation>
            </xs:annotation>
            <xs:complexType>
              <xs:sequence>
                <xs:element minOccurs="0" maxOccurs="unbounded"
                            name="snapshot" type="snapshot"/>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
          <xs:element minOccurs="0" maxOccurs="1" name="gps" type="gps">
            <xs:annotation>
              <xs:documentation>The GPS information of the reader when
              this read was taken.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
        <xs:attribute name="id" type="guid" use="required">
          <xs:annotation>
            <xs:documentation>A unique ID to represent this
            read.</xs:documentation>
          </xs:annotation>
        </xs:attribute>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
</xs:schema>

包含从一个或多个LPR摄像头生成的一个或多个读取。
包含0次或多次读取的信息。
我还有一个示例XML文件,这是修改后的XSD必须描述的格式

<?xml version="1.0" encoding="utf-8"?>
<x:reads xmlns:x="aNamespace">
  <x:read camera="Right" id="0a92adbb-01dd-4a85-ae1b-d420e30d6896">
    <x:timestamp>2015-06-12T16:47:04.1470000-04:00</x:timestamp>
    <x:imagedata>a</x:imagedata>
    <x:plate>TAXSCOFF</x:plate>
    <x:confidence>95</x:confidence>
    <x:overviews>
      <x:snapshot camera="Right">
        <x:imagedata></x:imagedata>
      </x:snapshot>
    </x:overviews>
    <x:gps>
      <x:position lat="41.366743911028792" long="-73.613886014875149" />
    </x:gps>
  </x:read>
  <x:read camera="Right" id="0c5ee809-c6ce-4866-af2c-d7d561b99263">
    <x:timestamp>2015-06-12T16:43:46.1880000-04:00</x:timestamp>
    <x:imagedata>a</x:imagedata>
    <x:plate>WANTEDPE</x:plate>
    <x:confidence>87</x:confidence>
    <x:overviews>
      <x:snapshot camera="Right">
        <x:imagedata></x:imagedata>
      </x:snapshot>
    </x:overviews>
    <x:gps>
      <x:position lat="41.366748955299791" long="-73.613680088554659" />
    </x:gps>
  </x:read>
</x:reads>

2015-06-12T16:47:04.1470000-04:00
A.
税关
95
2015-06-12T16:43:46.1880000-04:00
A.
想要的
87
XML未验证:我收到的消息是:

命名空间“aNamespace”中的元素“read”在命名空间“aNamespace”中具有无效的子元素“imagedata”。名称空间“aNamespace”中预期的可能元素列表:“板块、信心、概览、gps”


如何修复xsd以便xml进行验证?

只需将
imagedata
元素的全局声明添加到Snapshot.xsd:

  <xs:element name="imagedata" type="xs:string">
    <xs:annotation>
      <xs:documentation>The binary image
      representation.</xs:documentation>
    </xs:annotation>
  </xs:element>

二值图像
代表性。
然后在需要的两个地方引用它:

      <xs:element minOccurs="0" maxOccurs="1" ref="imagedata"/>

您的XML将成功验证

这是两个完全改变的XSD

Snapshot.xsd

<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns="aNamespace" elementFormDefault="qualified" targetNamespace="aNamespace" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:complexType name="gps">
    <xs:annotation>
      <xs:documentation>An instance of this class contains all of the information we want to retrieve from the GPS device.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
       <xs:element minOccurs="0" maxOccurs="1" name="position" type="gpsposition">
        <xs:annotation>
          <xs:documentation>The determined position of the GPS receiver.</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="gpsposition">
    <xs:annotation>
      <xs:documentation>This class represents the GPS coordinates read from the GPS device that is connected to the computer.  An instance of the class represents the position information returned from the GPS device when it is queried for a position.</xs:documentation>
    </xs:annotation>
    <xs:attribute name="lat" use="required">
      <xs:annotation>
        <xs:documentation>The current position's latitude, in decimal degrees.  Range is -90.000 to +90.000.</xs:documentation>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:double">
          <xs:minInclusive value="-90"/>
          <xs:maxInclusive value="90"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="long" use="required">
      <xs:annotation>
        <xs:documentation>The current position's longitude, in decimal degrees.  Range is +180.000 to -180.000.</xs:documentation>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:double">
          <xs:minInclusive value="-180"/>
          <xs:maxInclusive value="180"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:complexType>
</xs:schema>
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns="aNamespace" elementFormDefault="qualified" targetNamespace="aNamespace" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:complexType name="snapshot">
    <xs:annotation>
      <xs:documentation>One snapshot taken by a camera in the system.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="1" name="imagedata" type="xs:base64Binary">
        <xs:annotation>
          <xs:documentation>The binary image representation.</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
    <xs:attribute name="camera" type="xs:string">
      <xs:annotation>
        <xs:documentation>The ID or name of the camera that captured this image.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>
</xs:schema>
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns="aNamespace" elementFormDefault="qualified" targetNamespace="aNamespace" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:include schemaLocation="Snapshot.xsd"/>
    <xs:include schemaLocation="GPSInformation.xsd"/>
    <xs:simpleType name="guid">
        <xs:restriction base="xs:string">
            <xs:pattern value="[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}" />
        </xs:restriction>
    </xs:simpleType>
    <xs:element name="read" type="read"/>
    <xs:complexType name="read">
        <xs:annotation>
            <xs:documentation>Represents a read generated from an LPR camera.</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="snapshot">
                <xs:sequence>
                    <xs:element minOccurs="1" maxOccurs="1" name="timestamp" type="xs:dateTime">
                        <xs:annotation>
                            <xs:documentation>The timestamp of the time this item was generated.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="plate" type="xs:string">
                        <xs:annotation>
                            <xs:documentation>The OCR of the plate read.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="confidence" type="xs:int">
                        <xs:annotation>
                            <xs:documentation>The confidence level of the OCR. Usually from 1 to 100.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="overviews">
                        <xs:annotation>
                            <xs:documentation>All secondary images associated with this item.</xs:documentation>
                        </xs:annotation>
                        <xs:complexType>
                            <xs:sequence>
                                <xs:element minOccurs="0" maxOccurs="unbounded" name="snapshot" type="snapshot"/>
                            </xs:sequence>
                        </xs:complexType>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="gps" type="gps">
                        <xs:annotation>
                            <xs:documentation>The GPS information of the reader when this read was taken.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
                <xs:attribute name="id" type="guid" use="required">
                    <xs:annotation>
                        <xs:documentation>A unique ID to represent this read.</xs:documentation>
                    </xs:annotation>
                </xs:attribute>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
</xs:schema>
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns="aNamespace" elementFormDefault="qualified" targetNamespace="aNamespace" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
  <xs:include schemaLocation="Read.xsd" />
  <xs:element name="reads" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msdata:Prefix="x">
    <xs:complexType>
      <xs:annotation>
        <xs:documentation>Contains one or more reads generated from one or more LPR cameras.</xs:documentation>
      </xs:annotation>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="read" msdata:Prefix="x" type="read" minOccurs="0" maxOccurs="unbounded">
          <xs:annotation>
            <xs:documentation>Contains information for 0 or more reads.</xs:documentation>
          </xs:annotation>
        </xs:element>
      </xs:choice>
    </xs:complexType>
  </xs:element>
</xs:schema>
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns="aNamespace"
           elementFormDefault="qualified"
           targetNamespace="aNamespace"
           xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="imagedata" type="xs:string">
    <xs:annotation>
      <xs:documentation>The binary image
      representation.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="snapshot">
    <xs:annotation>
      <xs:documentation>One snapshot taken by a camera in the
      system.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="1" ref="imagedata"/>
    </xs:sequence>
    <xs:attribute name="camera" type="xs:string">
      <xs:annotation>
        <xs:documentation>The ID or name of the camera that captured
        this image.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>
</xs:schema>
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns="aNamespace"
           elementFormDefault="qualified"
           targetNamespace="aNamespace"
           xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:include schemaLocation="Snapshot.xsd"/>
  <xs:include schemaLocation="GPSInformation.xsd"/>
  <xs:simpleType name="guid">
    <xs:restriction base="xs:string">
      <xs:pattern value="[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}" />
    </xs:restriction>
  </xs:simpleType>
  <xs:element name="read" type="read"/>
  <xs:complexType name="read">
    <xs:annotation>
      <xs:documentation>Represents a read generated from an LPR
      camera.</xs:documentation>
    </xs:annotation>
    <xs:complexContent mixed="false">
      <xs:extension base="snapshot">
        <xs:sequence>
          <xs:element minOccurs="1" maxOccurs="1"
                      name="timestamp" type="xs:dateTime">
            <xs:annotation>
              <xs:documentation>The timestamp of the time this item
              was generated.</xs:documentation>
            </xs:annotation>
          </xs:element>

          <xs:element minOccurs="0" maxOccurs="1" ref="imagedata"/>

          <xs:element minOccurs="0" maxOccurs="1" name="plate" type="xs:string">
            <xs:annotation>
              <xs:documentation>The OCR of the plate read.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element minOccurs="0" maxOccurs="1" name="confidence" type="xs:int">
            <xs:annotation>
              <xs:documentation>The confidence level of the
              OCR. Usually from 1 to 100.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element minOccurs="0" maxOccurs="1" name="overviews">
            <xs:annotation>
              <xs:documentation>All secondary images associated with
              this item.</xs:documentation>
            </xs:annotation>
            <xs:complexType>
              <xs:sequence>
                <xs:element minOccurs="0" maxOccurs="unbounded"
                            name="snapshot" type="snapshot"/>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
          <xs:element minOccurs="0" maxOccurs="1" name="gps" type="gps">
            <xs:annotation>
              <xs:documentation>The GPS information of the reader when
              this read was taken.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
        <xs:attribute name="id" type="guid" use="required">
          <xs:annotation>
            <xs:documentation>A unique ID to represent this
            read.</xs:documentation>
          </xs:annotation>
        </xs:attribute>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
</xs:schema>

二值图像
代表性。
一张由照相机在
系统。
捕获的摄影机的ID或名称
这张照片。
Read.xsd

<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns="aNamespace" elementFormDefault="qualified" targetNamespace="aNamespace" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:complexType name="gps">
    <xs:annotation>
      <xs:documentation>An instance of this class contains all of the information we want to retrieve from the GPS device.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
       <xs:element minOccurs="0" maxOccurs="1" name="position" type="gpsposition">
        <xs:annotation>
          <xs:documentation>The determined position of the GPS receiver.</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="gpsposition">
    <xs:annotation>
      <xs:documentation>This class represents the GPS coordinates read from the GPS device that is connected to the computer.  An instance of the class represents the position information returned from the GPS device when it is queried for a position.</xs:documentation>
    </xs:annotation>
    <xs:attribute name="lat" use="required">
      <xs:annotation>
        <xs:documentation>The current position's latitude, in decimal degrees.  Range is -90.000 to +90.000.</xs:documentation>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:double">
          <xs:minInclusive value="-90"/>
          <xs:maxInclusive value="90"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="long" use="required">
      <xs:annotation>
        <xs:documentation>The current position's longitude, in decimal degrees.  Range is +180.000 to -180.000.</xs:documentation>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:double">
          <xs:minInclusive value="-180"/>
          <xs:maxInclusive value="180"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:complexType>
</xs:schema>
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns="aNamespace" elementFormDefault="qualified" targetNamespace="aNamespace" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:complexType name="snapshot">
    <xs:annotation>
      <xs:documentation>One snapshot taken by a camera in the system.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="1" name="imagedata" type="xs:base64Binary">
        <xs:annotation>
          <xs:documentation>The binary image representation.</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
    <xs:attribute name="camera" type="xs:string">
      <xs:annotation>
        <xs:documentation>The ID or name of the camera that captured this image.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>
</xs:schema>
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns="aNamespace" elementFormDefault="qualified" targetNamespace="aNamespace" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:include schemaLocation="Snapshot.xsd"/>
    <xs:include schemaLocation="GPSInformation.xsd"/>
    <xs:simpleType name="guid">
        <xs:restriction base="xs:string">
            <xs:pattern value="[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}" />
        </xs:restriction>
    </xs:simpleType>
    <xs:element name="read" type="read"/>
    <xs:complexType name="read">
        <xs:annotation>
            <xs:documentation>Represents a read generated from an LPR camera.</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="snapshot">
                <xs:sequence>
                    <xs:element minOccurs="1" maxOccurs="1" name="timestamp" type="xs:dateTime">
                        <xs:annotation>
                            <xs:documentation>The timestamp of the time this item was generated.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="plate" type="xs:string">
                        <xs:annotation>
                            <xs:documentation>The OCR of the plate read.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="confidence" type="xs:int">
                        <xs:annotation>
                            <xs:documentation>The confidence level of the OCR. Usually from 1 to 100.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="overviews">
                        <xs:annotation>
                            <xs:documentation>All secondary images associated with this item.</xs:documentation>
                        </xs:annotation>
                        <xs:complexType>
                            <xs:sequence>
                                <xs:element minOccurs="0" maxOccurs="unbounded" name="snapshot" type="snapshot"/>
                            </xs:sequence>
                        </xs:complexType>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="gps" type="gps">
                        <xs:annotation>
                            <xs:documentation>The GPS information of the reader when this read was taken.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
                <xs:attribute name="id" type="guid" use="required">
                    <xs:annotation>
                        <xs:documentation>A unique ID to represent this read.</xs:documentation>
                    </xs:annotation>
                </xs:attribute>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
</xs:schema>
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns="aNamespace" elementFormDefault="qualified" targetNamespace="aNamespace" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
  <xs:include schemaLocation="Read.xsd" />
  <xs:element name="reads" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msdata:Prefix="x">
    <xs:complexType>
      <xs:annotation>
        <xs:documentation>Contains one or more reads generated from one or more LPR cameras.</xs:documentation>
      </xs:annotation>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="read" msdata:Prefix="x" type="read" minOccurs="0" maxOccurs="unbounded">
          <xs:annotation>
            <xs:documentation>Contains information for 0 or more reads.</xs:documentation>
          </xs:annotation>
        </xs:element>
      </xs:choice>
    </xs:complexType>
  </xs:element>
</xs:schema>
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns="aNamespace"
           elementFormDefault="qualified"
           targetNamespace="aNamespace"
           xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="imagedata" type="xs:string">
    <xs:annotation>
      <xs:documentation>The binary image
      representation.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="snapshot">
    <xs:annotation>
      <xs:documentation>One snapshot taken by a camera in the
      system.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="1" ref="imagedata"/>
    </xs:sequence>
    <xs:attribute name="camera" type="xs:string">
      <xs:annotation>
        <xs:documentation>The ID or name of the camera that captured
        this image.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>
</xs:schema>
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns="aNamespace"
           elementFormDefault="qualified"
           targetNamespace="aNamespace"
           xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:include schemaLocation="Snapshot.xsd"/>
  <xs:include schemaLocation="GPSInformation.xsd"/>
  <xs:simpleType name="guid">
    <xs:restriction base="xs:string">
      <xs:pattern value="[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}" />
    </xs:restriction>
  </xs:simpleType>
  <xs:element name="read" type="read"/>
  <xs:complexType name="read">
    <xs:annotation>
      <xs:documentation>Represents a read generated from an LPR
      camera.</xs:documentation>
    </xs:annotation>
    <xs:complexContent mixed="false">
      <xs:extension base="snapshot">
        <xs:sequence>
          <xs:element minOccurs="1" maxOccurs="1"
                      name="timestamp" type="xs:dateTime">
            <xs:annotation>
              <xs:documentation>The timestamp of the time this item
              was generated.</xs:documentation>
            </xs:annotation>
          </xs:element>

          <xs:element minOccurs="0" maxOccurs="1" ref="imagedata"/>

          <xs:element minOccurs="0" maxOccurs="1" name="plate" type="xs:string">
            <xs:annotation>
              <xs:documentation>The OCR of the plate read.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element minOccurs="0" maxOccurs="1" name="confidence" type="xs:int">
            <xs:annotation>
              <xs:documentation>The confidence level of the
              OCR. Usually from 1 to 100.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element minOccurs="0" maxOccurs="1" name="overviews">
            <xs:annotation>
              <xs:documentation>All secondary images associated with
              this item.</xs:documentation>
            </xs:annotation>
            <xs:complexType>
              <xs:sequence>
                <xs:element minOccurs="0" maxOccurs="unbounded"
                            name="snapshot" type="snapshot"/>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
          <xs:element minOccurs="0" maxOccurs="1" name="gps" type="gps">
            <xs:annotation>
              <xs:documentation>The GPS information of the reader when
              this read was taken.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
        <xs:attribute name="id" type="guid" use="required">
          <xs:annotation>
            <xs:documentation>A unique ID to represent this
            read.</xs:documentation>
          </xs:annotation>
        </xs:attribute>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
</xs:schema>

表示从LPR生成的读取
照相机。
此项目的时间戳
已生成。
车牌的光学字符识别显示。
政府的信心水平
光学字符识别。通常从1到100。
与关联的所有次映像
这个项目。
读取时读取的GPS信息
这段文字被记录下来了。
一个唯一的ID来表示这个
阅读

GPSInformation.xsd是问题中引用但未包含的xsd。要么删减xsd,要么包含GPSInformation.xsd,这样您的示例就完整了。另外,
reads
是XML的根元素,但不包含在您发布的任何XSD中。你的问题将很容易解决,但你真的需要张贴一个展示问题的帖子来帮助我们帮助你。谢谢。我已经添加了丢失的XSD。我已经将XSD分开并为您标记。如果你对反对票感到疑惑(我收回了我的票,但其他几个人也加入了),那是因为你没有把你的问题归结到本质上来。请做