hello,
i'm facing this strange error :
xexpr->xml: contract violation;
Not an Xexpr. Expected a string, symbol, valid numeric entity, comment, processing instruction, or list, given 2.2384341637010676
Context:
'(DATA
(TABLEDATA
(TR
(TD "2021-01-01T00:00:00.000")
(TD "-5.226162")
(TD "-0.133805")
(TD "1.462782")
(TD 2.2384341637010676)
(TD 0.7829181494661922)
(TD 4.069395017793594))
(TR
(TD "2021-01-01T00:01:00.000")
(TD "-5.239695")
(TD "-0.133871")
(TD "1.446325")
(TD 2.0249110320284696)
(TD 0.9128113879003559)
(TD 3.9733096085409256))
....
(TR
(TD "2021-01-01T23:58:00.000")
(TD "-0.222710")
(TD "0.016590")
(TD "-2.168841")
(TD 15.09608540925267)
(TD -1.2188612099644127)
(TD 15.701067615658364))
(TR
(TD "2021-01-01T23:59:00.000")
(TD "-0.170992")
(TD "0.015211")
(TD "-2.140229")
(TD 15.45373665480427)
(TD -1.3558718861209964)
(TD 16.144128113879002))))
in: the 1st argument of
(->
xexpr/c
(or/c
pcdata?
element?
entity?
comment?
cdata?
p-i?
permissive/c))
contract from:
<collects>/xml/private/xexpr.rkt
blaming: /opt/homebrew/var/www/drive/interpole_fields
(assuming the contract is correct)
at: <collects>/xml/private/xexpr.rkt:102:2
context...:
/Applications/Racket/collects/racket/contract/private/blame.rkt:350:0: raise-blame-error
/Applications/Racket/collects/racket/private/more-scheme.rkt:163:2: select-handler/no-breaks
/Applications/Racket/collects/racket/contract/combinator.rkt:298:9
/Applications/Racket/collects/racket/contract/private/arrow-val-first.rkt:486:18
/opt/homebrew/var/www/drive/interpole_fields:249:2
body of "/opt/homebrew/var/www/drive/interpole_fields"
....
it seems my 'numeric entity' 2.2384341637010676 is refused by xexpr->xml :
Welcome to DrRacket, version 8.14 [cs].
Language: racket, with debugging; memory limit: 8192 MB.
(require xml
(except-in 2htdp/batch-io xexpr?))
> xexpr->xml
#<procedure:xexpr->xml>
> (xexpr->xml '(TD "2.2384341637010676"))
(element 'racket 'racket 'TD '() (list (pcdata 'racket 'racket "2.2384341637010676")))
i do not understand why? seems a bug but probably i do not understand something...