lubi lubi - 2 months ago 5x
Dart Question

dart xml with external files

I've been able to follow all the examples of dart-xml but that is only for a dart file containing xml in a variable. How to i parse and create external xml files?

If I try and import an xml file directly dart usually gets stuck on the first character of the xml file '<'.

How would I write the given example from dart-xml I can print it to the shell using


but how to i save || pipe it to an external file? I've tried to use dart:io a little but not having any success at the moment.


This should do what you want:

import 'dart:io';


var file = new File('path/to/file.xml');

See also: