On Jun 21, 2016, at 12:43 AM, Christian GrĂ¼n wrote:
Yes. What puzzles me is that calling db:replace with a fourth argument of map { "chop" : false() } appears not to have any effect in the database in question.
This is probably because the input you are specifying are nodes, for which whitespaces have already been chopped in a previous step I tried to explain this better now in our documentation [1].
[Headslap] D'oh! Thank you very much.
I have created two simple examples to try to teach myself what is going on here. Is the characterization correct?
db:add("DB", "http://example.com/doc.xml", "doc.xml", map { "chop" false() }) -- parses the file at the URI http://example.com/doc.xml with the CHOP option turned off (so whitespace is preserved), and adds it to database DB.
db:add("DB", doc("http://example.com/doc.xml"), "doc.xml", map { "chop" false() }) -- parses the file at the URI http://example.com/doc.xml with the default parser settings and adds it to database DB. Note that the CHOP setting in the fourth argument has no effect, since the document is parsed by the doc() function, not the db:add function.
If you think it helpful, feel free to add these to the documentation for db:add() or db:replace; it might help even readers like me to understand what is going on.
best,
Michael