2014-01-09 52 views
0

我正在使用Oxygen來驗證我的XML與Schematron。出於某種原因(我沒有看到我的錯誤在哪裏),XML沒有得到驗證/ Oxygen引發錯誤。爲什麼?Schematron無法驗證XML?

這裏是我的XML文本:

<Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://mappings.f4f.com/F4FXML/Schemas/v5/financial.xsd"> 
    <EnvelopeHeader> 
     <SchemaVersion>5.1</SchemaVersion> 
     <EnvelopeCreated>20140108</EnvelopeCreated> 
     <EnvelopeTrackingID>1746978</EnvelopeTrackingID> 
     <EnvelopeRevisionNumber>1</EnvelopeRevisionNumber> 
     <SourcePartnerID>UK0000001088</SourcePartnerID> 
     <SourceDivisionID>UK0000001088</SourceDivisionID> 
     <DestinationPartnerID>ang</DestinationPartnerID> 
     <DestinationDivisionID>9725652</DestinationDivisionID> 
     <TestIndicator>True</TestIndicator> 
    </EnvelopeHeader> 
</Envelope> 

而且我Schematron我寫這個樣子的:

<?xml version="1.0"?> 
<sch:schema xmlns:sch="http://www.ascc.net/xml/schematron"> 
    <sch:pattern name="ValidateDocument"> 
     <sch:rule context="Envelope/EnvelopeHeader"> 
      <sch:assert test="EnvelopeTrackingID = 174697888"></sch:assert> 
     </sch:rule> 
    </sch:pattern>  
</sch:schema> 

這是一個非常基本的Schematron,但它拋出一個錯誤。爲什麼?

+2

恩,你的EnvelopeTrackingID是1746978,但是你測試的是174697888.無論如何,如果你有錯誤,也請告訴我們那個錯誤。 – nos

+0

@nos在我身上失敗...是的真的沒有注意到,這解決了問題^^ –

回答

0

由於在評論中提到了nos,這是我的錯誤,因爲我在斷言元素中做了拼寫錯誤,所以它沒有得到驗證。從斷言中刪除不必要的數字解決了這個問題。