diff --git a/source/std/experimental/xml/package.d b/source/std/experimental/xml/package.d index db6a5a0..2cd6936 100644 --- a/source/std/experimental/xml/package.d +++ b/source/std/experimental/xml/package.d @@ -56,9 +56,14 @@ + + // write it out to "catalogue.xml" + auto file = File("catalogue.xml", "w"); -+ file.lockingTextWriter -+ .writerFor!string // instatiates an xml writer on top of an output range -+ .writeDOM(dom); // write the document with all of its children ++ ++ auto textWriter = file.lockingTextWriter; // instatiates an xml writer on top of an output range ++ textWriter.writerFor!string.writeDOM(dom); // write the document with all of its children ++ ++ // bug: ++ // file.lockingTextWriter ++ // .writerFor!string // instatiates an xml writer on top of an output range ++ // .writeDOM(dom); // write the document with all of its children + ----- + + Also available is a SAX parser, which we will use to find all text nodes containing diff --git a/source/std/experimental/xml/writer.d b/source/std/experimental/xml/writer.d index 8d4455e..bf49451 100644 --- a/source/std/experimental/xml/writer.d +++ b/source/std/experimental/xml/writer.d @@ -577,7 +577,7 @@ void writeDOM(WriterType, NodeType)(auto ref WriterType writer, NodeType node) foreach (attr; elem.attributes) writer.writeAttribute(attr.nodeName, attr.value); foreach (child; elem.childNodes) - writer.writeDOM(elem); + writer.writeDOM(child); writer.closeElement(elem.tagName); break; case text: