← Prev in month ← Prev in thread

Schematron and comma as a decimal delimiter

From
Juha Ikävalko <>
To
Date
2006-09-04T11:19:27Z
ID
<>
Thread
Schematron and comma as a decimal delimiter
Hi Developers,

I have a b2b XML - message for which I need a schematron validation to check that a total amount of row amounts has been calculated correctly. Generally the rule would be described like this: 

<rule context="Invoice">
 <assert test="TotalAmount = sum(InvoiceRow/RowAmount)">
  TotalAmount doesn't match the sum of RowAmounts.
 </assert>
</rule>
 
<Invoice>
  <TotalAmount>100,00</TotalAmount>
  <InvoiceRow>  
    <RowAmount>30,00</RowAmount>
  </InvoiceRow>
  <InvoiceRow>  
    <RowAmount>70,00</RowAmount>
  </InvoiceRow>
</Invoice>

The problem is that a comma has been used as a decimal delimiter and sum() function seems to work only with dots. I tested translate() function but it seems to work only with a single node, not with a node-set. Is there any workaround available for my problem?

Thanks,

Juha Ikävalko
TIEKE Tietoyhteiskunnan kehittämiskeskus ry 
TIEKE Finnish Information Society Development Centre 
Salomonkatu 17 A, 10th floor FI-00100 Helsinki 
Tel +358 9 4763 0410 Fax +358 9 4763 0399 
 http://www.tieke.fi
← Prev in month ← Prev in thread