0

I am using Oxygen to validate my XML against a Schematron. For some reason (and I do not see where my mistake is) the XML is not getting validated / Oxygen throws an error. Why?

Here is my XML text:

<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>

And my Schematron I have written looks like this:

<?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>

It's a very basic Schematron, yet it throws an error. Why?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Maciej Cygan
  • 5,351
  • 5
  • 38
  • 72
  • 2
    Well, your EnvelopeTrackingID is 1746978, but you test for 174697888. Anyway, if you have an error, show us that error too. – nos Jan 09 '14 at 10:32
  • @nos fail on me... Yeah true haven't noticed that, this solved the problem ^^ – Maciej Cygan Jan 09 '14 at 10:34

1 Answers1

0

As nos suggested in comment, it was my mistake as i have done typo in assert element therefore it didn't get validated. Removing unnecessary digits from assert solved the problem.

Maciej Cygan
  • 5,351
  • 5
  • 38
  • 72