Skip to content

Latest commit

 

History

History
43 lines (39 loc) · 1.3 KB

XMLIsValid.code.md

File metadata and controls

43 lines (39 loc) · 1.3 KB

XMLIsValid.groovy

Source code

The source code may use or refer to content in a local workspace. This Bioclipse workspace used can be found on GitHub.

Bioclipse 2.6

ui.newProject("/Google/");
bioclipse.downloadAsFile(
  "https://raw.githubusercontent.com/egonw/bioclipse.ons/master/solubility.rdf",
  "/Google/solubility.rdf"
);
valid = xml.isValid("/Google/solubility.rdf")
println "Valid? " + valid

Bacting

To run this code, you first need to install Bacting (Groovy) or pyBacting (Python).

@Grab(group='io.github.egonw.bacting', module='managers-xml', version='0.1.2')
@Grab(group='io.github.egonw.bacting', module='managers-ui', version='0.1.2')

workspaceRoot = "../ws"

bioclipse = new net.bioclipse.managers.BioclipseManager(workspaceRoot);
ui = new net.bioclipse.managers.UIManager(workspaceRoot);
xml = new net.bioclipse.managers.XMLManager(workspaceRoot);

ui.newProject("/Google/");
bioclipse.downloadAsFile(
  "https://raw.githubusercontent.com/egonw/bioclipse.ons/master/solubility.rdf",
  "/Google/solubility.rdf"
);
valid = xml.isValid("/Google/solubility.rdf")
println "Valid? " + valid

Output

Valid? false