利用VC++实现对XML结点的更新和追加
实现功能:根据配置文件(XXXX.ini)中的内容对XML中节点进行操作,如果XML中存在与配置文件中相同的节点,则根据配置文件将XML文件中相应节点的值进行更新;如果XML文件中不存在配置文件中出现的节点,则在XML中将新节点及值进行插入操作。
◆XML文档结构如下
//--------------------------------------------------------------------------------------------
- <printer driver-name="OKI C710(PS)">
<color-profile path="ColorProfiles/OkiC710CMY.icc" />
</printer>
- <printer driver-name="OKI C710(PCL)">
<color-profile path="ColorProfiles/OkiC710CMY.icc" />
</printer>
- <printer driver-name="OKI C830(PS)">
<color-profile path="ColorProfiles/OkiC830CMY_new.icc
" />
</printer>
- <printer driver-name="OKI C830(PCL)">
<color-profile path="ColorProfiles/OkiC830CMY.icc" />
</printer>
//--------------------------------------------------------------------------------------------
◆配置文件结构如下
//----------------------------------------------------------------------------------------------
[Driver]
D1=OKI C830(PCL);OkiC830CMY_new;ColorProfiles/OkiC830CMY_new.icc
D2=OKI C810(PCL);OkiC810CMY_new;ColorProfiles/OkiC810CMY_new.icc
//-----------------------------------------------------------------------------------------------
实现步骤:
1, 读取配置文件,并将其中的信息内容用类对像进行保存
2, 对XML档进行更新.
因为整个过程并不复杂,现将代码附上。
类定义
//CCustomMediaInfoクラスの定義
//機能:GridLayouter機種設定ツールのGLPDFInfo.datファイル情報を初期化処理
//期日:2009.10.29
//作成:
//その他:The CustomMedia.ini file is located at ..\CustomMedia\CustomMediaInfo.ini
#define MAX_UPDATE_PRN 256 //The must number of printers to be updated.
//To save the value of every item of a line in GLPDFInfo.dat or okPrnInfo
相关文档:
http://www.trendcaller.com/2009/05/hadoop-should-target-cllvm-not-java.html
Sunday, May 10, 2009
Hadoop should target C++/LLVM, not Java (because of watts)
< type="text/javascript">
digg_url="http://www.trendcaller.com/2009/05/hadoop-should-target-cllvm-not-java.html";
Over the years, ......
string file = "c:\\work.xml";
private void btnCearte_Click(object sender, EventArgs e)
{
XmlDocument doc = new XmlDocument();
  ......
在Access2007中从Excel导入时,经常会碰到如下的错误提示:“针对该架构进行的规范XML验证失败。以下XML文档行中存在错误:|。”
我的解决方式是用链接表方式来打开Excel文件,然后在复制链接表,粘贴。 ......
XML即extensibe markup language的缩写,也就是可扩展标识语言。由于其开放性,越来越多的软件采用它作为描述语言;由于其平台无关性,越来越多的系统采用它作为数据传递中介。计算机行业已经把XML为数据交换的标准,并提供了相当数量的支持工具。但 ......