从xml获取数据以将其用作txt文件中的内容? [英] Get data from xml to use it as in puts in a txt file?

查看:86
本文介绍了从xml获取数据以将其用作txt文件中的内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的开发人员,

我有一个应用程序,该应用程序生成一个xml文件,其中包含我从中获得的所有结果.对于每次计算,都有一个新的xml文件.我需要使用此xml文件中的一些输出数据,并将另一个应用程序作为输入数据输入.问题是,我该怎么办?如何指定我的数据并将其作为其他软件中的输入?

注意:我不是这两个应用程序的所有者.所以,我无法控制它们.

预先感谢

Dear developers,

I have an application which produce an xml file containing all the results I have got from it. For each calculation there is a new xml file. I need to use some of the output data from this xml file and feed another application as an input data. The question is, how can I do this? How can I specify my data & guide it to be my input in the other software?

Note: I am not the owner of the both applications. So, I can''t control them.

thanks in advance

推荐答案

假设您正在编写这两个软件,只需使用DOM读取新软件中的XML并提取数据即可.如果您不知道如何使用XML,为什么还要使用XML? XmlDocument是用于读取XML的类,而XPath是您馈入SelectNodes以返回数据的类.

由于您不拥有这些应用程序,因此很麻烦.您可以按照我描述的方式获取XML并对其进行解析,但是没有将数据放入另一个应用程序的巧妙方法.您可以花一些时间来设计窗口句柄,并编写程序的基本技巧,尝试通过这些句柄来控制它并发送Windows消息,但我不建议这样做.
Assuming that you''re writing both pieces of software, just use the DOM to read the XML in the new software and pull out the data. Why did you use XML, if you don''t know how to work with it ? XmlDocument is the class you''d use to read your XML, and XPath is what you feed into SelectNodes to return your data.

As you don''t own the applications, you are screwed. You can take the XML and parse it in the manner I described, but there''s no neat way to get the data into the other app. You can spend some time working out window handles, and write a basic hack of a program that tries to control it through those handles and sending windows messages, but I would not recommend it.


这篇关于从xml获取数据以将其用作txt文件中的内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆