寻找想法:将文档转换为XML命令 [英] Looking for Ideas: Translating Document into Commands in XML

查看:55
本文介绍了寻找想法:将文档转换为XML命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好


这里有一点曲线球...我有一个文件(Word),其中包含一系列

的说明和章节小节(和小节)。还有

350页。


我需要将这些说明翻译成可以自动处理的内容

,所以我使用Command模式设置了一组

命令,这些命令对应于文档中的各种指令。


我已经开始输入说明进入一个xml文件,我可以将b $ b反序列化到我的命令层次结构中。但是,将350页转录成

xml文档是繁琐,耗时且容易出错的。因为我有

部分和子部分,所以我的xml文件很宽,而且很长。我用
使用XMLSpy来编辑文件,但是我永远向后滚动并且向上和向下滚动,上下,切割和粘贴,以及失去我的位置。


有没有人对我如何改善这种情况有任何想法,让我的

文件更易于维护,并且可能以某种方式自动化这个过程?


我的第一个想法是编写一个简单的程序来维护xml文件,但

可能需要的时间与输入数据一样长。


任何想法都非常欢迎。


TIA


Charles

Hi guys

A bit of curve ball here ... I have a document (Word) that contains a series
of instructions in sections and subsections (and sub-subsections). There are
350 pages of them.

I need to translate these instructions into something that can be processed
automatically, so I have used the Command pattern to set up a set of
commands that correspond to the various instructions in the document.

I have started to enter the instructions into an xml file, which I can
deserialise into my command hierarchy. However, transcribing 350 pages into
an xml document is tedious, time-consuming and error prone. Because I have
sections and subsections, my xml file is quite wide, as well as very long. I
use XMLSpy to edit the file, but I am forever scrolling backwards and
forwards, up and down, cutting and pasting, and losing my place.

Does anyone have any thoughts on how I might improve the situation, make my
file more maintainable, and perhaps automate the process somehow?

My first thought is to write a simple program to maintain the xml file, but
that could take just as long as entering the data.

Any thoughts very welcome.

TIA

Charles

推荐答案

Charles,


几周前这个新闻组也提供了这个新闻组


\\\ Eval by Nigel Amstrong

1.创建一个名为:DynamicMath.js的文件

2.将此代码添加到其中:


class DynamicMath

{

静态函数Eval(MathExpression:String):double

{

ret urn eval(MathExpression);


};

}


3.使用命令行jsc编译它编译器:jsc / t:库

DynamicMath.js

4.在项目中添加对DynamicMath.dll的引用(以及

Microsoft .JScript.dll也是如此)

5.使用你喜欢的.NET语言:

Dim d As Double = DynamicMath.Eval(" 2 + 3 + 4" )

MessageBox.Show(d)

6.就是这样..

///

Cor
Charles,

This is suplied too this newsgroup some weeks ago

\\\Eval by Nigel Amstrong
1. Create a file called: DynamicMath.js
2. Add this code to it:

class DynamicMath
{
static function Eval(MathExpression : String) : double
{
return eval(MathExpression);

};
}

3. Compile it with the command line jsc compiler: jsc /t:library
DynamicMath.js
4. Add a reference to DynamicMath.dll to your project (and to
Microsoft.JScript.dll as well)
5. Use from your favourite .NET language:
Dim d As Double = DynamicMath.Eval("2 + 3 + 4")
MessageBox.Show(d)
6. That''s it..
///
Cor


Hi Cor


感谢您的回复。不幸的是,我不认为它会有所帮助,除非我遗漏了一些东西,否则我不会这么做。


问题不在于如何实施命令也没有评估它们。

相反,我试图找到一种可靠的方法将文件翻译成'b $ b'到''命令脚本''。例如,文档可能包含一些内容

就像这样


1从这里开始

1.1第一组

1.1.1说明

做点什么

做别的事情

1.1.2更多说明

这样做其他的东西

再做第一件事

1.2 Second Group

...

1.3更多相同


我需要将其转换为可以按照Command模式的方式反序列化为

命令层次结构的内容,以便每个

命令可以按顺序执行。操作的结果将是


做点什么

做别的事情

做另外这件事

再做第一件事

...

Charles

" Cor Ligthert" <无************ @ planet.nl>在消息中写道

news:%2 **************** @ TK2MSFTNGP12.phx.gbl ...
Hi Cor

Thanks for the reply. I don''t think it is going to help unfortunately,
unless I have missed something.

The problem is not so much how to implement the commands nor evaluate them.
Rather, I am trying to find some reliable means of translating a document
into a ''command script''. For example, the document might contain something
like this

1 Start Here
1.1 First Group
1.1.1 Instructions
Do something
Do something else
1.1.2 More Instructions
Do this other thing
Do first thing again
1.2 Second Group
...
1.3 More of the Same

I need to translate this into something that can be deserialised into a
hierarchy of commands, in the style of the Command pattern, so that each
Command can be executed, in sequence. The result of the operation will be

Do something
Do something else
Do this other thing
Do first thing again
...

Charles
"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Charles,

几周前这个新闻组也提供了这个新闻组。奈杰尔·阿姆斯特朗(Anggel Amstrong)创建了一个名为:DynamicMath.js的文件 2.添加此代码:

类DynamicMath
{静态函数Eval(MathExpression:String):double
{
返回eval(MathExpression);

};
}
3.使用命令行jsc编译器编译它:jsc / t:library
DynamicMath。 js
4.将DynamicMath.dll的引用添加到您的项目中(以及
Microsoft.JScript.dll)
5.使用您喜欢的.NET语言:
Dim d As Double = DynamicMath.Eval(" 2 + 3 + 4")
MessageBox.Show(d)
6.就是这样......
///
Cor
Charles,

This is suplied too this newsgroup some weeks ago

\\\Eval by Nigel Amstrong
1. Create a file called: DynamicMath.js
2. Add this code to it:

class DynamicMath
{
static function Eval(MathExpression : String) : double
{
return eval(MathExpression);

};
}

3. Compile it with the command line jsc compiler: jsc /t:library
DynamicMath.js
4. Add a reference to DynamicMath.dll to your project (and to
Microsoft.JScript.dll as well)
5. Use from your favourite .NET language:
Dim d As Double = DynamicMath.Eval("2 + 3 + 4")
MessageBox.Show(d)
6. That''s it..
///
Cor



Charles,

当我的问题出现并且文档做得好,比我想看的更好

Word自动化可以为我做,而不是先看看allinea的设置。


但是我很久没这么做了,但你问的想法是什么


Cor
Charles,

When it was my problem and the document is well done, than I would look what
Word automation could do for me and than first look at the allinea settings.

However I did not do this a long time, but you asked for idea''s

Cor


这篇关于寻找想法:将文档转换为XML命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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