[augeas-devel] XML lens parse_error with XML document using single quotes
Francis Giraldeau
francis.giraldeau at gmail.com
Tue Nov 8 05:40:20 UTC 2011
Le lundi 07 novembre 2011 à 21:53 -0500, Alan Evans a écrit :
> I noticed the problem when parsing a document with a prolog like the
> following augeas gives a parse_error.
>
> <?xml version='1.0'?>
>
> If I manually replace the single quotes with double quotes augeas
> likes the document just fine.
You're right. This is a limitation of the current lens. Here is the
comment from the lens:
(* if we hide the quotes, then we can only accept single or double
quotes otherwise a put ambiguity is raised *)
The put ambiguity is raised because for the same tree, two lenses match.
One way to overcome this would be to accept malformed files, where a
quote may not be balanced i.e. att="var'.
let example = [ key /[a-z]+/ . dels "=" . del /["']/ "\"" .
store /[a-z]*/ . del /["']/ "\"" ]
Maybe a lens like the square lens, but that acts as a del with
characters at extremity? Or quotient lens?
Francis
More information about the augeas-devel
mailing list