File: rewrite.py

package info (click to toggle)
pyxb 1.2.6%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 42,668 kB
  • sloc: python: 239,437; sh: 905; xml: 690; makefile: 60
file content (12 lines) | stat: -rw-r--r-- 359 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
# -*- coding: utf-8 -*-
import pyxb.bundles.common.xhtml1 as xhtml
import pyxb.utils.domutils
import xml.dom.minidom
from xml.dom import Node

pyxb.utils.domutils.BindingDOMSupport.SetDefaultNamespace(xhtml.Namespace)

ind = open('in.xhtml', 'rb').read()
i1 = xhtml.CreateFromDocument(ind)
xmld = i1.toDOM().toxml('utf-8')
open('out.xhtml', 'wb').write(xmld)