Solve problems with BR-DE-18
The unit tests have found some problems with BR-DE-18.
Freespace errors
CI
cii-br-de-18-freespace-test.xml
UBL
ubl-inv-br-de-18-freespace-test.xml
Basisbetrag
CII
cii-br-de-18-negative-test.xml
UBL
ubl-inv-br-de-18-negative-test-2.xml
Solution
- corrected mutate prefixes
- found the real mistakes
- figured that the current XPATh can not do it
- here is the new XPATH
for this doc
<?xml version="1.0" encoding="UTF-8"?>
<root>
<a>#SKONTO#TAGE=7#PROZENT=2.00#
#SKONTO#TAGE=14#PROZENT=1.00#BASISBETRAG=23.55#
#SKONTO#TAGE=30#PROZENT=0.00#</a>
<b>testentry
#SKONTO#TAGE=7#PROZENT=2.00#
testentry
#VERZUG#TAGE=14#PROZENT=100#
#SKONTO#TAGE=30#PROZENT=0.00#
testentry
</b>
<b>#SKONTO#TAGE=1#PROZENT=2.00#
testentry
#VERZUG#TAGE=2#PROZENT=1.00#
#SKONTO#TAGE=3#PROZENT=0.00#BASISBETRAG=2.39#
</b>
</root>
this works
'sichtbar:',
for $skonto in tokenize(/root/b[2] , '(\r?\n)')[starts-with( normalize-space(.) , '#')] return normalize-space ($skonto),
string-join('und jetzt blind'),
every $line
in /root/tokenize(b[2] , '(\r?\n)')[starts-with( normalize-space(.) , '#')]
satisfies matches(
normalize-space ($line),
'#(SKONTO|VERZUG)#TAGE=([0-9]+#PROZENT=[0-9]+\.[0-9]{2})(#BASISBETRAG=-?[0-9]+\.[0-9]{2})?#$'
)
the ever #line is the meat before ist just for debugging
Edited by Renzo Kottmann