JPH08171565A - Document structure converting device - Google Patents

Document structure converting device

Info

Publication number
JPH08171565A
JPH08171565A JP6316947A JP31694794A JPH08171565A JP H08171565 A JPH08171565 A JP H08171565A JP 6316947 A JP6316947 A JP 6316947A JP 31694794 A JP31694794 A JP 31694794A JP H08171565 A JPH08171565 A JP H08171565A
Authority
JP
Japan
Prior art keywords
document structure
document
condition
elements
type
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP6316947A
Other languages
Japanese (ja)
Inventor
Hitoki Kiyoujima
仁樹 京嶋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujifilm Business Innovation Corp
Original Assignee
Fuji Xerox Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fuji Xerox Co Ltd filed Critical Fuji Xerox Co Ltd
Priority to JP6316947A priority Critical patent/JPH08171565A/en
Publication of JPH08171565A publication Critical patent/JPH08171565A/en
Pending legal-status Critical Current

Links

Landscapes

  • Document Processing Apparatus (AREA)

Abstract

PURPOSE: To provide the device which can convert a document structure without a change in the appearance order of elements according to a conversion rule for the document structure that is written by a writer for a conversion rule of a rule without the need to consider the appearance order of the elements. CONSTITUTION: The document structure converting device, which converts the 1st document structure A of a structured document to the 2nd document structure B, has a conversion table 1 which holds the correspondence relation between elements included in two document classes prescribing the document structure, an element kind search part 4 which receives an element included in the 1st document structure A, searches the conversion table 1, and then determines a corresponding element in the 2nd document structure B, an element generation part 5 which generates the element determined by the element kind search part 4, and an element connection part 6 which connects elements generated by the element generation part 5 according to the order relation of the 1st document structure A to generate the 2nd document structure B.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、ワードプロセッサある
いは文書処理機能を持つパーソナルコンピュータやワー
クステーション等で処理される電子文書の構造を変換す
る装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an apparatus for converting the structure of an electronic document processed by a personal computer, a workstation or the like having a word processor or a document processing function.

【0002】[0002]

【従来の技術】ワードプロセッサ等により作成された電
子文書は、ディジタルデータとして表現されるので、追
加、削除、変更等の編集を容易に行なうことができ、文
書作成効率を高めることができる。また、既存の文書と
似た文書を作成する場合には、既存の電子文書を利用し
て容易に新たな文書を作成することができる。しかしな
がら、似た文書とはいっても、既存の文書と今から作成
しようとする文書の間には様式や形態には差異が存在す
るため、文書作成の際には、文書作成者が文章の内容と
様式を考慮しながら作業を進める必要があり、手書き程
ではないにしてもかなり手間がかかっていた。
2. Description of the Related Art Since an electronic document created by a word processor or the like is represented as digital data, it is possible to easily add, delete, change, etc., and improve the document creation efficiency. Further, when creating a document similar to an existing document, a new document can be easily created using an existing electronic document. However, even though they are similar documents, there are differences in style and form between the existing document and the document to be created now. It was necessary to proceed with the work while considering the style, and it was quite troublesome even if it was not like handwriting.

【0003】そこで、電子文書を構造化して効果的に文
書作成作業を行なえるようにすることが提案されてい
る。以下、構造化文書について説明する。
Therefore, it has been proposed to structure the electronic document so that the document creation work can be effectively performed. The structured document will be described below.

【0004】文書を構成する章、見出し、段落などの要
素と、その要素間の関係についての情報、たとえば、章
は、下位構造として見出しと段落を持つなどについての
情報を文書構造という。
Information about elements such as chapters, headings, and paragraphs that make up a document and the relationship between the elements, for example, information about a chapter having headings and paragraphs as a substructure is called a document structure.

【0005】構造化文書の概念を具体化した国際規格で
あるODA(Office Document Arc
hitecture)やSGML(Standard
Generalized Markup Langua
ge)の普及により、計算機上では、文書は構造を持つ
データとして表現されることが多くなった。
ODA (Office Document Arc), which is an international standard that embodies the concept of structured documents
title) and SGML (Standard)
Generalized Markup Langua
Due to the spread of ge), documents are often represented as structured data on a computer.

【0006】また、Maestro(Ian A. M
acleod,“Storageand Retrie
val of Structured Documen
ts”,Information Processin
g and Management 1990, Vo
l.26 No.2, pp.197−208参照)の
ような文書を対象にしたデータベース管理システム(D
BMS:Database Management S
ystem)においても、文書を文書構造を持つものと
して格納し、検索に文書構造を利用している。
In addition, Maestro (Ian A. M
acknowledge, “Storage and Retrie
val of Structured Documente
ts ", Information Process
g and Management 1990, Vo
l. 26 No. 26. 2, pp. Database management system (D) for documents such as 197-208)
BMS: Database Management S
Also, the document is stored as having a document structure and the document structure is used for retrieval.

【0007】上述したような文書構造を持つ文書を構造
化文書と呼ぶ。通常、文書構造は、文書のタイプ毎に、
文書構造中に出現しえる要素の種類や各要素に付随する
内容の種類、属性の種類、要素の接続関係に関する制約
が決められている。これを文書クラスと呼ぶ。ODAで
は共通論理構造、SGMLではDTD(Documen
t Type Definition)、Maestr
oではスキーマに相当するDocument Type
が文書クラスにあたる。
A document having the above document structure is called a structured document. Usually, the document structure is
The restrictions on the types of elements that can appear in the document structure, the types of contents associated with each element, the types of attributes, and the connection relationships between elements are determined. This is called a document class. ODA has a common logical structure, and SGML has a DTD (Document).
t Type Definition), Maestr
In o, Document Type corresponding to the schema
Corresponds to the document class.

【0008】構造化文書を対象にした処理は、文書構造
がなんらかの文書クラスに合致した物であることを前提
としている場合が多い。
In many cases, processing for a structured document is premised on that the document structure conforms to some document class.

【0009】たとえば、ODA文書のレイアウトの規則
が表現されている共通レイアウト構造は、文書クラスと
対で定義され、文書クラスが違う文書に同じ共通レイア
ウト構造を使うことはできない。
For example, the common layout structure expressing the layout rule of the ODA document is defined as a pair with the document class, and the same common layout structure cannot be used for documents having different document classes.

【0010】また、Maestroは、格納された文書
はすべてどれかの文書クラスに合致しており、文書クラ
スで規定された要素の種類や属性などを使って検索を行
っている。文書クラスが異なる文書を同一の検索条件で
検索することは難しい。
In Maestro, all the stored documents match with any document class, and a search is performed using the element types and attributes defined by the document class. It is difficult to search documents with different document classes under the same search condition.

【0011】文書クラスが違う文書に同じ共通レイアウ
ト構造を使ったり、文書クラスが異なる文書を同一の検
索条件で検索するためには、ある文書クラスの文書構造
を別の文書クラスの文書構造に変換する必要がある。
In order to use the same common layout structure for documents having different document classes or to search for documents having different document classes under the same search condition, the document structure of one document class is converted to the document structure of another document class. There is a need to.

【0012】例えば、本願出願人から特許出願され、公
開された特開平4−177455号公報では、ある文書
クラスの文書構造を別の文書クラスの文書構造に変換す
るために、文書構造中に出現する要素の下位構造の関係
を記述した規則を用意しておき、その規則を評価するこ
とによって文書構造の変換を行っている。
For example, in Japanese Unexamined Patent Publication No. 4-177455, which has been applied for a patent by the applicant of the present application, the document structure appears in the document structure in order to convert the document structure of one document class into the document structure of another document class. A rule that describes the relationship of the substructure of the element to be prepared is prepared, and the document structure is converted by evaluating the rule.

【0013】[0013]

【発明が解決しようとする課題】上記公報に記載の文書
構造生成方式の規則では、直下に接続する要素の増減、
順序の変更も記述でき、文書の要素の出現順序の変更に
よる論理的な構成の変更まで行うことができる。しかし
その半面、規則の記述者は、常に要素の出現順序を考慮
して記述する必要があり作業が煩雑化するという問題が
ある。
According to the rule of the document structure generation method described in the above publication, increase / decrease of elements connected directly below,
A change in the order can be described, and even the logical configuration can be changed by changing the order of appearance of document elements. However, on the other hand, the rule writer must always write in consideration of the order of appearance of elements, which complicates the work.

【0014】文書クラスが違う文書に同じ共通レイアウ
ト構造を使ったり、文書クラスが異なる文書を同一の検
索条件で検索するという目的を達する場合に、要素の出
現順序の変更は必要なく、かえって、要素の出現順序が
変わってしまうと、内容の意味が変わってしまって、害
をなす場合さえある。
When the same common layout structure is used for documents with different document classes, or when the purpose of searching documents with different document classes under the same search condition is satisfied, it is not necessary to change the order of appearance of the elements, but rather the elements. If the order of appearance of is changed, the meaning of the contents may change, which may be harmful.

【0015】このような不都合を避けるために、上記公
報に記載の文書構造生成方式では、要素の出現順序の変
更が起こらないよう注意して規則を記述しなければなら
ず、作業者の負荷が重くなるという問題がある。
In order to avoid such an inconvenience, in the document structure generation method described in the above publication, rules must be described with care so that the order of appearance of elements does not change, which imposes a burden on the operator. There is a problem that it becomes heavy.

【0016】本発明は、規則の変換規則の記述者が、要
素の出現順序について考慮する必要なしに記述された文
書構造の変換規則によって、要素の出現順序の変わらな
い文書構造の変換ができる装置を提供するものである。
According to the present invention, a device for converting a document structure in which the appearance order of elements does not change by the conversion rule of the document structure described without the consideration of the appearance order of elements by the writer of the rule conversion rules. Is provided.

【0017】[0017]

【課題を解決するための手段】本発明の文書構造変換装
置は、図1に示すように、構造化文書における第1の文
書構造Aを第2の文書構造Bに変換するための文書構造
変換装置であって、文書構造を規定する二つの文書クラ
スに含まれる要素間の対応関係を保持する変換テーブル
1と、前記第1の文書構造Aに含まれる要素を受け取
り、前記変換テーブル1を検索して、前記第2の文書構
造Bに含まれる対応する要素を決定する要素種探索手段
4と、前記要素種探索手段4により決定された要素を生
成する要素生成手段5と、前記要素生成手段5により生
成された要素を前記第1の文書構造Aの順序関係により
連結して前記第2の文書構造Bを生成する要素連結手段
6とを有することを特徴とする。
As shown in FIG. 1, a document structure conversion apparatus according to the present invention converts a first document structure A in a structured document into a second document structure B. A device, which receives a conversion table 1 that holds a correspondence relationship between elements included in two document classes that define a document structure and an element included in the first document structure A, and searches the conversion table 1 Then, the element type searching means 4 for determining the corresponding element included in the second document structure B, the element generating means 5 for generating the element determined by the element type searching means 4, and the element generating means. 5 and the element connecting means 6 for connecting the elements generated by the step 5 according to the order relation of the first document structure A to generate the second document structure B.

【0018】また、本発明の文書構造変換装置は、前記
要素連結手段6により生成された第2の文書構造Bが、
第2の文書構造Bを制約する文書クラスに従ったものか
否かを検査する文書構造検査手段3を更に有することを
特徴とする。
In the document structure conversion device of the present invention, the second document structure B generated by the element connecting means 6 is
It is characterized by further comprising a document structure inspection means 3 for inspecting whether the second document structure B complies with a document class which restricts the second document structure B.

【0019】[0019]

【作用】第1の文書構造Aを有する文書が入力される
と、要素種探索手段4は、第1の文書構造Aに含まれる
要素を受け取り、変換テーブル1を検索して、前記第2
の文書構造Bに含まれる対応する要素を決定する。要素
生成手段5は、前記要素種探索手段4により決定された
要素を生成し、要素連結手段6は、前記要素生成手段5
により生成された要素を前記第1の文書構造Aの順序関
係により連結して第2の文書構造Bを生成する。
When a document having the first document structure A is input, the element type searching means 4 receives the elements included in the first document structure A, searches the conversion table 1 and outputs the second table.
Then, the corresponding element included in the document structure B is determined. The element generating means 5 generates the element determined by the element type searching means 4, and the element connecting means 6 generates the element generating means 5
The second document structure B is generated by connecting the elements generated by the above-mentioned method according to the order relation of the first document structure A.

【0020】変換テーブル1中の情報には、文書の要素
の出現順序についての情報は一切なく、変換テーブル1
の内容をユーザが記述する際には、要素の出現順序につ
いての考慮は必要ない。
The information in the conversion table 1 has no information about the appearance order of the elements of the document.
When the user describes the contents of, it is not necessary to consider the order of appearance of elements.

【0021】また、第2の文書構造Bの要素の連結の際
に、第1の文書構造で決まっていた要素の出現順序を保
存して連結するので、要素の出現順序が変換によって変
わることがない。
When the elements of the second document structure B are connected, the appearance order of the elements determined in the first document structure is stored and connected, so that the appearance order of the elements may change due to conversion. Absent.

【0022】文書構造検査手段3により、変換後の文書
構造が第2の文書構造Bを制約する文書クラスに合致し
た文書構造であるかを検査し、変換の結果の正しさを検
査することができる。
The document structure inspecting means 3 can inspect whether the converted document structure is a document structure that matches the document class that constrains the second document structure B, and inspect the correctness of the conversion result. it can.

【0023】[0023]

【実施例】図1は、本発明を適用する文書構造変換装置
の概略を示す図である。
1 is a diagram showing the outline of a document structure conversion device to which the present invention is applied.

【0024】本実施例は、ある文書クラスによって制約
されている文書構造を、別の文書クラスによって制約さ
れている文書構造に変換する。また、本実施例で扱う文
書構造は木構造である。図中、Aは変換前の文書構造を
示し、Bは変換後の文書構造を示す。
In this embodiment, a document structure restricted by a certain document class is converted into a document structure restricted by another document class. The document structure used in this embodiment is a tree structure. In the figure, A shows the document structure before conversion, and B shows the document structure after conversion.

【0025】本実施例の文書構造の変換装置は、以下の
3つの部分からなる。すなわち、入力する文書構造の各
要素が、変換後にどの種類の要素になるかを決める規則
を記憶した変換テーブル1と、変換テーブル1に記憶さ
れた規則にしたがって、入力する文書構造から新たな文
書構造を生成する文書構造生成部2と、生成された文書
構造がその文書構造を制約する文書クラスに従っている
かどうかを検査する文書構造検査部3である。
The document structure conversion apparatus of this embodiment comprises the following three parts. That is, according to the conversion table 1 that stores rules for determining what kind of element each element of the input document structure becomes after conversion, and a new document from the input document structure according to the rules stored in the conversion table 1. A document structure generation unit 2 that generates a structure and a document structure inspection unit 3 that inspects whether the generated document structure complies with a document class that restricts the document structure.

【0026】変換テーブル1の内容の例を表1に示す。Table 1 shows an example of the contents of the conversion table 1.

【0027】[0027]

【表1】 変換テーブル1には、入力する文書構造の要素について
の条件と、その条件にマッチした要素が、変換後の文書
構造ではどのような種類の要素になるかが記憶されてい
る。変換テーブル1は、不揮発性メモリ或いはバッテリ
でバックアップされたメモリから構成され、変換テーブ
ルの内容は、ユーザが書き換えることができる。
[Table 1] The conversion table 1 stores conditions for the elements of the input document structure and what kind of elements the elements matching the conditions become in the converted document structure. The conversion table 1 is composed of a nonvolatile memory or a memory backed up by a battery, and the contents of the conversion table can be rewritten by the user.

【0028】変換テーブル1中の、入力する文書構造の
要素についての条件は、各種条件へのポインタである。
ポインタが指し示す先の条件は、条件種を示すタグと、
条件の内容を示すデータ(条件データと呼ぶ)からなる
構造体にしておく。
The conditions for the elements of the input document structure in the conversion table 1 are pointers to various conditions.
The condition that the pointer points to is a tag that indicates the condition type,
The structure is made up of data indicating condition contents (called condition data).

【0029】条件データは、以下に示すように、条件種
によって異なる。
The condition data differs depending on the condition type, as shown below.

【0030】条件種が、特定の要素種の要素であるかど
うかについてのものであるならば、条件データは要素種
になる。
If the condition type is about whether or not the element is a specific element type, the condition data becomes the element type.

【0031】条件種が、要素が持つ属性についてのもの
であるならば、条件データは要素の属性についての条
件、たとえば、属性名と属性値のペアになる。
If the condition type is for the attribute of the element, the condition data is a condition for the attribute of the element, for example, a pair of attribute name and attribute value.

【0032】条件種が、要素が持つ内容が特定のタイ
プ、たとえば、文字列、幾何図形、表などであるかどう
かについてのものであるならば、条件データは内容のタ
イプになる。
If the condition type is for whether the content that the element has is of a particular type, such as a string, geometry, table, etc., then the condition data will be the content type.

【0033】条件種が、要素の持つ文字内容が特定のパ
ターンの文字列を含むかどうかについてのものであるな
らば、条件データは文字列のパターンになる。
If the condition type is about whether the character content of the element includes a character string of a specific pattern, the condition data is a character string pattern.

【0034】条件が、接続条件について、すなわち、条
件種が親要素についてのもの、子供の要素についてのも
の、先祖の要素についてのもの、子孫の要素についての
もの、兄弟の要素についてのものであるならば、条件デ
ータは親要素、子供の要素、先祖の要素、子孫の要素、
兄弟の要素に適用される条件へのポインタになる。
The condition is a connection condition, that is, the condition type is for a parent element, for a child element, for an ancestor element, for a descendant element, and for a sibling element. Then, the condition data is the parent element, child element, ancestor element, descendant element,
It is a pointer to the conditions that apply to sibling elements.

【0035】次に、文書構造生成部2について説明す
る。文書構造生成部2は、以下の3つの部分からなる。
すなわち、変換テーブル1を参照して、入力する文書構
造の要素が変換後にどの種類の要素になるかを決定する
要素種探索部4と、入力する文書構造の要素から、要素
種探索部4が決定した種類の要素を生成する要素生成部
5と、要素生成部5によって生成された要素を連結する
要素連結部6である。
Next, the document structure generator 2 will be described. The document structure generation unit 2 is composed of the following three parts.
That is, by referring to the conversion table 1, the element type searching unit 4 that determines which kind of element the input document structure becomes after conversion, and the element type searching unit 4 from the input document structure element An element generation unit 5 that generates an element of the determined type and an element connection unit 6 that connects the elements generated by the element generation unit 5.

【0036】さらに、要素種探索部4は、以下の5つの
部分からなる。すなわち、入力する文書構造の要素の種
類に対する条件を評価する要素種条件評価部7と、入力
する文書構造の要素の接続条件(親、先祖、子、子孫、
兄弟の要素についての条件)を評価する接続条件評価部
8と、入力する文書構造の要素が持つ内容の種類(文
字、幾何図形、ラスタ、数式、表など)についての条件
を評価する内容種条件評価部9と、入力する文書構造の
要素が持つ属性についての条件を評価する属性条件評価
部10と、入力する文書構造の要素が持つ文字内容のパ
ターンについての条件を評価する内容パターン条件評価
部11である。
Further, the element type searching unit 4 is composed of the following five parts. That is, the element type condition evaluation unit 7 that evaluates the condition for the type of element of the input document structure, and the connection condition (parent, ancestor, child, descendant,
Connection condition evaluation unit 8 for evaluating (conditions regarding sibling elements) and content type conditions for evaluating conditions regarding the type of contents (characters, geometric figures, rasters, mathematical formulas, tables, etc.) held by the elements of the input document structure An evaluation unit 9, an attribute condition evaluation unit 10 that evaluates a condition about an attribute of an input document structure element, and a content pattern condition evaluation unit that evaluates a condition about a character content pattern of an input document structure element Eleven.

【0037】次に、本実施例の文書構造生成部2の動き
を説明する。
Next, the operation of the document structure generator 2 of this embodiment will be described.

【0038】文書構造生成部2全体を駆動しているの
は、要素連結部6である。要素種探索部4や要素生成部
5は、必要に応じて要素連結部6から呼び出される。
The element connecting unit 6 drives the entire document structure generating unit 2. The element type search unit 4 and the element generation unit 5 are called by the element connection unit 6 as necessary.

【0039】要素連結部6の動きを、図2のフローチャ
ートにしたがって説明する。
The movement of the element connecting portion 6 will be described with reference to the flowchart of FIG.

【0040】要素連結部6では、入力側の文書構造のど
れかの要素を入力ノードInputNode、生成中の
文書構造の既に生成済みのどれかの要素を出力ノードO
utput Nodeとして処理が行われる。
In the element connecting unit 6, any element of the document structure on the input side is an input node InputNode, and any element of the document structure being generated has already been generated is an output node O.
The process is performed as an output node.

【0041】文書構造の生成の最初では、入力側の文書
構造の根(root)である要素がInput Nod
e、Output Nodeは未定として、要素連結部
6の処理が始まる。
At the beginning of generation of the document structure, the element that is the root of the document structure on the input side is the Input Nod.
Since e and Output Node are undecided, the process of the element connecting unit 6 starts.

【0042】要素連結部6では、まず要素種探索部4を
呼び出し、Input Nodeの変換後の要素種を決
定する (ステップ101,102)。
The element connection unit 6 first calls the element type search unit 4 to determine the element type after conversion of the Input Node (steps 101 and 102).

【0043】要素種が決定できない場合、Input
Nodeが入力側の文書構造の根ならば (ステップ10
4)、文書構造の生成はエラーとなる。Input N
odeが入力側の文書構造の根でなければ、Input
Nodeの子供の要素についての処理に移る (ステッ
プ108,109)。
If the element type cannot be determined, Input
If Node is the root of the document structure on the input side (step 10
4) The generation of the document structure causes an error. Input N
If ode is not the root of the document structure on the input side, Input
The processing for the child element of the Node is started (steps 108 and 109).

【0044】変換後の要素種が決定できたら、要素生成
部5を呼び出し、該種類の要素を生成する (ステップ1
03)。
When the element type after conversion can be determined, the element generation unit 5 is called to generate the element of the type (step 1
03).

【0045】新しい要素の生成後、Input Nod
eが入力側の文書構造の根でなければ (ステップ10
5)、生成された要素を、Output Nodeに末
子として連結し (ステップ106)、生成された要素を
新しいOutput Nodeにする (ステップ10
7)。Input Nodeが入力側の文書構造の根の
場合は、連結を行わず、生成された要素を新しいOut
put Nodeにする (ステップ107)。
After creating the new element, Input Nod
e is not the root of the document structure on the input side (step 10
5) Concatenate the generated element to the Output Node as the youngest child (step 106), and make the generated element a new Output Node (step 10).
7). If the Input Node is the root of the document structure on the input side, the concatenation is not performed and the generated element is replaced with the new Out.
Put node (step 107).

【0046】その後、Input Nodeが子供の要
素を持たなければ (ステップ108)、処理は終了であ
る。
Thereafter, if the Input Node does not have a child element (step 108), the processing ends.

【0047】Input Nodeが子供の要素を持つ
場合には、Input Nodeの長男を新たなInp
ut Nodeとし (ステップ109)、Input
NodeとOutput Nodeに対して、図2のフ
ローチャートと同じ処理が再帰的に呼び出される (ステ
ップ110)。
When the Input Node has a child element, the eldest son of the Input Node is replaced with a new Inp.
ut Node (Step 109), Input
For Node and Output Node, the same processing as in the flowchart of FIG. 2 is recursively called (step 110).

【0048】その処理の後、Input Nodeが弟
の要素を持たなければ (ステップ111)終了である。
After the processing, if the Input Node does not have the younger brother element (step 111), the process ends.

【0049】Input Nodeが弟の要素を持つ場
合には、Input Nodeの直後の弟を新たなIn
put Nodeとし (ステップ112)、Input
NodeとOutput Nodeに対して、図2の
フローチャートと同じ処理が再帰的に呼び出される (ス
テップ110)。
When the Input Node has the younger brother element, the younger brother immediately after the Input Node is newly replaced with the new In element.
Put Node (Step 112), Input
For Node and Output Node, the same processing as in the flowchart of FIG. 2 is recursively called (step 110).

【0050】次に、要素種探索部4の動きについて説明
する。要素種探索部4では、変換テーブル1の最初の規
則から順に、規則の条件がInput Nodeにマッ
チするかどうかを調べ、最初にマッチした規則の要素種
を、変換後の要素種とする。例えば、表1の変換テーブ
ルでは、要素種PARAGRAPHになるのは、規則1
〜規則5のどれにもマッチせず、規則6にマッチした場
合のみである。
Next, the operation of the element type search unit 4 will be described. The element type search unit 4 checks in order from the first rule of the conversion table 1 whether or not the condition of the rule matches the Input Node, and sets the element type of the first matching rule as the element type after conversion. For example, in the conversion table of Table 1, the element type PARAGRAPH is rule 1
~ Only if none of Rule 5 is matched, but Rule 6 is matched.

【0051】条件の評価の際には、条件の種類に応じ
て、要素種条件評価部7、接続条件評価部8、属性条件
評価部10、内容種条件評価部9、内容パターン条件評
価部11を呼び出して評価する。
When evaluating the conditions, the element type condition evaluation unit 7, the connection condition evaluation unit 8, the attribute condition evaluation unit 10, the content type condition evaluation unit 9, and the content pattern condition evaluation unit 11 are selected according to the type of condition. To call and evaluate.

【0052】接続条件評価部8では、その条件種が親に
ついてのものであれば、InputNodeの親ノード
について、条件データで示されている条件の評価を行
う。親ノードについての条件の評価の結果が真であれ
ば、規則がマッチしたことになる。
If the condition type is for the parent, the connection condition evaluation unit 8 evaluates the condition indicated by the condition data for the parent node of the InputNode. If the result of evaluating the condition for the parent node is true, then the rule has been matched.

【0053】条件種が子についてのものであれば、In
put Nodeのすべての子ノードについて、条件デ
ータで示されている条件の評価を行う。条件データで示
されている条件の評価の結果が真であるような子ノード
が存在すれば、規則がマッチしたことになる。
If the condition type is child, In
The condition indicated by the condition data is evaluated for all child nodes of the put Node. If there is a child node for which the result of the evaluation of the condition indicated by the condition data is true, the rule has matched.

【0054】条件種が先祖についてのものであれば、I
nput Nodeのすべての先祖ノードについて、条
件データで示されている条件の評価を行う。条件データ
で示されている条件の評価の結果が真であるような先祖
ノードが存在すれば、規則がマッチしたことになる。
If the conditional species is of an ancestor, then I
The condition indicated by the condition data is evaluated for all the ancestor nodes of the nput Node. If there is an ancestor node such that the result of the evaluation of the condition indicated by the condition data is true, the rule has matched.

【0055】条件種が子孫についてのものであれば、I
nput Nodeのすべての子孫ノードについて、条
件データで示されている条件の評価を行う。条件データ
で示されている条件の評価の結果が真であるような子孫
ノードが存在すれば、規則がマッチしたことになる。
If the condition type is for offspring, then I
The condition indicated by the condition data is evaluated for all descendant nodes of the nput Node. If there is a descendant node for which the result of the evaluation of the condition indicated by the condition data is true, it means that the rule has matched.

【0056】条件種が兄弟についてのものであれば、I
nput Nodeのすべての兄弟ノードについて、条
件データで示されている条件の評価を行う。条件データ
で示されている条件の評価の結果が真であるような兄弟
ノードが存在すれば、規則がマッチしたことになる。
If the condition type is for siblings, then I
The condition indicated by the condition data is evaluated for all sibling nodes of the nput Node. If there is a sibling node for which the result of the evaluation of the condition indicated by the condition data is true, then the rule has matched.

【0057】条件データで示されている条件も、その条
件の種類に応じて、要素種条件評価部7、接続条件評価
部8、属性条件評価部10、内容種条件評価部9、内容
パターン条件評価部11を呼び出して評価する。条件デ
ータで示されている条件が、接続条件であったならば、
該接続条件の条件データで示されている条件も、その条
件の種類に応じて、要素種条件評価部7、接続条件評価
部8、属性条件評価部10、内容種条件評価部9、内容
パターン条件評価部11を呼び出して評価すればよい。
As for the conditions indicated by the condition data, the element type condition evaluation unit 7, the connection condition evaluation unit 8, the attribute condition evaluation unit 10, the content type condition evaluation unit 9, and the content pattern condition are also selected according to the type of the condition. The evaluation unit 11 is called and evaluated. If the condition indicated by the condition data is a connection condition,
The condition indicated by the condition data of the connection condition also includes the element type condition evaluation unit 7, the connection condition evaluation unit 8, the attribute condition evaluation unit 10, the content type condition evaluation unit 9, and the content pattern according to the type of the condition. The condition evaluation unit 11 may be called and evaluated.

【0058】次に、要素生成部5の動きについて説明す
る。要素生成部5では、要素種探索部4によって決定さ
れた種類の要素を生成する。このとき、Input N
odeが持つ内容がコピーされて、新しい要素の内容に
なる。また、このとき、Input Nodeのいずれ
かの属性の属性値をコピーして、新しい要素の属性の属
性値にするように構成してもよい。どの属性の属性値
が、どの属性の属性値になるかの規則は、変換テーブル
1に記憶しておけばよい。
Next, the operation of the element generator 5 will be described. The element generation unit 5 generates an element of the type determined by the element type search unit 4. At this time, Input N
The contents of ode are copied and become the contents of the new element. At this time, the attribute value of one of the attributes of the Input Node may be copied to be the attribute value of the attribute of the new element. The conversion table 1 may store the rule of which attribute value has which attribute value.

【0059】本実施例の、文書構造検査部は、既存の技
術を使って構成すればよい。
The document structure inspection unit of this embodiment may be constructed by using an existing technique.

【0060】文書クラスがSGMLのDTDのように定
義される場合には、例えば、Anne Bruggem
an−Klein,“Regular express
ions into finite automat
a”, Lecture Notes in Comp
uter Science, Vol 583, p
p.87−98, 1992、あるいは、Anne B
ruggeman−Klein and Derick
Wood,“Deterministic regu
lar language”, Lecture No
tes in Computer Science,
Vol.577, pp.173−184,1992に
示されている方法で、文書構造を検査するためのオート
マトンを作り、それを使って検査すればよい。
When the document class is defined as SGML DTD, for example, Anne Bruggem
an-Klein, “Regular express
ions into finite automat
a ”, Right Notes in Comp
uter Science, Vol 583, p
p. 87-98, 1992, or Anne B
ruggeman-Klein and Derick
Wood, “Deterministic regu
lar language ", Lecture No
tes in Computer Science,
Vol. 577, pp. By the method shown in 173-184, 1992, an automaton for inspecting the document structure may be created and used for inspecting.

【0061】本実施例で文書変換を行った例を以下に示
す。
An example of document conversion in this embodiment is shown below.

【0062】図3は、本変換例の入力となる文書構造を
制約する文書クラスを図示したものである。
FIG. 3 shows a document class that restricts the document structure that is an input of this conversion example.

【0063】矩形で囲まれている“root”、“se
ct”、“fig”、“par”は、文書構造中に出現
する要素の種類である。“root”は根、“sec
t”は章、“fig”は図、“par”は段落である。
要素種間を結んでいるリンクとOPT、REP、CH
O、SEQは、文書構造がとりえる木構造を制約してい
る。その意味は、”ISO/IS 8613, Inf
ormation Processing − Tex
t and Office System − Off
ice Document Architecture
(ODA) and Interchange Fo
rmat, Part 2, AnnexB”に記載さ
れているものと同じであるので、ここでは詳細な説明は
省略するが、OPTは下位の構造が0回又は1回出現す
ることを示し、REPは下位の構造が1回以上出現する
ことを示し、CHOは直下に示される構造のどれか一つ
が出現することを示し、SEQは直下に示される構造の
全てが示された順に出現することを示す。
"Root" and "se" surrounded by a rectangle
"ct", "fig", and "par" are the types of elements that appear in the document structure, "root" is the root, and "sec" is the root.
“T” is a chapter, “fig” is a figure, and “par” is a paragraph.
Links connecting element types and OPT, REP, CH
O and SEQ limit the tree structure that the document structure can have. The meaning is "ISO / IS 8613, Inf.
orientation Processing-Tex
t and Office System-Off
ice Document Architecture
(ODA) and Interchange Fo
Since it is the same as that described in rmat, Part 2, Annex B ″, a detailed description thereof will be omitted here, but OPT indicates that a lower structure appears 0 or 1 times, and REP indicates a lower structure. The structure indicates that the structure appears one or more times, CHO indicates that any one of the structures shown immediately below appears, and SEQ indicates that all of the structures shown immediately below appear in the indicated order.

【0064】本実施例における文書クラスでは、要素の
種類毎に持ち得る内容の種類と、属性が規定される。図
3の文書クラスでは、root、sectは内容を持た
ず、parは文字内容を持ち、figは幾何図形内容を
持つことが規定されているものとする。またparは、
文字列型の属性値を持つ属性par−typeを持つこ
とが規定されているものとする。
In the document class according to this embodiment, the types of contents that can be possessed and the attributes are defined for each type of element. In the document class of FIG. 3, it is assumed that root and set have no content, par has character content, and fig has geometric figure content. Also par is
It is assumed that an attribute par-type having a character string type attribute value is specified.

【0065】図4は、本変換例の変換結果の文書構造を
制約する文書クラスを図示したものである。図の内容の
意味は、図3と同じである。
FIG. 4 illustrates a document class that restricts the document structure of the conversion result of this conversion example. The meaning of the contents of the figure is the same as that of FIG.

【0066】図4の文書クラスでは、ROOT、SEC
TIONは内容を持たず、TITLE、PARAGRA
PHは文字内容を持ち、FIGUREは幾何図形内容を
持つことが規定されているものとする。
In the document class shown in FIG. 4, ROOT and SEC are used.
TION has no contents, TITLE, PARAGRA
It is assumed that PH has character contents and FIGURE has geometric figure contents.

【0067】図5は、本変換例の入力となる文書構造の
例を図示したものである。
FIG. 5 illustrates an example of a document structure which is an input of this conversion example.

【0068】文書構造は、たとえば、要素を表す構造体
の集合として実装すればよい。要素を表す構造体は、た
とえば、要素種を示す文字列、その要素が持つ属性につ
いてのデータ(たとえば、属性名と属性値のペアの集
合)、その要素が持つ内容についての情報(内容種を表
す文字列と、内容を表すデータのペア、その要素の子供
の要素を指すポインタの列からなるように実装すればよ
い。
The document structure may be implemented, for example, as a set of structures representing elements. The structure that represents an element is, for example, a character string indicating the element type, data about the attribute of the element (for example, a set of attribute name and attribute value pairs), information about the content of the element (content type is It should be implemented so that it consists of a character string that represents the content, a pair of data that represents the content, and a string of pointers that point to the child element of the element.

【0069】図5において、文書構造の各要素は、その
要素種と識別のための数字の連結で示されている。図5
の文書構造では、par1の属性par−typeの値
は“title”という文字列であるとする。またpa
r4の持つ文字内容は、“第2章”という文字列を含ん
でいるものとする。
In FIG. 5, each element of the document structure is shown by connecting the element type and a number for identification. Figure 5
In the document structure, the value of the attribute par-type of par1 is a character string "title". Also pa
It is assumed that the character content of r4 includes the character string "Chapter 2".

【0070】図5の文書構造を、表1に示される変換テ
ーブル1を持つ本実施例によって変換した結果が、図6
の文書構造である。
The result of converting the document structure of FIG. 5 by the present embodiment having the conversion table 1 shown in Table 1 is shown in FIG.
Is the document structure of.

【0071】図6において、文書構造の各要素は、その
要素種と識別のための数字の連結で示されている。ま
た、( )で囲んで示しているのは、その要素が変換前
の文書構造のどの要素に対応するかを示している。
In FIG. 6, each element of the document structure is shown by connecting the element type and a number for identification. Also, what is enclosed by () shows which element of the document structure before conversion corresponds to that element.

【0072】変換によって、表1のどの規則にもマッチ
しなかったsect2に対応する要素は生成されない。
そのため、図6の文書構造は、図5の文書構造に比べて
階層の深さが少なくなっている。しかし、それ以外の要
素については、対応する要素が生成されており、生成結
果は、図5の文書構造で規定されている要素間の祖孫関
係や、兄弟の間の前後関係といった要素間の出現順序が
保存されている。
The conversion does not generate an element corresponding to sect2 that does not match any of the rules in Table 1.
Therefore, the document structure of FIG. 6 has a smaller depth of hierarchy than the document structure of FIG. However, with respect to the other elements, corresponding elements have been generated, and the generation result is an inter-element grandchild relationship defined by the document structure of FIG. The order of appearance is preserved.

【0073】図6の文書構造は、図4の文書クラスの制
約を満たしているので、文書構造検査部の検査は、正常
に通過する。
Since the document structure of FIG. 6 satisfies the constraint of the document class of FIG. 4, the inspection of the document structure inspection section normally passes.

【0074】[0074]

【発明の効果】以上に述べたように、本発明において
は、変換によって要素の出現順序が変わることがないの
で、要素の出現順序が変わることによる文書の論理的な
構成の変化を防ぐことができる。しかも、出現順序の保
存は要素連結部が保証し、変換テーブル自体に記述され
ないので、ユーザは出現順序の保存について考慮するこ
となく、変換テーブルの内容を記述することができる。
As described above, in the present invention, since the appearance order of elements is not changed by the conversion, it is possible to prevent the change of the logical structure of the document due to the change of the appearance order of elements. it can. Moreover, since the element concatenation unit guarantees the preservation of the appearance order and is not described in the conversion table itself, the user can describe the contents of the conversion table without considering the preservation of the appearance order.

【図面の簡単な説明】[Brief description of drawings]

【図1】 本発明を適用する文書構造の変換装置の概略
を示す図である。
FIG. 1 is a diagram showing an outline of a document structure conversion apparatus to which the present invention is applied.

【図2】 要素連結部の動きを説明するためのフローチ
ャートである。
FIG. 2 is a flowchart for explaining the movement of the element connecting portion.

【図3】 変換前の文書構造を制約する文書クラスを図
示した説明図である。
FIG. 3 is an explanatory diagram illustrating a document class that restricts a document structure before conversion.

【図4】 変換後の文書構造を制約する文書クラスを図
示した説明図である。
FIG. 4 is an explanatory diagram illustrating a document class that restricts a document structure after conversion.

【図5】 変換前の文書構造を示す説明図である。FIG. 5 is an explanatory diagram showing a document structure before conversion.

【図6】 変換後の文書構造を示す説明図である。FIG. 6 is an explanatory diagram showing a document structure after conversion.

【符号の説明】[Explanation of symbols]

1…変換テーブル、2…文書構造生成部、3…文書構造
検査部、4…要素種探索部、5…要素生成部、6…要素
連結部、7…要素種条件評価部、8…接続条件強化部、
9…内容種条件条件評価部、10…属性条件評価部、1
1…内容パターン条件評価部
1 ... conversion table, 2 ... document structure generation unit, 3 ... document structure inspection unit, 4 ... element type search unit, 5 ... element generation unit, 6 ... element connection unit, 7 ... element type condition evaluation unit, 8 ... connection condition Strengthening department,
9 ... Content type condition Condition evaluation unit, 10 ... Attribute condition evaluation unit, 1
1 ... Content pattern condition evaluation unit

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 構造化文書における第1の文書構造を第
2の文書構造に変換するための文書構造変換装置であっ
て、 文書構造を規定する二つの文書クラスに含まれる要素間
の対応関係を保持する変換テーブルと、 前記第1の文書構造に含まれる要素を受け取り、前記変
換テーブルを検索して、前記第2の文書構造に含まれる
対応する要素を決定する要素種探索手段と、 前記要素種探索手段により決定された要素を生成する要
素生成手段と、 前記要素生成手段により生成された要素を前記第1の文
書構造の順序関係により連結して前記第2の文書構造を
生成する要素連結手段とを有することを特徴とする文書
構造変換装置。
1. A document structure conversion device for converting a first document structure in a structured document into a second document structure, the correspondence relationship between elements included in two document classes that define the document structure. A conversion table that holds the element, and an element type searching unit that receives an element included in the first document structure, searches the conversion table, and determines a corresponding element included in the second document structure, An element generation unit that generates the element determined by the element type search unit, and an element that generates the second document structure by connecting the elements generated by the element generation unit according to the order relation of the first document structure. A document structure conversion device comprising: a connecting unit.
【請求項2】 前記要素連結手段により生成された第2
の文書構造が、第2の文書構造を制約する文書クラスに
従ったものか否かを検査する文書構造検査手段を更に有
することを特徴とする文書構造変換装置。
2. The second generated by the element connecting means
The document structure conversion device further comprising a document structure inspection means for inspecting whether or not the document structure of is according to a document class that restricts the second document structure.
JP6316947A 1994-12-20 1994-12-20 Document structure converting device Pending JPH08171565A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP6316947A JPH08171565A (en) 1994-12-20 1994-12-20 Document structure converting device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP6316947A JPH08171565A (en) 1994-12-20 1994-12-20 Document structure converting device

Publications (1)

Publication Number Publication Date
JPH08171565A true JPH08171565A (en) 1996-07-02

Family

ID=18082715

Family Applications (1)

Application Number Title Priority Date Filing Date
JP6316947A Pending JPH08171565A (en) 1994-12-20 1994-12-20 Document structure converting device

Country Status (1)

Country Link
JP (1) JPH08171565A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6202072B1 (en) 1997-05-08 2001-03-13 Jusystem Corp. Method and apparatus for processing standard generalized markup language (SGML) and converting between SGML and plain text using a prototype and document type definition
KR100674796B1 (en) * 1999-12-30 2007-01-26 주식회사 케이티 Apparatus and its method for generating datafile from electronic document using information of mapping rules of document

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6202072B1 (en) 1997-05-08 2001-03-13 Jusystem Corp. Method and apparatus for processing standard generalized markup language (SGML) and converting between SGML and plain text using a prototype and document type definition
KR100674796B1 (en) * 1999-12-30 2007-01-26 주식회사 케이티 Apparatus and its method for generating datafile from electronic document using information of mapping rules of document

Similar Documents

Publication Publication Date Title
US7210096B2 (en) Methods and apparatus for constructing semantic models for document authoring
US7181734B2 (en) Method of compiling schema mapping
US8001156B2 (en) Processing XML node sets
US6766330B1 (en) Universal output constructor for XML queries universal output constructor for XML queries
US6502112B1 (en) Method in a computing system for comparing XMI-based XML documents for identical contents
US7370271B2 (en) Methods and apparatus for generating a spreadsheet report template
US5321608A (en) Method and system for processing natural language
US7657832B1 (en) Correcting validation errors in structured documents
US8117533B2 (en) Method and system for stylesheet rule creation, combination, and removal
KR101433936B1 (en) Method, system, and computer-readable medium for creating and laying out a graphic within an application program
US7409673B2 (en) XML document editor
US5752021A (en) Document database management apparatus capable of conversion between retrieval formulae for different schemata
US20020111964A1 (en) User controllable data grouping in structural document translation
US20060242575A1 (en) Dynamic Properties of Documents and the Use of These Properties
US20090019072A1 (en) Interoperable retrieval and deposit using annotated schema to interface between industrial document specification languages
JP3063555B2 (en) Document database management apparatus and method
US20070005657A1 (en) Methods and apparatus for processing XML updates as queries
US20080209572A1 (en) Data Processing System, Data Processing Method, and Management Server
US20010014899A1 (en) Structural documentation system
US8196033B2 (en) Converting between data sources and XML
JPH08171565A (en) Document structure converting device
JPH1115830A (en) Sentence abbreviation device and medium recording sentence abbreviation program
US7685569B2 (en) Navigation in computer software applications developed in a procedural language
JP3707133B2 (en) Document database management apparatus and document database management method
US20090222447A1 (en) Data processing apparatus and data processing method

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20040130