如何获取xml元素的值并写入它 [英] How to get values of xml element and write it
本文介绍了如何获取xml元素的值并写入它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
亲爱的朋友,
i希望从xml文件中读取xml元素。如果
< page-ref>
元素值连续意味着我需要按照下面的输出来编写它。任何人都可以有想法吗?因为我是vb的新手。
INPUT
< ref-group>
< page-ref> 14728-14731
< / ref-group >
输出
< ref-group >
< page-ref > 14728
< / page -ref > 14729
< / page-ref > 14730
-
< page-ref > 14731
< / ref-g roup >
解决方案
Hi
您可以使用MSXML来获取此链接可以获得的更多信息:
http://msdn.microsoft.com/en-us/library/ms763742%28v=VS.85%29.aspx [< a href =http://msdn.microsoft.com/en-us/library/ms763742%28v=VS.85%29.aspxtarget =_ blanktitle =New Window> ^ ]
请查看这些链接以获取更多信息和样本:
http://stackoverflow.com/questions/3870485/reading-xml-files-in-vb6 [< a href =http://stackoverflow.com/questions/3870485/reading-xml-files-in-vb6target =_ blanktitle =新窗口> ^ ]
http://www.xml.com/pub/a/2000/ 7月12日/ vbasic / v的b_and_xml.html [ ^ ]
http://www.vbrad.com/article .aspx?id = 76 [ ^ ]
http://forums.codeguru。 com / showthread.php?495218-work-with-xml-in-vb6 [ ^ ]
最好的问候。
Dear Friends,
i want to read the xml element from xml file.in the below example if the
<page-ref>
element value continuous means i need to write it as per the below output.
can anybody have idea? because i am a newbie to vb.
INPUT
<ref-group>
<page-ref>14728-14731
</ref-group>
OUTPUT
<ref-group>
<page-ref>14728
</page-ref>14729
</page-ref>14730
-
<page-ref>14731
</ref-group>
解决方案
Hi
You can do it with MSXML for getting more information you can follow of this link :
http://msdn.microsoft.com/en-us/library/ms763742%28v=VS.85%29.aspx[^]
and please see these links for more information and samples about it:
http://stackoverflow.com/questions/3870485/reading-xml-files-in-vb6[^]
http://www.xml.com/pub/a/2000/07/12/vbasic/vb_and_xml.html[^]
http://www.vbrad.com/article.aspx?id=76[^]
http://forums.codeguru.com/showthread.php?495218-work-with-xml-in-vb6[^]
Best Regards.
这篇关于如何获取xml元素的值并写入它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文