1
我正在嘗試讀取具有對xsd doc.properties的XML文檔,但是當我這樣做時,我最終得到「文檔類型聲明中包含或指向的標記聲明必須清晰,形成「錯誤。不知道錯誤是什麼。提前感謝。XML標記聲明錯誤
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE XML SYSTEM "NGPSCustomerConfig.xsd">
<NGPSCustomerConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="NGPSCustomerConfg.xsd">
<CustomerInfo id="NGPS">
<CustomerName>NGPS</CustomerName>
<CustomerAdditionalInfo> Additional Info</CustomerAdditionalInfo>
<ToolInfo>
<toolName>Service Manager</toolName>
<toolID>SM01</toolID>
<toolType>ITSM</toolType>
<toolProperty>001_SM01.Properties</toolProperty>
</ToolInfo>
<ToolInfo>
<toolName>Orchestrator</toolName>
<toolID>ORCH01</toolID>
<toolType>ORCHESTRATOR</toolType>
<toolProperty>001_ORCH01.properties</toolProperty>
</ToolInfo>
<ToolInfo>
<toolName>Event Manager</toolName>
<toolID>EM01</toolID>
<toolType>EVENT MANAGER</toolType>
<toolProperty>001_EM01.properties</toolProperty>
</ToolInfo>
</CustomerInfo>
</NGPSCustomerConfig>
XSD文件是
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="NGPSCustomerConfig">
<xs:complexType>
<xs:sequence>
<xs:element name="CustomerInfo">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="CustomerName" />
<xs:element type="xs:string" name="CustomerAdditionalInfo">
</xs:element>
<xs:element name="ToolInfo" maxOccurs="unbounded"
minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="toolName" />
<xs:element type="xs:string" name="toolID" />
<xs:element type="xs:string" name="toolType" />
<xs:element type="xs:string" name="toolProperty" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute type="xs:string" name="id" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>