#! /usr/bin/env python
import sys
from xml.dom.minidom import *


def parse(filename):
  doc=xml.dom.minidom.parse(filename)
  return doc

def modify(doc,el,attr):
  return doc



def write(doc,filename):
  fh=open(filename,"w")
  if fh is None:
    raise Exception("unable to write to %s"%filename)
  doc.writexml(fh)
  fh.close()


if __name__ == '__main__':

  sys.argv.pop(0)
  fin=sys.argv.pop(0)
  fout=sys.argv.pop(0)

  doc=parse(fin)

  sw1=doc.documentElement.getElementsByTagName("AVNSocketWriter")[0]
  sw1.setAttribute("maxDevices","10")
  write(doc,fout)

