Altova Mailing List Archives>Archive Index >xml-dev Archive Home >Recent entries >Thread Prev - >Thread Next - Re: [xml-dev] Schematron and comma as a decimal delimiter Schematron and comma as a decimal delimiterTo: <xml-dev@-----.---.---> Date: 9/4/2006 11:16:00 AM 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@t... http://www.tieke.fi | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
