dlang-community / experimental.xml

A replacement of Phobos std.xml
https://rawgit.com/dlang-community/experimental.xml/gh-pages/index.html
Boost Software License 1.0
11 stars 8 forks source link

Writer concept is not flexible enough #13

Open wilzbach opened 6 years ago

wilzbach commented 6 years ago

From @Ingrater on November 2, 2016 15:44

I have a xml document that looks like this

<?xml version="1.0" encoding="UTF-8"?>
<root>
  <source>
    <Item>Text1</Item>
    <Item>Text2</Item>
  <source>
<root>

The current writer concept does not allow formatting the document in this style. "afterNode" will be called always, even after text nodes. There is no context given to "afterNode" so its impossible to decide whether or not to place a newline. The same goes for the indentation. The writer concept should be extended to allow for this style of formatting (as its very common)

Copied from original issue: lodo1995/experimental.xml#37

wilzbach commented 6 years ago

From @lodo1995 on November 2, 2016 17:10

You are right. The hooks are not complete. I need to find the best balance between having the maximum customization and keeping the number of hooks reasonable.