sxml icon indicating copy to clipboard operation
sxml copied to clipboard

XML tags not validated according to usual rules for NCName

Open t0mpr1c3 opened this issue 2 years ago • 3 comments

Symbol to string conversion in srl:sxml->xml does not escape XML characters. Nor does string parsing in ssax:xml->sxml recognise escaped characters.

(require sxml) 
(srl:sxml->xml '(number->string "2")) ;; '>' not escaped...
(ssax:xml->sxml (open-input-string (srl:sxml->xml '(number->string "2"))) null) ;; ... so this fails
(ssax:xml->sxml (open-input-string "<number-&gt;string>2</number-&gt;string>") null) ;; but this also fails

t0mpr1c3 avatar Mar 03 '23 02:03 t0mpr1c3

Interesting. Yes, it seems to me that sxml->xml should do validation of the NCName production given in https://www.w3.org/TR/REC-xml/#NT-Name . It seems like the kind of thing that Oleg would have gotten right, though, so I think I should do some digging before agreeing that this is a bug.

jbclements avatar Mar 03 '23 04:03 jbclements

It seems like the kind of thing that Oleg would have gotten right

Yes

t0mpr1c3 avatar Mar 03 '23 10:03 t0mpr1c3

Should this at least be documented?

t0mpr1c3 avatar Oct 27 '23 20:10 t0mpr1c3