[augeas-devel] Square lens update

Francis Giraldeau Francis.Giraldeau at USherbrooke.ca
Sun Jul 18 20:21:16 UTC 2010


Le vendredi 16 juillet 2010 à 13:51 -0400, Francis Giraldeau a écrit :
> Hi,
>
> The square lens is now working for recursive lens. This way, XML
> documents can be processed.
>
> The patch is on square2 branch on github:
>
> http://github.com/giraldeau/augeas/tree/square2
>
> There is one gotcha. With nonrecursive lens, then mismatch tags are
> detected. But, with recursive lens, since the parser doesn't know what
> the close tag should be, it can accept invalid documents. In the put
> direction, the modified document will be "fixed" in some ways, because
> the close tag will be copied from the open tag (the key). This is an
> example of the behavior. The "a" element is never closed, it is
> accepted, and in the put direction, the tag is closed appropriately.
>
> test xml_rec put "<a><b></b></c>" after clear "/x" =
> "<a><b></b></a><x></x>"
>
> We may have to analyze the resulting parse tree to validate square
> elements.


Ok, it works now, the square lens catch mismatch tags as syntax error,
both for recursive lenses and regular lenses.

Cheer,

Francis




More information about the augeas-devel mailing list