有高人能指点下吗?关于xml文件合并的
时间:2010-02-01
来源:互联网
有一个主的xml文件,名为root.xml,同时还有多个子xml文件。其中root.xml文件中的有一属性SubFileName,其属性值为那些子xml文件的文件名,
我想要做的就是用xmlreader来读root.xml文件,并用xmlwriter来将读取的节点存在任意的位置,当用xmlreader读到SubFileName属性时,将其对应的子xml文件也写入要保存的文件中。
例如root.xml文件中有这么一节点
<矢量数据信息 IsRoot="False" NodeID="1" DataType="None" NodeCaption="" NodeDescription="对矢量数据内容的说明" MaxOccurs="1" MinOccurs="1" Order="0" NodeCode="F" ImageKey="FeatureCls.png" SelectedImageKey="FeatureCls_1.png" IsCut="false">
<数据信息 IsRoot="False" NodeID="2" DataType="None" NodeCaption="矢量数据信息" NodeDescription="" MaxOccurs="unbounded" MinOccurs="1" Order="0" NodeCode="F2172101014P" ImageKey="FeatureCls.png" SelectedImageKey="FeatureCls_1.png" Text="GLOSS月平均潮位站位数据" SubFileName="633999538997187500.xml" />
<数据信息 IsRoot="False" NodeID="2" DataType="None" NodeCaption="矢量数据信息" NodeDescription="" MaxOccurs="unbounded" MinOccurs="1" Order="0" NodeCode="F1510101000P" ImageKey="FeatureCls.png" SelectedImageKey="FeatureCls_1.png" Text="领海基点" SubFileName="633999538997656250.xml" />
<数据信息 IsRoot="False" NodeID="2" DataType="None" NodeCaption="矢量数据信息" NodeDescription="" MaxOccurs="unbounded" MinOccurs="1" Order="0" NodeCode="F1510103017L" ImageKey="FeatureCls.png" SelectedImageKey="FeatureCls_1.png" Text="渔业线" SubFileName="633999538998437500.xml" />
</矢量数据信息>
其对应的633999538997187500.xml,633999538997656250.xml,633999538998437500.xml的子文件中也是有内容的,也就是将其链接起来。
望高人指点
我想要做的就是用xmlreader来读root.xml文件,并用xmlwriter来将读取的节点存在任意的位置,当用xmlreader读到SubFileName属性时,将其对应的子xml文件也写入要保存的文件中。
例如root.xml文件中有这么一节点
<矢量数据信息 IsRoot="False" NodeID="1" DataType="None" NodeCaption="" NodeDescription="对矢量数据内容的说明" MaxOccurs="1" MinOccurs="1" Order="0" NodeCode="F" ImageKey="FeatureCls.png" SelectedImageKey="FeatureCls_1.png" IsCut="false">
<数据信息 IsRoot="False" NodeID="2" DataType="None" NodeCaption="矢量数据信息" NodeDescription="" MaxOccurs="unbounded" MinOccurs="1" Order="0" NodeCode="F2172101014P" ImageKey="FeatureCls.png" SelectedImageKey="FeatureCls_1.png" Text="GLOSS月平均潮位站位数据" SubFileName="633999538997187500.xml" />
<数据信息 IsRoot="False" NodeID="2" DataType="None" NodeCaption="矢量数据信息" NodeDescription="" MaxOccurs="unbounded" MinOccurs="1" Order="0" NodeCode="F1510101000P" ImageKey="FeatureCls.png" SelectedImageKey="FeatureCls_1.png" Text="领海基点" SubFileName="633999538997656250.xml" />
<数据信息 IsRoot="False" NodeID="2" DataType="None" NodeCaption="矢量数据信息" NodeDescription="" MaxOccurs="unbounded" MinOccurs="1" Order="0" NodeCode="F1510103017L" ImageKey="FeatureCls.png" SelectedImageKey="FeatureCls_1.png" Text="渔业线" SubFileName="633999538998437500.xml" />
</矢量数据信息>
其对应的633999538997187500.xml,633999538997656250.xml,633999538998437500.xml的子文件中也是有内容的,也就是将其链接起来。
望高人指点
作者: xishuai1195 发布时间: 2010-02-01
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28