[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
Schematron and comma as a decimal delimiter
- From: Juha Ikävalko <juha.ikavalko@tieke.fi>
- To: <xml-dev@lists.xml.org>
- Date: Mon, 4 Sep 2006 14:19:27 +0300
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
juha.ikavalko@tieke.fi http://www.tieke.fi
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]