Changeset 3671
- Timestamp:
- 06/23/08 20:47:18 (3 months ago)
- Files:
-
- trunk/tango/text/xml/DocPrinter.d (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/tango/text/xml/DocPrinter.d
r3608 r3671 62 62 // check for cached output 63 63 if (node.end) 64 emit (node.start[0 .. node.end - node.start]); 64 { 65 auto p = node.start; 66 auto l = node.end - p; 67 // nasty hack to retain whitespace while 68 // dodging prior EndElement instances 69 if (*p is '>') 70 ++p, --l; 71 emit (p[0 .. l]); 72 } 65 73 else 66 74 switch (node.type) … … 133 141 } 134 142 } 143 144 145 debug (DocPrinter) 146 { 147 import tango.io.Stdout; 148 import tango.text.xml.Document; 149 150 void main() 151 { 152 char[] document = "<blah><xml>foo</xml></blah>"; 153 154 auto doc = new Document!(char); 155 doc.parse (document); 156 157 void test (char[][] s...){foreach (t; s) Stdout(t).flush;} 158 159 auto print = new DocPrinter!(char); 160 print(doc.root.firstChild.firstChild, &test); 161 } 162 }












