Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Schematron and comma as a decimal delimiter

From: Juha Ikävalko <juha.ikavalko@-----.-->
To: <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


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent