我正在使用 oxygen 将我的XML验证到A 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>
.

这是一个非常基本的练习序,但它抛出了一个错误。为什么?

有帮助吗?

解决方案

在评论中建议的nos,这是我的错误,因为我在断言元素中完成了拼写,因此它没有得到验证。从断言中删除不必要的数字解决了问题。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top