chris-twiner / scalesXml

Alternate Scala XML library
77 stars 16 forks source link

Replace should be allowed for root elems in foldPositions #23

Closed chris-twiner closed 11 years ago

chris-twiner commented 11 years ago

<?xml version="1.0" encoding="UTF-8"?>

The value of attribute "id" should be modified from "moduleCoreId" to "123".

val folded= foldPositions( one(root) ){ p => { Replace(p.tree /@("id" ->"123")) } }

should yield a changed tree not an AddedBeforeOrAfterRoot fold error.

Historical code that only mattered in forward iterating folds, in reverse not only doesn't it matter but its counter-intuitive.