2014-01-09 48 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,这是我的错误,因为我在断言元素中做了拼写错误,所以它没有得到验证。从断言中删除不必要的数字解决了这个问题。