Skip to content

Assert failed depending on Decimal part #31

Description

@flavienaudin

Hi,

I have a really weird behavior that I can explain. With this Schematron (issued form a more complexe one) :

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
    <pattern>
        <rule context="//CrossIndustryInvoice">
            <assert id="BR-CO-16-a" flag="fatal" test="(xs:decimal( DuePayableAmount) = xs:decimal( GrandTotalAmount) - xs:decimal( TotalPrepaidAmount))">
                DuePayableAmount = GrandTotalAmount - TotalPrepaidAmount
            </assert>
        </rule>
    </pattern>
</schema>

This XML failed :

<?xml version="1.0" encoding="UTF-8"?>
<CrossIndustryInvoice>
    <GrandTotalAmount>2138.28</GrandTotalAmount>
    <TotalPrepaidAmount>100.00</TotalPrepaidAmount>
    <DuePayableAmount>2038.28</DuePayableAmount>
</CrossIndustryInvoice>

instead this one is OK :

<?xml version="1.0" encoding="UTF-8"?>
<CrossIndustryInvoice>
    <GrandTotalAmount>2138.29</GrandTotalAmount>
    <TotalPrepaidAmount>100.00</TotalPrepaidAmount>
    <DuePayableAmount>2038.29</DuePayableAmount>
</CrossIndustryInvoice>

Only the decimal part changes.

Is that possible for you to investigate ?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions