1

Possible Duplicate:
How to add an xml-stylesheet processing instruction node with Python 2.6 and minidom?

I meet a issue about using the minidom by python. I need add a line like

<?tag XXXXX?>

However, I find this is not a DOM, it seems that I can't use the DOM to manipulate. Is there anyway to do it?

Community
  • 1
  • 1
Yongwei Xing
  • 12,983
  • 24
  • 70
  • 90

2 Answers2

4

This is an XML processing instruction.

You want the createProcessingInstruction() API method. See

How to add an xml-stylesheet processing instruction node with Python 2.6 and minidom?

for an example.

Community
  • 1
  • 1
0

You're issue is that it is the header. The answer then could be found here or just add the header and footer around the code like so:

return header + 'xmlstring' + footer
Community
  • 1
  • 1
Snakes and Coffee
  • 8,747
  • 4
  • 40
  • 60