[augeas-devel] XML lens parse_error with XML document using single quotes

Alan Evans alanwevans at gmail.com
Tue Nov 8 02:53:58 UTC 2011


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.

<?xml version="1.0"?>

In a further test it looks like any use of single quotes in attribute
values doesn't work with  xml.aug all together.

the following works:
<?xml version="1.0"?>
<foos>
<foo name="bar">
<baz name="blarg">bam</baz>
</foo>
</foos>

the following fails to parse:
<?xml version='1.0'?>
<foos>
<foo name='bar'>
<baz name='blarg'>bam</baz>
</foo>
</foos>

>From the XML spec, both single and double quotes are valid in
attributes and for that matter in the prolog.

http://www.w3.org/TR/REC-xml/
http://www.w3schools.com/xml/xml_attributes.asp (for those who do not
want to read EBNF i.e. me)

I was going to try to submit a patch, but I just don't have a good
handle on writing lenses.

I'm using 0.8.1 on RHEL 5 though the xml.aug file from my RHEL 5 and
Fedora 15 boxes seem to be the same.

Regards,
-Alan




More information about the augeas-devel mailing list