root/gaphor/tags/gaphor-0.2.0/utils/validate.py

Revision 147, 308 bytes (checked in by arjanmol, 6 years ago)

Popup menu for tree view works

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 #!/usr/bin/env python
2
3 # Validate an Gaphor XML file using the Gaphor DTD
4
5 import libxml2 as xml
6 import sys
7
8 dtd = xml.parseDTD(None, '../doc/gaphor.dtd')
9
10 doc = xml.parseFile ('../gaphor/a.xml')
11
12 newdtd = doc.newDtd ('gaphor', None, '../doc/gaphor.dtd')
13
14 doc.addChild (newdtd)
15
16 doc.saveFormatFile ('-',  2)
Note: See TracBrowser for help on using the browser.