Hi, I resolved this myself. It seems there is no mechanism for CodeDomReader to handle processing instructions. I fixed the issue by:
- Creating a new ProcessingInstructionElement to store the data from the xml PI. - Copy & paste source from CodeDomReader and hacking ParseObjectFromElement so that it now reads processing instructions and build's my custom element - Adding a new ElementCollection for storing ProcessingInstructionElement - Adding the new collection to any node which contains a processing instruction The application can now open, edit and save wix via the object model. What a pain in the ass... Cheers, Matt ----- Original Message ----- From: "Matt Lynch" <m...@bonafidesoftware.com> To: "Wix Users" <wix-users@lists.sourceforge.net> Sent: Thursday, February 11, 2010 5:19 PM Subject: [WiX-users] Programmatically edit .wxs files through CodeDomReader > Hi, > > I'm writing a tool which makes some changes to a wix file based on a set > of rules. The basic process is: > 1.. Deserialize > 2.. Make changes > 3.. Serialize > I'm using the CodeDomReader class to read the xml into a object model, but > I am unable to keep any processing instructions in tact, such as <? > include ?>. It seems that CodeDomReader doesn't interpret these guys. > I'm trying to avoid editing the files as plain xml. > > Any hints, advice, comments are welcome. > > Cheers, > > > Matt > ------------------------------------------------------------------------------ > SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, > Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW > http://p.sf.net/sfu/solaris-dev2dev > _______________________________________________ > WiX-users mailing list > WiX-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wix-users > ------------------------------------------------------------------------------ SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users