File: rewrite.py

package info (click to toggle)
pyxb 1.2.3%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 63,792 kB
  • ctags: 48,994
  • sloc: python: 235,928; sh: 803; xml: 657; makefile: 57
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)