开发者

Migration from MSXML to Xerces

开发者 https://www.devze.com 2022-12-16 13:31 出处:网络
I am planning to port my application from Windows to Linux, curren开发者_运维技巧tly my application uses MSXML for XML parsing. I have decided to use Xerces XML parser to provide a cross platform solu

I am planning to port my application from Windows to Linux, curren开发者_运维技巧tly my application uses MSXML for XML parsing. I have decided to use Xerces XML parser to provide a cross platform solution. My code size is too big and I do not want to touch all the internal part of the code for this porting purpose as it might break some of the functionality. Can anybody suggest me the best way to do this.


depends on what you mean with 'the internal part'; one pretty extensible way to do this would go in some steps (having tests for your application would be beneficial so you can spot when something goes wrong):

  • create an interface for all XML operations you use
  • provide an implementation of that interface that uses MSXML
  • make all your code talk to the interface instead of directly to MSXML. If you designed the interface well, this could be a matter of just a thorough find/replace, but more work might be needed
  • now everything should still be working, but with the benefit that it's seperated from the actual xml logic
  • provide another implementation for the interface, now using Xercesc
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号