& in file parsed by CXML
When I parse a file containing "&"s, CXML:parse-file gives the error message
"Error: Document not well-formed: entity not defined: amp". Maybe I need to
provide more information to the parser about how to handle the XML special
characters but I am not sure where to do that.
Here is an example:
REPL> (with-open-file (s "example.xml" :direction :output)
(write-string "<test a='b&'><child/></test>" s))
--> "<test a='b&'><child/></test>"
REPL> (cxml:parse-file "example.xml" (cxml-xmls:make-xmls-builder))
--> Error: Document not well-formed: entity not defined: amp
Context:
Line 1, column 16 in file://+
Without the & it works fine and produces:
--> ("test" (("a" "b")) ("child" NIL))
Thanks for any help.
Mitch