File: document_new_from_file.js

package info (click to toggle)
gxml 0.20.4%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,364 kB
  • sloc: xml: 131,277; ansic: 786; javascript: 328; python: 88; makefile: 35; sh: 11
file content (13 lines) | stat: -rwxr-xr-x 374 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/gjs

const GXml = imports.gi.GXml;
const Gio = imports.gi.Gio;

function create_a_document_from_a_file () {
    let file = Gio.File.new_for_path ("bookshelf.xml");
    let can = new Gio.Cancellable ();
    let doc = GXml.GomDocument.from_file (file, can);
    print ("create_a_document_from_a_file:\n" + doc.write_string ());
}

create_a_document_from_a_file ();