我有一個複雜的XML文件,我需要構建一個數據提交給第三方。驗證XML對XSD
他們爲我提供了2架構的與我所放置在有問題的文檔:
http://www.fresh.co.uk/twschemas/Common.xsd
http://www.fresh.co.uk/twschemas/PCPolicy.xsd
我想驗證我的XML對這些XSD。現在,我使用XMPLIFY的MAC做到這一點,常見問題告訴我,我應該聲明一個目標命名空間,我的XML文檔的根元素,並使用以下格式
<?xml version="1.0" encoding="UTF-8"?>
<root xmlns="http://example.com/namespace"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://example.com/namespace
http://example.com/schema.xsd">
</root>
我的XML
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<PolicyInput xmlns="http://www.tradewisebrokerexchange.com/schemas/2012/10" xsi:schemaLocation="http://www.fresh.co.uk/twschemas/Common.xsd">
但是我收到一個驗證錯誤,指出:
Element '{http:www.tradewisebrokerexchange.com/schemas/2012/10)PolicyInput': No matching global declaration available in the validation root.
我是相當新的XML和我haev驗證對XSD的前卻只有1 XSD地方,因爲好像是2 XSD對這個特定的網絡連接樂。
所有的幫助表示讚賞,因爲我不希望繼續發送我的XML到第三方爲他們告訴我它的錯誤,所以我需要正確驗證它。
謝謝。
你發現了,跟着你現在說的,我知道我在找什麼。如你所說,有一個額外的文件丟失。頂級男士,謝謝。 – Lynchie