Mercurial > bitten > bitten-test
comparison bitten/build/xmltools.py @ 908:56c269e75737 0.6.x
Ported r989 back to 0.6.x branch.
author | cmlenz |
---|---|
date | Wed, 13 Apr 2011 13:25:27 +0000 |
parents | f4d07544722b |
children |
comparison
equal
deleted
inserted
replaced
906:0ab6b21b8010 | 908:56c269e75737 |
---|---|
68 elif have_msxml: | 68 elif have_msxml: |
69 log.debug('Using MSXML for XSLT transformation') | 69 log.debug('Using MSXML for XSLT transformation') |
70 srcdoc = win32com.client.Dispatch('MSXML2.DOMDocument.3.0') | 70 srcdoc = win32com.client.Dispatch('MSXML2.DOMDocument.3.0') |
71 if not srcdoc.load(ctxt.resolve(src)): | 71 if not srcdoc.load(ctxt.resolve(src)): |
72 err = srcdoc.parseError | 72 err = srcdoc.parseError |
73 ctxt.error('Failed to parse XML source %s: %s', src, err.reason) | 73 ctxt.error('Failed to parse XML source %s: %s' % (src, err.reason)) |
74 return | 74 return |
75 styledoc = win32com.client.Dispatch('MSXML2.DOMDocument.3.0') | 75 styledoc = win32com.client.Dispatch('MSXML2.DOMDocument.3.0') |
76 if not styledoc.load(ctxt.resolve(stylesheet)): | 76 if not styledoc.load(ctxt.resolve(stylesheet)): |
77 err = styledoc.parseError | 77 err = styledoc.parseError |
78 ctxt.error('Failed to parse XSLT stylesheet %s: %s', stylesheet, | 78 ctxt.error('Failed to parse XSLT stylesheet %s: %s' % |
79 err.reason) | 79 (stylesheet, err.reason)) |
80 return | 80 return |
81 result = srcdoc.transformNode(styledoc) | 81 result = srcdoc.transformNode(styledoc) |
82 | 82 |
83 # MSXML seems to always write produce the resulting XML document using | 83 # MSXML seems to always write produce the resulting XML document using |
84 # UTF-16 encoding, regardless of the encoding specified in the | 84 # UTF-16 encoding, regardless of the encoding specified in the |