JP3566457B2 - Structured document version management method and apparatus - Google Patents

Structured document version management method and apparatus Download PDF

Info

Publication number
JP3566457B2
JP3566457B2 JP15920296A JP15920296A JP3566457B2 JP 3566457 B2 JP3566457 B2 JP 3566457B2 JP 15920296 A JP15920296 A JP 15920296A JP 15920296 A JP15920296 A JP 15920296A JP 3566457 B2 JP3566457 B2 JP 3566457B2
Authority
JP
Japan
Prior art keywords
structured
document
editing
difference
structured document
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.)
Expired - Fee Related
Application number
JP15920296A
Other languages
Japanese (ja)
Other versions
JPH09319632A (en
Inventor
ゆき 青山
亨 高橋
純一 東野
泰樹 伊藤
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.)
Hitachi Ltd
Original Assignee
Hitachi 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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP15920296A priority Critical patent/JP3566457B2/en
Publication of JPH09319632A publication Critical patent/JPH09319632A/en
Application granted granted Critical
Publication of JP3566457B2 publication Critical patent/JP3566457B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/197Version control
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/14Tree-structured documents
    • G06F40/143Markup, e.g. Standard Generalized Markup Language [SGML] or Document Type Definition [DTD]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Document Processing Apparatus (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、電子ファイルとして記憶されている構造化文書を取り扱うワープロ等の文書処理装置における構造化文書の版管理方法及び装置に関する。
【0002】
【従来の技術】
版管理とは、文書を編集、更新していく際に、文書の任意のバージョンを格納し、取り出すことができるよう、各バージョンの文書情報を管理することである。また、保存された各バージョンの文書は、文書の編集を効率よく行うために、バージョン間の変更箇所を抽出して表示したりするためにも用いられる。
従来、文書の版管理には二つの方式が採られている。
1番目は、各バージョンの文書をすべて保存しておき、指定されたバージョンの文書をそのまま取り出すよう管理する単純版管理方式(従来方式1)である。2番目は、元の文書あるいは最新文書等、基準となるバージョンの文書を一つ保存し、他のバージョンの文書に関しては、基準の文書との差分情報だけ保存しておき、指定されたバージョンの文書を取り出す際は、基準の文書と差分情報から、そのバージョンの文書を合成するよう管理する差分版管理方式(従来方式2)である。
また、近年、文書情報の効率的な共有と再利用を目的に、SGML等を用いて文書を構造化して作成し、利用する動きが活発化してきた。
構造化文書は、文書の論理的な構造に関する情報、例えば“文書中のこの部分はタイトルである”、“この部分は章である”といった情報を明確に記述できる。このため、変更や追加が細部に渡り簡単に確実に行えるため、更新が頻繁に行われるマニュアルなどの文書の編集に多用されてきている。
【0003】
この構造化文書の版管理に、従来の二方式を用いると、次のような問題が生じる。
まず、従来方式1は、構造化文書を対象とした場合に限らないが、各バージョンの文書をすべて保存しなければならないため、頻繁に更新が発生する場合には、文書データベースの容量が巨大化してしまうという問題が生じる。
次に、従来方式2は、文書データベースの容量が巨大化してしまうという従来方式1の問題は回避できるものの、文書の論理構造を区別した差分情報の管理が行えないため、文書のどこの構造が変更されたのか分からず、構造化して文書を作成している利点を活かせず、効率的な文書編集が行えないという問題が生じる。
これに対して、「特開平7−200370」(従来方式3)では、構造化文書を対象として各バージョンの文書を保持し、変更箇所を表示する版管理方法が開示されている。
本方式では確かに構造情報の差分も差分データとして抽出、表示されるものの、差分の表示方法が一律であるため、構造そのものが変更されたのか、あるいは構造の内容が変更されたのかが分かり難く、効率的な編集が行えないという問題がある。
【0004】
【発明が解決しようとする課題】
編集前後の構造化文書間の変更箇所を抽出した差分データとしては、構造を持たない通常の文書を比較した場合と異なり、次のような特徴がある。
(1)構造自体の変更と構造中の文字列の変更がある。
(2)差分情報にも論理的な構造がある。
図3の構造化文書を例にとり説明する。
図3の構造化文書はSGML(Standard Generalized Markup Language)
(ISO8879)で記述されたもので、<A>と</A>で挟まれた文字列が、論理構造<A>に属していることを意味する。
この論理構造を表すマークのことをタグと呼び、<A>と</A>はそれぞれ開始タグ、終了タグと呼ぶ。さらに、それぞれの構造のことをELEMENT(エレメント)と呼ぶ。
図3(a)構造化文書aを例にとると、<氏名>と</氏名>で挟まれた文字列“平成太郎”が、論理構造<氏名>に属することを表す。
また、<A>と</A>の間に<B>と</B>があることは、論理構造
<B>が論理構造<A>の子構造であることを意味する。例えば図3(a)では、<発信者>と</発信者>の間に<氏名>と</氏名>があるので、<氏名>は<発信者>の子構造であることを表す。
図3の編集前の構造化文書aと編集後の構造化文書a’を比較した結果の例を図4(a)に示す。
項番1(401)と項番3(403)は、それぞれ<氏名>,<本文>といった文書の構造は変わらず、構造中の文字列が変更されている例である。項番2(402)は、<所属>という構造自体が新たに挿入されている例である。
次に、構造化文書間の差分情報には論理的な構造があるという例を示す。
例えば、項番1(401)と項番3(403)は文字列の変更であるが、これらの文字列の変更箇所が、それぞれ<氏名>,<本文>という構造の中の変更であるというように、構造を特定して差分情報を表すためには、差分データとして構造情報を持たなければならない。また、項番2(402)では、挿入された
<所属>は<発信者>の子構造であるという、構造情報を持っている。
【0005】
しかしながら、従来の方式では、このような構造化文書の差分データの特徴を効果的に表示することができなかった。
従来方式3では、その変更箇所が文書の論理的な構造に関する情報の変更であっても、文字列の変更と区別することなく同様に構造を表す文字の表示属性を変えて表示している。
このため、構造そのものが変更されたのか、あるいは構造の内容が変更されたのかがユーザにとって分かり難いという問題がある。
この問題を具体的な例で説明する。
図4(b)に従来方式3による差分データの表示の例を示す。
本図では、構造自体の変更と構造中の文字列の変更を区別せず、構造情報を無視した表示方法になっている。このため、文書編集ソフト等でこの構造化文書を編集しているユーザにとって、どんな変更が行われたのか分かり難い。
また、文書編集ソフト等が、構造化文書を表示する際に構造情報をtreeで表すなど専用の表示プログラムを用いる場合、図4のような差分データの表示には、別の表示プログラムが必要になるためプログラムが複雑になってしまう。
【0006】
また、文書の任意のバージョンを格納し、取り出す機能を実現するために、従来方式1のように各バージョンの文書をすべて保存するのでは、保存するデータ量が多くなり、頻繁にバージョンが更新される文書の版管理方式としては適さない。
そこで、改訂が頻繁に行なわれる構造化文書の版管理方式としては、元の文書あるいは最新文書等、基準となるバージョンの文書を一つ保存し、他のバージョンの文書に関しては、基準の文書との差分情報だけ保存しておき、指定されたバージョンの文書を取り出す際は、基準の文書と差分情報から、そのバージョンの文書を合成する従来方式2のような方式が用いられるが、この方式では、構造化文書を対象とした文書の論理構造を区別した比較に基づく、版管理は行えないという問題がある。
【0007】
本発明の目的は、これらの問題に対して、SGML等を用いて記述される文書などのように、頻繁に更新が発生する文書の版を管理する際、文書データベースの容量の巨大化を防ぐとともに、文書の論理構造を区別した差分の管理が行え、さらに論理構造そのものの変更かその内容の変更かが簡単に明示でき、構造化文書の特徴を活かした効率的な文書編集が行えるようにする、構造化文書の版管理方法を提供することにある。
【0008】
【課題を解決するための手段】
上記目的を達成するため、本発明は、
SGML(Standard Generalized Markup Language)で記述され文書型定義をされた構造化文書に対して削除、挿入、または変更などの編集を施す処理装置と、該編集前後の構造化文書を格納する記憶装置を備え、前記処理装置により前記編集前後の両構造化文書を管理する構造化文書の版管理方法において、
前記記憶装置から編集前後の構造化文書を読み出す文書読込ステップと、上記読込ステップで取得された両構造化文書の論理的な構造を解析する構造解析ステップと、上記構造解析ステップによって得られた論理構造情報に基づいて、上記編集前後の両文書間の変更箇所を抽出する構造化文書差分抽出ステップと、上記差分抽出ステップにより得られた変更情報を、構造化記述した差分情報として出力する構造化差分情報出力ステップと、出力された構造化差分情報を表示、保存するステップを有するようにしている。
さらに、差分抽出する構造化文書の前記文書型定義から、構造化した差分情報のための文書型定義を生成する差分文書型定義生成ステップを有するようにしている。
さらに、前記記憶装置に編集前後の複数の版の構造化文書を記憶する際に、基準となる文書のみ記憶し、基準以外の文書は、基準文書との構造化した差分情報のみを記憶する文書登録ステップを有するようにしている。
さらに、指定した版の構造化文書を前記記憶装置から取り出す際に、基準となる文書はそのまま取り出し、基準以外の文書は、基準文書と構造化した差分情報を取り出し、指定した版を合成する文書取出ステップを有するようにしている。さらに、前記出力された構造化差分情報を表示、保存するステップにおける表示ステップは、表示画面上に構造を表示する構造ウィンドウと構造中の文字列を表示する文字列ウィンドウを表示し、該構造ウィンドウ中に編集前後の構造の表示と構造の追加、削除等を指示する表示をし、該文字列ウィンドウ中に編集前後の文字列の表示と文字列の追加、削除等を指示する表示を前記構造ウィンドウ中の編集前後の構造の表示の位置と対応する位置に行うようにしている。
【0009】
また、記憶装置と処理装置を備え、SGMLで記述され文書型定義をされた構造化文書に対して前記処理装置により削除、挿入、または変更などの編集を施し、前記記憶装置に該編集前後の構造化文書を格納し、前記処理装置により前記編集前後の両構造化文書を管理する構造化文書版管理装置において、
前記処理装置は、前記記憶装置から編集前後の構造化文書を読み出す文書読込手段と、上記文書読込手段で取得された両構造化文書の論理的な構造を解析する構造化文書解析手段と、上記構造解析手段によって得られた論理構造情報に基づいて、上記編集前後の構造化文書間の変更箇所を抽出する構造化文書差分抽出手段と、上記差分抽出手段により得られた変更情報を、構造化記述した差分情報として出力する構造化差分情報出力手段と、出力された構造化差分情報を表示、保存する手段を備えるようにしている。
さらに、差分抽出する構造化文書の前記文書型定義から、構造化した差分情報のための文書型定義を生成する差分文書型定義生成手段を備えるようにしている。
さらに、前記記憶装置に編集前後の複数の版の構造化文書を記憶する際に、基準となる文書のみ記憶し、基準以外の文書は、基準文書との構造化した差分情報のみを記憶する文書登録手段を備えるようにしている。
さらに、前記記憶装置より指定した版の構造化文書を取り出す際に、基準となる文書はそのまま取り出し、基準以外の文書は、基準文書と構造化した差分情報を取り出し、指定した版を合成する文書取出手段を備えるようにしている。
さらに、前記出力された構造化差分情報を表示、保存する手段は、表示画面上に構造を表示する構造ウィンドウと構造中の文字列を表示する文字列ウィンドウを表示し、該構造ウィンドウ中に編集前後の構造の表示と構造の追加、削除等を指示する表示をし、該文字列ウィンドウ中に編集前後の文字列の表示と文字列の追加、削除等を指示する表示を前記構造ウィンドウ中の編集前後の構造の表示の位置と対応する位置に行う表示手段を備えるようにしている。
【0010】
【発明の実施の形態】
以下、本発明の実施の形態の例を説明する。
【0011】
《実施例1》
一番目の実施例の構成を図1に示す。
図示したように、本実施例は、それぞれ、CPU101、端末装置102、文書を記憶するための2次記憶装置103と、文書の編集を行う文書編集プログラム104、編集前後の文書を管理する文書版管理プログラム105で構成され、
さらに文書版管理プログラム105は、
2次記憶装置103から編集前後の構造化文書を読み出す文書読込プログラム106、
読み込まれた両構造化文書の論理構造を解析する構造解析プログラム107、得られた論理構造情報に基づいて、編集前後の両文書間の変更箇所を抽出する構造化文書差分抽出プログラム108、
変更情報を、構造化記述した差分情報として出力する構造化差分情報出力プログラム109、
出力された構造化差分情報を表示、保存する表示・保存プログラム110、
比較する構造化文書の文書型定義から、差分データ用の文書型定義を生成する差分文書型定義生成プログラム111から構成される。
【0012】
本実施例では、構造化文書としてSGML文書を例にしている。
SGMLは、マーク付けされた構造化文書としてISOの国際規格として定められた文書記述言語のことである。また、SGML文書はDTD(文書型定義)によって、その論理構造が予め定義される。
SGML文書はDTDに定義された論理構造に従うよう実際の文書の中身である文書インスタンスが記述される。すなわち、図5に示すように、文書インスタンスと文書型定義をあわせて、構造化文書となる。
【0013】
本実施例の具体的な処理手順を、図2のフローチャートを用いて説明する。
その後、処理手順に従って、処理例を説明する。
〈ステップ201〉
文書編集プログラム104で、構造化文書の編集を行う。
【0014】
〈ステップ202〉
編集前後の構造化文書間の変更箇所を表示したり、保存したりするために、文書版管理プログラム105が呼び出されたら、まず、比較対象であるSGML文書のDTDに対応した差分データ用のDTDを取得する。
この差分データ用のDTDは、後述するステップ206において構造化文書間の変更情報をSGML形式で記述するための文書型定義として用いられる。
対応する差分DTDが存在する場合は、これを2次記憶装置103から読み込み、存在しない場合は、差分文書型定義生成プログラム111で対応する差分DTDを生成する。
〈ステップ203〉
比較対象であるSGML文書を2次記憶装置103から文書読込プログラム106によって読み込む。
〈ステップ204〉
差分抽出の前処理として、比較する二つの構造化文書の論理構造を構造解析プログラム107によって解析する。
〈ステップ205〉
ステップ204で得られた論理構造情報に基づいて、構造化文書間の差分を構造化文書差分抽出プログラム108によって抽出する。
〈ステップ206〉
構造化差分情報出力プログラム109により、ステップ205で抽出された変更情報を、ステップ202で取得した差分DTDに従いSGML形式で記述し、構造化差分情報として出力する。
〈ステップ207〉
表示・保存プログラム110により、端末装置102に差分結果の表示を行い、また、2次記憶装置103に構造化差分データを保存する。
【0015】
(処理例)
実施例の具体的な処理例として、図3の構造化文書を例にとり説明する。
本処理例では、図3の構造化文書a(301)と構造化文書a’(302)の差分を抽出して、図6のようなSGML形式で記述された構造化差分データを出力し、その結果を表示、保存することを目的としている。
構造化文書の差分データとしては、構造自体の変更と構造中の文字列の変更の場合があるため、図6では、次のように差分の構造情報を記述している。
すなわち、構造自体の変更は、その構造を示すタグにdiffflagという属性を持たせて構造の変更を表現し、構造中の文字列の変更は、差分を表すタグでその文字列を挟んで表現している。
図6の例では、“<所属>ABC会社</所属>”という構造自体の挿入を“<所属 diffflag=挿入>ABC会社</所属>”というSGML形式で記述している。
また、構造中の文字列の変更は、<挿入>,<変更前>,<変更後>などの差分を表すタグでその文字列を挟んで記述している。
このdiffflagという属性名やその属性値、および文字列の差分を表すタグ等は、任意に決めることができる。
【0016】
図2のフローチャートに従って、処理例を説明する。
〈ステップ201〉
文書編集プログラム104で、構造化文書の編集を行う。図3(a)の構造化文書a(301)から図3(b)の構造化文書a’(302)を編集したとする。
〈ステップ202〉
編集前後の構造化文書間の変更箇所を表示したり、保存したりするために、文書版管理プログラム105が呼び出されたら、比較対象であるSGML文書のDTD(文書型定義)に対応した、差分DTDを読み込む。存在しない場合は、差分文書型定義生成プログラム111で対応する差分DTDを生成する。
【0017】
例えば、図3の構造化文書は図7のようなDTDを持つ。すなわち、図3の構造化文書は、図7のDTDの定義に従って書かれている。図7のDTDは、それぞれ次のような意味を定義している。
まず、701の一行は、<メモ>という構造は、<発信者>および<本文>という、二つの子構造を持つことを定義している。
702の一行は、<発信者>という構造は、<氏名>および<所属>という、二つの子構造を持つことを定義している。
また、“所属”の後ろにある“?”は出現指示子の一つで、<所属>という構造は文書中に現われる回数が0回または1回であるという意味を表す(“?”以外にも出現指示子として“*”と“+”があり、それぞれ出現指標子の付いている構造の現れる回数が0回以上および1回以上という意味を表す)。
703、704、705はそれぞれ、<氏名>,<所属>,<本文>という構造は文字列データ(#PCDATA)を持つことを定義している。
【0018】
この比較する構造化文書のDTDから、差分文書型定義生成プログラム111で対応する差分DTDを生成する。
この差分DTDは、元のDTDに対して、差分文書型定義生成ルールを適用することにより生成される。
差分文書型定義生成ルールの例を図9に示す。
図7のDTDに対し、図9の差分文書型定義生成ルール(900)を適用すると図8の差分DTDが生成される。
【0019】
図9の差分文書型定義生成ルールは次のようなルールで構成される。
項番1(901)、2(902)のルールは、元のDTDでは文字データとして定義されている箇所に、文字列の変更情報として<挿入>、<削除>、<変更前>、<変更後>という差分を表すタグが挿入できるように、DTDを変更している。
すなわち、構造中の文字列が変更された時に、その文字列を<挿入>、<削除>、<変更前>、<変更後>というタグで挟むための定義である。
項番3(903)のルールは、元のDTDで定義されている構造のうち、最上位の構造以外には、その構造の属性としてdiffflagを持つよう、DTDを変更している。
すなわち、構造自体が変更された時に、その構造に差分を表す属性をつけるための定義である。diffflag属性は、“NULL”、“挿入”、“削除”、“変更前”、“変更後”いずれかの値を持つ。
また、diffflagが省略された場合は、構造の変更がなかったという意味で、“NULL”という値が与えられる。
項番4(904)のルールは、元のDTDで定義されている構造の出現指示子を変更する。
出現指示子はその構造の出現回数を表すもので、“?”は現れる回数が0回または1回であること、“*”は現れる回数が0回または1回以上であること、“+”は現れる回数が1回以上であること、出現指示子がない場合は現れる回数が必ず1回であることを意味している。
差分DTDでは、変更のなかった構造は差分データに含めないことが可能となるよう、構造が現れる回数が0回であることを許すように、DTDを変更している。
【0020】
図7のDTDに対し、この差分文書型定義生成ルール(900)を適用すると図8の差分DTDが生成される。
例えば、項番1(901)のルールにより、図8の801が挿入される。
項番2(902)のルールにより、図7の703,704,705が図8の804,805,806に置き換えられる。
項番3(903)のルールにより、図8の807が挿入される。項番4(904)のルールにより、図7の701,702の出現指示子がそれぞれ置き換えられ、図8の802,803となる。
このように図9のルールを用いて生成した、図8の差分DTDは、図6の差分データを表す文書型定義となっている。
【0021】
〈ステップ203〉
比較対象である図3(a)の構造化文書a(301)と図3(b)の構造化文書a’(302)を2次記憶装置103から文書読込プログラム106によって読み込む。
〈ステップ204〉
構造化文書の論理構造を構造解析プログラム107によって解析する。
図3の構造化文書(a)および(b)を解析すると、図10の文書木(a)と(b)が得られる。
文書木とは、文書の論理構造を表す木構造のことで、木構造の根には、SGML文書の最上位ELEMENTが割り当てられ、木構造の末端に構造中の文字列が割り当てられる。
【0022】
〈ステップ205〉
ステップ204で得られた論理構造情報に基づいて、構造化文書間の差分を構造化文書差分抽出プログラム108によって抽出する。
構造化文書間の差分抽出は次のように行なう。
まず、ステップ204で得られた文書木のノードを単位に差分を抽出する。これは、文書木のノードは文書の構造単位になっているため、構造を単位に差分を抽出することと等価である。
文書木間で同じ構造名や文字列を持つノードは、一致しているとして対応づける。
次に、対応づけられなかったノードを今度は文字を単位に差分抽出する。
例えば、図10の文書木(a)と(b)のノードを単位に差分を抽出すると、“<メモ>”,“<発信者>”,“<氏名>”,“<本文>”が一致しているとして対応づけられる。
次に、対応づけられなかったノードを今度は文字を単位に差分抽出する。
“平成太郎”と“昭和次郎”を文字単位で差分抽出すると一致する文字はないので、構造中の文字列の変更箇所として抽出される。
“<所属>”および“ABC会社”は挿入として抽出される。“<所属>”は構造を表すノードなので、構造自体の変更として抽出される。
また、“こんにちは。”と“こんにちは。お元気ですか?”を文字単位で差分抽出すると“お元気ですか?”が文字列の変更箇所として抽出される。
その結果、図11ような論理構造をもった差分データが得られる。
【0023】
〈ステップ206〉
構造化差分情報出力プログラム109により、ステップ205で抽出された変更情報を、ステップ202で取得した差分DTDに従いSGML形式で記述し、構造化差分情報として出力する。
図8の差分DTDに従い、図11の変更情報をSGML形式で出力すると、図6の構造化差分データが得られる。この構造化差分データは、変更情報に対して、差分データの構造化表現ルールを適用することで生成される。
差分データの構造化表現ルールの例を図12に示す。
1201が構造自体の変更を、1202が構造中の文字列の変更を記述するためのルールの例である。
すなわち、構造自体の変更は、その構造を示すタグにdiffflagという属性を持たせて構造の変更を表現し、構造中の文字列の変更は、<挿入>,<変更前>,<変更後>などの差分を表すタグでその文字列を挟んで表現する。
このdiffflagという属性名やその属性値、および文字列の差分を表すタグ等は、任意に決めることができる。
【0024】
〈ステップ207〉
表示・保存プログラム110により、端末装置102に差分結果の表示を行い、2次記憶装置103に構造化差分データを保存する。
差分データがSGML形式で出力されているため、差分データの表示にSGML専用のエディタや、ビューアを使って、そのまま表示することができる。
図13にSGML専用エディタを使った、構造化文書の表示例および、図14に差分データの表示例を示す。
図13の1301は構造を表示するウィンドウで、1302がその構造中の文字列を表示するウィンドウである。
図14では、図6の差分データを構造化表示している例である。
この際、構造自体の変更箇所は、構造を表すマークの色を変える、種類を変える、太線で囲む等、構造の表示を他とは区別して表示する。また、文字列の変更箇所は、同様に、他の文字列と区別して表示する。
【0025】
以上のステップにより、構造化文書間の変更箇所を抽出し、構造化差分データとして出力することが可能となる。
これにより、本方式を文書比較機能としてSGML文書編集ソフトに組み込むことで、差分データを直接構造化表示することが可能となり、例えば、構造自体の変更と構造中の文字列の変更を区別したりすることで、文書編集ソフト等でこの構造化文書を編集しているユーザにとって、どんな変更が行われたのか分かり易くすることができる。
また、文書編集ソフト等が、構造化文書を表示する際に構造情報をtreeで表すなど専用の表示プログラムを用いる場合でも、別の表示プログラムを必要とせず変更箇所を表示することが可能となる。
【0026】
《実施例2》
二番目の実施例の構成を図15に示す。
図示したように、本実施例は、それぞれ、CPU1501、端末装置1502、文書を記憶するための2次記憶装置1503と、文書の版管理を行う文書版管理プログラム1504で構成され、
さらに文書版管理プログラム1504は、
文書を2次記憶装置1503から取り出す文書取出プログラム1505、
文書を2次記憶装置1503に登録する文書登録プログラム1506、
構造化文書間の変更箇所を論理構造情報に基づいて抽出し、構造化差分データとして出力する差分抽出プログラム1507、
出力された構造化差分データを表示、編集する表示・編集プログラム1508から構成される。
【0027】
本実施例の具体的な処理手順を、図16のフローチャートを用いて説明する。
〈ステップ1601〉
表示・編集プログラム1508により、構造化文書を編集する。
〈ステップ1602〉
編集した構造化文書を登録するために、文書版管理プログラム1504が呼び出されたら、まず、その文書が新規文書であれば、文書登録プログラム1506により2次記憶装置1503に文書全体を保存し、バージョン1.0(V1.0)として登録する。
〈ステップ1603〉
新規文書でなければ、2次記憶装置1503に登録されているV1.0の文書を文書取出プログラム1505により読み込む。
V1.0文書と登録する文書を差分抽出プログラム1507により比較し、SGML形式で記述した構造化差分データを生成する。
この構造化差分データの生成には、実施例1の方式を用いる。
【0028】
〈ステップ1604〉
ステップ1603で生成された構造化差分データを、文書登録プログラム1506により2次記憶装置1503に新規バージョンとして登録する。
〈ステップ1605〉
任意のバージョンの文書を表示、編集するために、文書取出プログラム1505が呼び出された場合、V1.0の文書の取出しなら、2次記憶装置1503からV1.0の文書を読み込む。
〈ステップ1606〉
V1.0以外の文書の取出しなら、文書取出プログラム1505により2次記憶装置1503から、V1.0の文書とその指定されたバージョンの差分データを読み込み、そのバージョンの文書を合成する。
〈ステップ1607〉
編集が終了していなければ、ステップ1601へ戻る。
【0029】
(処理例)
実施例の具体的な処理例として、図17の構造化文書を例にとり説明する。
表示・編集プログラム1508により、図17(a)の構造化文書b(V1.0)を作成し、文書登録プログラム1506により2次記憶装置1503に文書をV1.0として登録したとする。
次に構造化文書bを編集するために、文書取出プログラム1505によりV1.0を読み込む。構造化文書bを編集して、図17(b)の構造化文書b’に変更する。
この文書をバージョン2.0(V2.0)として登録するために文書登録プログラム1506を呼び出す。
新規文書ではないので、2次記憶装置1503に登録されているV1.0の文書を取り出し、差分抽出プログラム1507によりV1.0の文書とV2.0の文書を比較し、図18の構造化差分データを生成する。
生成された構造化差分データを、文書登録プログラム1506により登録する。
【0030】
V2.0の取出しが指定された場合は、文書取出プログラム1505により、まず、図17(a)V1.0と図18のV2.0に対応する構造化差分データを読み込む。これらから、V2.0の文書を合成する。
合成は次のように行う。
まず、V1.0の文書のうち、構造化差分データに対応する構造を差分データで置き換える。置き換えたものを図19の1901に示す。
次に、<変更前>,<削除>タグで挟まれた文字列、およびdiffflag属性値が“変更前”,“削除”の構造は削除する。さらに、差分を表すタグや属性をすべて削除する。
これにより、図19の1902ようなV2.0の文書が再現される。
【0031】
なお本実施例では、V1.0の文書を基準文書としてバージョン管理を行なっているが、最新文書を基準文書としても、同様の方式でバージョン管理することができる。
以上の方式により、基準となるバージョンの文書を一つ保存し、他のバージョンの文書に関しては、基準の文書との差分情報のみ保存するだけで、文書の任意のバージョンを取り出す機能が実現が容易に実現できる。本方式は、長大な文書の一部を変更した場合などに、バージョン管理のデータ量が少なくなるため、特に有効な方式であることが分かる。
【0032】
【発明の効果】
本発明によれば、編集前後の文書間の変更箇所を構造化された差分データとして抽出することができ、差分データをSGML文書編集ソフト等で直接構造化表示することが可能となる。
これにより、構造自体の変更と構造中の文字列の変更を区別して表示したりすることができ、文書編集ソフト等でこの構造化文書を編集しているユーザにとって、どんな変更が行われたのか分かり易くすることが可能となるため、構造化文書の編集作業の効率が上がる。
また、文書編集ソフト等が、構造化文書を表示する際に構造情報をtreeで表すなど専用の表示プログラムを用いる場合でも、別の表示プログラムを必要とせず変更箇所を表示することができるため、構造化文書専用の文書編集ソフト等に文書比較機能を組み込むことが容易に実現できる。
また、本発明によって出力された構造化差分データは、SGML専用のビューアを使って直接構造化表示することができるので、新たに改訂履歴ビューア等を作成することなく、改訂履歴データを閲覧することが可能となる。
さらに、本発明によれば、基準となるバージョンの文書を一つ保存し、他のバージョンの文書に関しては、基準の文書との差分情報を保存するだけですむため、文書の任意のバージョンを取り出す機能が容易に実現でき、長大な文書の一部を変更した場合や文書を頻繁に変更した場合など、バージョン管理のデータ量を少なくすることが可能となる。
【図面の簡単な説明】
【図1】本発明の第一の実施例の構成図である。
【図2】本発明の第一の実施例の処理手順を示す図である。
【図3】第一の実施例を説明するための構造化文書の第一の例を示す図である。
【図4】構造化文書の第一の例を差分抽出した差分データ例、および従来の方式により差分データを表示した表示例を示す図である。
【図5】構造化文書と文書型定義の関係を説明する図である。
【図6】構造化文書の第一の例を構造化差分抽出して出力した構造化差分データ例を示す図である。
【図7】構造化文書の第一の例の文書型定義の例を示す図である。
【図8】構造化文書の第一の例の文書型定義より生成した差分文書型定義の例を示す図である。
【図9】構造化文書の文書型定義より差分文書型定義を生成するためのルールを示す図である。
【図10】構造化文書の第一の例から作成した文書木を示す図である。
【図11】構造化文書の第一の例を構造化差分抽出した結果の文書木を示す図である。
【図12】構造化差分抽出した差分データを構造化差分データとして出力するための構造化表現ルールの例を示す図である。
【図13】構造化文書の第一の例の表示例である。
【図14】構造化文書の第一の例の構造化差分データの表示例である。
【図15】本発明の第二の実施例の構成図である。
【図16】本発明の第二の実施例の処理手順を示す図である。
【図17】第二の実施例を説明するための構造化文書の第二の例を示す図である。
【図18】構造化文書の第二の例の構造化差分データ例を示す図である。
【図19】構造化文書の第二の例の基準文書と構造化差分データを合成する手法を説明するための図である。
【符号の説明】
101 CPU
102 端末装置
103 2次記憶装置
104 文書編集プログラム
105 文書版管理プログラム
106 文書読込プログラム
107 構造解析プログラム
108 構造化文書差分抽出プログラム
109 構造化差分情報出力プログラム
110 文書表示・保存プログラム
111 差分文書型定義生成プログラム
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a method and an apparatus for managing a version of a structured document in a document processing apparatus such as a word processor that handles a structured document stored as an electronic file.
[0002]
[Prior art]
Version management refers to managing document information of each version so that an arbitrary version of the document can be stored and retrieved when editing and updating the document. The saved version of the document is also used to extract and display a changed portion between versions in order to efficiently edit the document.
2. Description of the Related Art Conventionally, two methods have been adopted for document version management.
The first is a simple version management method (conventional method 1) in which all versions of a document are stored and managed so that a designated version of the document is taken out as it is. Second, one document of the reference version, such as the original document or the latest document, is stored. For other versions of the document, only the difference information from the reference document is stored. When a document is taken out, a difference version management method (conventional method 2) is used in which a document of the version is managed from a reference document and difference information.
Further, in recent years, for the purpose of efficient sharing and reuse of document information, a movement to structure and create and use a document using SGML or the like has been activated.
The structured document can clearly describe information on the logical structure of the document, for example, information such as “this part in the document is a title” and “this part is a chapter”. For this reason, since changes and additions can be easily and reliably performed in detail, they are frequently used for editing documents such as manuals that are frequently updated.
[0003]
If the two conventional methods are used for managing the version of the structured document, the following problem occurs.
First, the conventional method 1 is not limited to the case of structured documents, but all documents of each version must be stored. Therefore, when frequent updates occur, the capacity of the document database increases. Problem arises.
Next, the conventional method 2 can avoid the problem of the conventional method 1 that the capacity of the document database becomes huge, but cannot manage the difference information that distinguishes the logical structure of the document. There is a problem that it is not known whether the document has been changed, the advantage that the document is structured and created cannot be used, and efficient document editing cannot be performed.
On the other hand, Japanese Patent Application Laid-Open No. Hei 7-200370 (conventional method 3) discloses a version management method for holding a document of each version for a structured document and displaying a changed portion.
Although the difference of the structure information is certainly extracted and displayed as difference data in this method, it is difficult to tell whether the structure itself or the contents of the structure have been changed because the difference display method is uniform. However, there is a problem that efficient editing cannot be performed.
[0004]
[Problems to be solved by the invention]
The difference data obtained by extracting the changed part between the structured documents before and after editing has the following characteristics, unlike the case of comparing a normal document having no structure.
(1) There is a change in the structure itself and a change in the character string in the structure.
(2) The difference information also has a logical structure.
This will be described by taking the structured document of FIG. 3 as an example.
The structured document in FIG. 3 is a SGML (Standard Generalized Markup Language).
It is described in (ISO8879) and means that a character string sandwiched between <A> and </A> belongs to the logical structure <A>.
The mark representing the logical structure is called a tag, and <A> and </A> are called a start tag and an end tag, respectively. Further, each structure is called an ELEMENT (element).
In the example of the structured document a shown in FIG. 3A, a character string "Heisei Taro" sandwiched between <name> and </ name> belongs to the logical structure <name>.
Also, the existence of <B> and </ B> between <A> and </A> indicates that the logical structure
This means that <B> is a child structure of the logical structure <A>. For example, in FIG. 3A, since <name> and </ name> exist between <sender> and </ sender>, <name> represents a child structure of <sender>.
FIG. 4A shows an example of the result of comparison between the structured document a before editing and the structured document a ′ after editing in FIG.
Item No. 1 (401) and Item No. 3 (403) are examples in which the structure of the document such as <name> and <body> does not change and the character strings in the structure are changed. Item number 2 (402) is an example in which the structure itself <affiliation> is newly inserted.
Next, an example will be described in which difference information between structured documents has a logical structure.
For example, item numbers 1 (401) and 3 (403) are character string changes, and these character string changes are changes in the structure of <name> and <body>, respectively. As described above, in order to specify the structure and represent the difference information, it is necessary to have the structure information as the difference data. In item number 2 (402), the inserted
<Affiliation> has structural information that it is a child structure of <Sender>.
[0005]
However, according to the conventional method, it is not possible to effectively display the characteristics of the difference data of such a structured document.
In the conventional method 3, even if the changed portion is a change in information relating to the logical structure of the document, the display attribute of the character representing the structure is similarly changed without being distinguished from a change in the character string.
For this reason, there is a problem that it is difficult for the user to determine whether the structure itself or the content of the structure has been changed.
This problem will be described with a specific example.
FIG. 4B shows an example of the display of the difference data according to the conventional method 3.
In this figure, the display method is such that the structure information is ignored without distinguishing between the change of the structure itself and the change of the character string in the structure. For this reason, it is difficult for a user who is editing this structured document using document editing software or the like to know what changes have been made.
In addition, when the document editing software or the like uses a dedicated display program such as displaying the structure information as a tree when displaying the structured document, another display program is required to display the difference data as shown in FIG. Therefore, the program becomes complicated.
[0006]
Further, in order to realize a function of storing and retrieving an arbitrary version of a document, if all the documents of each version are stored as in the conventional method 1, the amount of data to be stored increases, and the version is frequently updated. It is not suitable as a version control method for documents.
Therefore, as a version management method for structured documents that are frequently revised, one standard version of the document, such as the original document or the latest document, is stored, and other versions of the document are stored as the standard document. When only the difference information is stored and the specified version of the document is extracted, a method such as the conventional method 2 is used in which the document of the version is synthesized from the reference document and the difference information. However, there is a problem that version management cannot be performed based on a comparison in which the logical structure of a document targeted for a structured document is distinguished.
[0007]
SUMMARY OF THE INVENTION An object of the present invention is to solve such problems, and to prevent a document database from having a large capacity when managing a version of a document which is frequently updated, such as a document described using SGML or the like. At the same time, it is possible to manage differences that distinguish the logical structure of the document, and to easily specify whether the logical structure itself or its contents have been changed, so that efficient document editing that takes advantage of the characteristics of structured documents can be performed. To provide a version control method for structured documents.
[0008]
[Means for Solving the Problems]
In order to achieve the above object, the present invention provides
A processing device that performs editing, such as deletion, insertion, or modification, on a structured document described in SGML (Standard Generalized Markup Language) and defined as a document type, and a storage device that stores the structured document before and after the editing. A version management method for a structured document that manages both the structured document before and after the editing by the processing device,
A document reading step of reading a structured document before and after editing from the storage device, a structure analyzing step of analyzing a logical structure of both structured documents acquired in the reading step, and a logic obtained by the structure analyzing step. A structured document difference extraction step of extracting a change portion between the two documents before and after the editing based on the structure information, and a structure outputting the change information obtained in the difference extraction step as structured description difference information A difference information output step and a step of displaying and storing the output structured difference information are provided.
Further, a difference document type definition generating step of generating a document type definition for structured difference information from the document type definition of the structured document from which the difference is to be extracted is provided.
Further, when storing a plurality of editions of a structured document before and after editing in the storage device, only a reference document is stored, and a document other than the reference is a document storing only structured difference information from the reference document. It has a registration step.
Further, when a structured document of a specified version is taken out from the storage device, a reference document is taken out as it is, and as for a document other than the reference, a document obtained by extracting structured document and differential information and combining the designated version It has an extraction step. Further, the display step in the step of displaying and storing the output structured difference information includes displaying a structure window for displaying a structure on a display screen and a character string window for displaying a character string in the structure. In the character string window, the display of the character strings before and after editing and the display of instructing the addition and deletion of the character strings are displayed. It is performed at a position corresponding to the display position of the structure before and after editing in the window.
[0009]
In addition, the storage device includes a storage device and a processing device, and performs editing such as deletion, insertion, or change by the processing device on the structured document described in SGML and defining the document type. In a structured document version management device that stores a structured document and manages both the structured document before and after the editing by the processing device,
The processing device includes: a document reading unit that reads a structured document before and after editing from the storage device; a structured document analysis unit that analyzes a logical structure of both structured documents acquired by the document reading unit; Based on the logical structure information obtained by the structure analyzing means, a structured document difference extracting means for extracting a changed portion between the structured documents before and after the editing, and a change information obtained by the difference extracting means are structured. Structured difference information output means for outputting as described difference information and means for displaying and storing the output structured difference information are provided.
Further, a difference document type definition generating means for generating a document type definition for structured difference information from the document type definition of the structured document from which the difference is extracted is provided.
Further, when storing a plurality of editions of a structured document before and after editing in the storage device, only a reference document is stored, and a document other than the reference is a document storing only structured difference information from the reference document. It has registration means.
Further, when extracting the structured document of the specified version from the storage device, the reference document is extracted as it is, and for documents other than the standard, the difference information structured with the reference document is extracted and the specified version of the document is synthesized. A take-out means is provided.
Further, the means for displaying and storing the output structured difference information includes displaying a structure window for displaying the structure on the display screen and a character string window for displaying a character string in the structure, and editing the structure window in the structure window. The display of the structure before and after, and the display for instructing the addition and deletion of the structure, and the like, and the display of the character string before and after editing and the display for instructing the addition and deletion of the character string are displayed in the character window. Display means is provided for performing the display at a position corresponding to the display position of the structure before and after editing.
[0010]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, embodiments of the present invention will be described.
[0011]
<< Example 1 >>
FIG. 1 shows the configuration of the first embodiment.
As shown in the figure, the present embodiment has a CPU 101, a terminal device 102, a secondary storage device 103 for storing documents, a document editing program 104 for editing documents, and a document version for managing documents before and after editing. It is composed of a management program 105,
Further, the document version management program 105
A document reading program 106 for reading a structured document before and after editing from the secondary storage device 103;
A structural analysis program 107 for analyzing the logical structure of both read structured documents, a structured document difference extraction program 108 for extracting a change between the two documents before and after editing based on the obtained logical structure information,
A structured difference information output program 109 for outputting change information as structured description difference information,
A display / save program 110 for displaying and saving the output structured difference information;
The difference document type definition generation program 111 generates a document type definition for difference data from the document type definition of the structured document to be compared.
[0012]
In the present embodiment, an SGML document is taken as an example of the structured document.
SGML is a document description language defined as an international standard of ISO as a marked structured document. The logical structure of an SGML document is defined in advance by a DTD (document type definition).
In the SGML document, a document instance, which is the content of the actual document, is described so as to follow the logical structure defined in the DTD. That is, as shown in FIG. 5, the document instance and the document type definition are combined to form a structured document.
[0013]
A specific processing procedure of the present embodiment will be described with reference to the flowchart of FIG.
Thereafter, a processing example will be described according to the processing procedure.
<Step 201>
The structured document is edited by the document editing program 104.
[0014]
<Step 202>
When the document version management program 105 is called to display or save a changed portion between structured documents before and after editing, first, a DTD for difference data corresponding to the DTD of the SGML document to be compared is used. To get.
The DTD for the difference data is used as a document type definition for describing change information between structured documents in an SGML format in step 206 described later.
If the corresponding difference DTD exists, it is read from the secondary storage device 103, and if not, the corresponding difference DTD is generated by the difference document type definition generation program 111.
<Step 203>
The SGML document to be compared is read from the secondary storage device 103 by the document reading program 106.
<Step 204>
As preprocessing for difference extraction, the logical structure of two structured documents to be compared is analyzed by the structure analysis program 107.
<Step 205>
Based on the logical structure information obtained in step 204, a difference between structured documents is extracted by the structured document difference extraction program 108.
<Step 206>
The structured difference information output program 109 describes the change information extracted in step 205 in the SGML format according to the difference DTD acquired in step 202, and outputs it as structured difference information.
<Step 207>
The display / save program 110 displays the difference result on the terminal device 102, and saves the structured difference data in the secondary storage device 103.
[0015]
(Example of processing)
As a specific processing example of the embodiment, the structured document of FIG. 3 will be described as an example.
In this processing example, the difference between the structured document a (301) and the structured document a ′ (302) in FIG. 3 is extracted, and structured difference data described in the SGML format as shown in FIG. The purpose is to display and save the results.
Since the difference data of the structured document may be a change in the structure itself or a change in a character string in the structure, FIG. 6 describes the difference structure information as follows.
In other words, a change in the structure itself is expressed by giving a tag indicating the structure an attribute of diffflag, and a change in a character string in the structure is expressed with a tag representing a difference sandwiching the character string. ing.
In the example of FIG. 6, the insertion of the structure "<affiliation> ABC company </ affiliation>" itself is described in the SGML format "<affiliation difflag = insert> ABC company </ affiliation>".
Further, the change of the character string in the structure is described with a tag indicating a difference such as <insert>, <before change>, <after change>, etc., sandwiching the character string.
The attribute name “difflag”, its attribute value, a tag indicating the difference between character strings, and the like can be arbitrarily determined.
[0016]
An example of the process will be described with reference to the flowchart of FIG.
<Step 201>
The structured document is edited by the document editing program 104. It is assumed that the structured document a ′ (302) in FIG. 3B is edited from the structured document a (301) in FIG.
<Step 202>
When the document version management program 105 is called to display or save a change between structured documents before and after editing, a difference corresponding to the DTD (document type definition) of the SGML document to be compared is obtained. Read the DTD. If not present, the difference document type definition generation program 111 generates a corresponding difference DTD.
[0017]
For example, the structured document of FIG. 3 has a DTD as shown in FIG. That is, the structured document of FIG. 3 is written according to the definition of the DTD of FIG. The DTD in FIG. 7 defines the following meanings.
First, one line of 701 defines that the structure <memo> has two child structures <sender> and <body>.
One line of 702 defines that the structure <sender> has two child structures <name> and <affiliation>.
“?” After “affiliation” is one of the appearance indicators, and the structure “<affiliation>” means that the number of occurrences in the document is 0 or 1 (in addition to “?”). Also have "*" and "+" as appearance indicators, which indicate that the number of appearances of the structure with the appearance indicator is 0 or more and 1 or more, respectively).
Reference numerals 703, 704, and 705 respectively define that the structure of <name>, <affiliation>, and <body> has character string data (#PCDATA).
[0018]
From the DTD of the structured document to be compared, a corresponding difference DTD is generated by the difference document type definition generation program 111.
This difference DTD is generated by applying a difference document type definition generation rule to the original DTD.
FIG. 9 shows an example of the difference document type definition generation rule.
When the difference document type definition generation rule (900) in FIG. 9 is applied to the DTD in FIG. 7, the difference DTD in FIG. 8 is generated.
[0019]
The difference document type definition generation rule in FIG. 9 is configured by the following rules.
The rules of item numbers 1 (901) and 2 (902) are as follows: <insert>, <delete>, <before change>, <change The DTD is changed so that a tag representing the difference of "after" can be inserted.
That is, when a character string in the structure is changed, the definition is such that the character string is sandwiched between tags <insert>, <delete>, <before change>, and <after change>.
The rule of item number 3 (903) changes the DTD so that the structure other than the highest-level structure among the structures defined in the original DTD has a difflag as an attribute of the structure.
That is, when the structure itself is changed, this is a definition for adding an attribute indicating a difference to the structure. The diffflag attribute has a value of “NULL”, “insert”, “delete”, “before change”, or “after change”.
If the diffflag is omitted, a value of “NULL” is given, meaning that the structure has not been changed.
The rule of item number 4 (904) changes the appearance indicator of the structure defined in the original DTD.
The appearance indicator indicates the number of appearances of the structure. "?" Means that the number of appearances is 0 or 1, "*" means that the number of appearances is 0 or 1 or more, and "+" Means that the number of appearances is one or more, and when there is no appearance indicator, the number of appearances is always one.
In the difference DTD, the DTD is changed so as to allow a structure that has not been changed to be included in the difference data so that the number of appearances of the structure is zero.
[0020]
When this difference document type definition generation rule (900) is applied to the DTD of FIG. 7, the difference DTD of FIG. 8 is generated.
For example, 801 in FIG. 8 is inserted according to the rule of item number 1 (901).
According to the rule of item number 2 (902), 703, 704, and 705 in FIG. 7 are replaced with 804, 805, and 806 in FIG.
8 is inserted according to the rule of item number 3 (903). According to the rule of the item number 4 (904), the appearance indicators 701 and 702 in FIG. 7 are respectively replaced with 802 and 803 in FIG.
The difference DTD of FIG. 8 generated using the rule of FIG. 9 is a document type definition representing the difference data of FIG.
[0021]
<Step 203>
The structured document a (301) in FIG. 3A and the structured document a ′ (302) in FIG. 3B to be compared are read from the secondary storage device 103 by the document reading program 106.
<Step 204>
The logical structure of the structured document is analyzed by the structure analysis program 107.
When the structured documents (a) and (b) of FIG. 3 are analyzed, the document trees (a) and (b) of FIG. 10 are obtained.
The document tree is a tree structure representing the logical structure of the document. The root of the tree structure is assigned the highest ELEMENT of the SGML document, and the character string in the structure is assigned to the end of the tree structure.
[0022]
<Step 205>
Based on the logical structure information obtained in step 204, a difference between structured documents is extracted by the structured document difference extraction program 108.
Difference extraction between structured documents is performed as follows.
First, a difference is extracted for each node of the document tree obtained in step 204. This is equivalent to extracting a difference in units of the structure, since the node of the document tree is a unit of the structure of the document.
Nodes having the same structure name or character string in the document trees are associated with each other as being identical.
Next, a difference extraction is performed on the nodes that have not been associated with each other in units of characters.
For example, when a difference is extracted for each node of the document trees (a) and (b) in FIG. 10, “<memo>”, “<sender>”, “<name>”, and “<body>” It is corresponded as having done.
Next, a difference extraction is performed on the nodes that have not been associated with each other in units of characters.
When “Heisei Taro” and “Showa Jiro” are difference-extracted on a character-by-character basis, there is no matching character, so that it is extracted as a changed part of the character string in the structure.
“<Affiliation>” and “ABC company” are extracted as insertions. Since “<affiliation>” is a node representing a structure, it is extracted as a change in the structure itself.
In addition, "Hello." And "Hello. How are you?" A character-by-character and the difference extraction "How are you?" Is extracted as part of the change strings.
As a result, difference data having a logical structure as shown in FIG. 11 is obtained.
[0023]
<Step 206>
The structured difference information output program 109 describes the change information extracted in step 205 in the SGML format according to the difference DTD acquired in step 202, and outputs it as structured difference information.
When the change information in FIG. 11 is output in the SGML format according to the difference DTD in FIG. 8, the structured difference data in FIG. 6 is obtained. The structured difference data is generated by applying a structured expression rule of the difference data to the change information.
FIG. 12 shows an example of the structured expression rule of the difference data.
1201 is an example of a rule for describing a change in the structure itself, and 1202 is an example of a rule for describing a change in a character string in the structure.
That is, the change of the structure itself is expressed by giving a tag indicating the structure an attribute called diffflag, and the change of the character string in the structure is performed by <insert>, <before change>, <after change> It is expressed with the character string sandwiched by a tag representing the difference such as.
The attribute name “difflag”, its attribute value, a tag indicating the difference between character strings, and the like can be arbitrarily determined.
[0024]
<Step 207>
The display / save program 110 displays the difference result on the terminal device 102, and saves the structured difference data in the secondary storage device 103.
Since the difference data is output in the SGML format, the difference data can be displayed as it is by using an editor or a viewer dedicated to SGML.
FIG. 13 shows a display example of a structured document using an SGML dedicated editor, and FIG. 14 shows a display example of difference data.
Reference numeral 1301 in FIG. 13 denotes a window for displaying a structure, and 1302 denotes a window for displaying a character string in the structure.
FIG. 14 shows an example in which the difference data of FIG. 6 is structured and displayed.
At this time, the changed portion of the structure itself is distinguished from the others by changing the color of the mark representing the structure, changing the type, enclosing the mark with a thick line, and the like. In addition, similarly, the changed part of the character string is displayed while being distinguished from other character strings.
[0025]
Through the above steps, it is possible to extract a changed portion between structured documents and output the changed portion as structured difference data.
By incorporating this method into the SGML document editing software as a document comparison function, difference data can be directly displayed in a structured manner. For example, a change in the structure itself and a change in a character string in the structure can be distinguished. By doing so, it is possible for a user who is editing this structured document using document editing software or the like to easily understand what changes have been made.
Further, even when the document editing software or the like uses a dedicated display program such as displaying the structure information in a tree when displaying the structured document, it is possible to display the changed portion without requiring another display program. .
[0026]
<< Example 2 >>
FIG. 15 shows the configuration of the second embodiment.
As shown in the figure, the present embodiment includes a CPU 1501, a terminal device 1502, a secondary storage device 1503 for storing a document, and a document version management program 1504 for managing a version of a document.
Further, the document version management program 1504
A document retrieval program 1505 for retrieving a document from the secondary storage device 1503;
A document registration program 1506 for registering a document in the secondary storage device 1503;
A difference extraction program 1507 for extracting a changed portion between structured documents based on the logical structure information and outputting it as structured difference data;
It comprises a display / edit program 1508 for displaying and editing the output structured difference data.
[0027]
A specific processing procedure of the present embodiment will be described with reference to the flowchart of FIG.
<Step 1601>
The structured document is edited by the display / edit program 1508.
<Step 1602>
When the document version management program 1504 is called to register the edited structured document, first, if the document is a new document, the entire document is stored in the secondary storage device 1503 by the document registration program 1506, and the version is updated. Register as 1.0 (V1.0).
<Step 1603>
If it is not a new document, the document retrieval program 1505 reads a V1.0 document registered in the secondary storage device 1503.
The V1.0 document and the document to be registered are compared by the difference extraction program 1507 to generate structured difference data described in the SGML format.
The method of the first embodiment is used to generate the structured difference data.
[0028]
<Step 1604>
The structured difference data generated in step 1603 is registered as a new version in the secondary storage device 1503 by the document registration program 1506.
<Step 1605>
When the document retrieval program 1505 is called to display and edit an arbitrary version of the document, the V1.0 document is read from the secondary storage device 1503 to retrieve the V1.0 document.
<Step 1606>
If a document other than V1.0 is to be fetched, the document fetching program 1505 reads the difference data of the V1.0 document and the specified version from the secondary storage device 1503, and synthesizes the document of that version.
<Step 1607>
If the editing has not been completed, the process returns to step 1601.
[0029]
(Example of processing)
As a specific processing example of the embodiment, a structured document in FIG. 17 will be described as an example.
It is assumed that the structured document b (V1.0) shown in FIG. 17A is created by the display / edit program 1508, and the document is registered in the secondary storage device 1503 as V1.0 by the document registration program 1506.
Next, V1.0 is read by the document retrieval program 1505 in order to edit the structured document b. The structured document b is edited and changed to the structured document b ′ in FIG.
The document registration program 1506 is called to register this document as version 2.0 (V2.0).
Since the document is not a new document, the document of V1.0 registered in the secondary storage device 1503 is taken out, the document of V1.0 is compared with the document of V2.0 by the difference extraction program 1507, and the structured difference shown in FIG. Generate data.
The generated structured difference data is registered by the document registration program 1506.
[0030]
When extraction of V2.0 is specified, first, structured difference data corresponding to V1.0 in FIG. 17A and V2.0 in FIG. 18 is read by the document extraction program 1505. From these, a V2.0 document is synthesized.
Synthesis is performed as follows.
First, in the V1.0 document, the structure corresponding to the structured difference data is replaced with the difference data. The replacement is shown in 1901 in FIG.
Next, the character string sandwiched between the <before change> and <delete> tags and the structure with the difflag attribute value of “before change” and “delete” are deleted. Further, all the tags and attributes representing the differences are deleted.
As a result, a V2.0 document such as 1902 in FIG. 19 is reproduced.
[0031]
In this embodiment, version control is performed using a V1.0 document as a reference document, but version control can be performed in the same manner even when the latest document is used as a reference document.
According to the above method, it is easy to realize the function to save one document of the reference version and save only the difference information from the reference document for other versions of the document. Can be realized. This method is particularly effective because the amount of data for version control is reduced when a part of a long document is changed.
[0032]
【The invention's effect】
According to the present invention, a changed portion between documents before and after editing can be extracted as structured difference data, and the difference data can be directly structured and displayed by SGML document editing software or the like.
As a result, a change in the structure itself and a change in a character string in the structure can be displayed separately, and what kind of change has been made to a user who is editing this structured document with document editing software or the like Since it becomes possible to make it easy to understand, the efficiency of the editing work of the structured document increases.
Further, even when the document editing software or the like uses a dedicated display program such as displaying the structure information in a tree when displaying the structured document, the changed portion can be displayed without requiring another display program. A document comparison function can be easily incorporated into document editing software or the like dedicated to structured documents.
Further, the structured difference data output according to the present invention can be directly structured and displayed using a viewer dedicated to SGML, so that it is possible to browse the revision history data without creating a new revision history viewer or the like. Becomes possible.
Further, according to the present invention, one document of the reference version is stored, and for the other version of the document, only the difference information from the reference document is stored, so that an arbitrary version of the document is extracted. The function can be easily realized, and the data amount of version control can be reduced when a part of a long document is changed or when the document is frequently changed.
[Brief description of the drawings]
FIG. 1 is a configuration diagram of a first embodiment of the present invention.
FIG. 2 is a diagram showing a processing procedure of the first embodiment of the present invention.
FIG. 3 is a diagram illustrating a first example of a structured document for explaining the first embodiment.
FIG. 4 is a diagram showing an example of difference data obtained by extracting a difference from a first example of a structured document, and a display example of displaying difference data by a conventional method.
FIG. 5 is a diagram illustrating a relationship between a structured document and a document type definition.
FIG. 6 is a diagram illustrating an example of structured difference data output by extracting a structured example of a first example of a structured document and outputting the structured difference;
FIG. 7 is a diagram illustrating an example of a document type definition of a first example of a structured document.
FIG. 8 is a diagram illustrating an example of a difference document type definition generated from the document type definition of the first example of the structured document.
FIG. 9 is a diagram showing rules for generating a difference document type definition from a document type definition of a structured document.
FIG. 10 is a diagram showing a document tree created from a first example of a structured document.
FIG. 11 is a diagram showing a document tree as a result of structured difference extraction of a first example of a structured document.
FIG. 12 is a diagram illustrating an example of a structured expression rule for outputting structured difference extracted difference data as structured difference data.
FIG. 13 is a display example of a first example of a structured document.
FIG. 14 is a display example of structured difference data of a first example of a structured document.
FIG. 15 is a configuration diagram of a second embodiment of the present invention.
FIG. 16 is a diagram showing a processing procedure according to the second embodiment of the present invention.
FIG. 17 is a diagram illustrating a second example of a structured document for explaining the second embodiment.
FIG. 18 is a diagram illustrating an example of structured difference data of a second example of a structured document.
FIG. 19 is a diagram for explaining a method of synthesizing the reference document of the second example of the structured document and the structured difference data.
[Explanation of symbols]
101 CPU
102 Terminal device
103 Secondary storage device
104 Document Editing Program
105 Document version management program
106 Document reading program
107 Structural analysis program
108 Structured Document Difference Extraction Program
109 Structured difference information output program
110 Document Display / Save Program
111 Difference document type definition generation program

Claims (4)

特定の文書型定義によって定義された論理構造を持ち、タグによって構造化された構造化文書に対して削除、挿入、または変更などの編集を施す処理装置と、該編集前後の構造化文書を格納する記憶装置を備え、前記処理装置により前記編集前後の両構造化文書を管理する構造化文書の版管理方法において、
前記記憶装置から編集前後の構造化文書を読み出す文書読込ステップと、
上記読込ステップで取得された両構造化文書の論理的な構造を解析する構造解析ステップと、
上記構造解析ステップによって得られた論理構造情報に基づいて、上記編集前後の両文書間の変更箇所を抽出する構造化文書差分抽出ステップと、
上記差分抽出ステップにより得られた変更情報を、構造化記述した差分情報として出力する構造化差分情報出力ステップと、
差分抽出する構造化文書の前記文書型定義から、前記構造化差分情報のための文書型定義を生成する差分文書型定義生成ステップと、
出力された構造化差分情報を表示、保存するステップを有することを特徴とする構造化文書の版管理方法。
A processing device that has a logical structure defined by a specific document type definition and performs editing such as deletion, insertion, or modification on a structured document structured by tags, and stores the structured document before and after the editing. A structured document version management method for managing both structured documents before and after editing by the processing device,
A document reading step of reading a structured document before and after editing from the storage device;
A structural analysis step of analyzing the logical structure of both structured documents obtained in the reading step,
A structured document difference extraction step of extracting a changed portion between the two documents before and after the editing based on the logical structure information obtained by the structure analysis step;
A structured difference information output step of outputting the change information obtained by the difference extraction step as structured description difference information;
A difference document type definition generating step of generating a document type definition for the structured difference information from the document type definition of the structured document to extract the difference;
A version management method for a structured document, comprising a step of displaying and storing the output structured difference information.
論理構造を表すタグによって構造化された構造化文書に対して削除、挿入、または変更などの編集を施す処理装置と、該編集前後の構造化文書を格納する記憶装置を備え、前記処理装置により前記編集前後の両構造化文書を管理する構造化文書の版管理方法において、
前記記憶装置から編集前後の構造化文書を読み出す文書読込ステップと、
上記読込ステップで取得された両構造化文書の論理的な構造を解析する構造解析ステップと、
上記構造解析ステップによって得られた論理構造情報に基づいて、上記編集前後の両文書間の変更箇所を抽出する構造化文書差分抽出ステップと、
上記差分抽出ステップにより得られた変更情報を、構造化記述した差分情報として出力する構造化差分情報出力ステップと、
表示画面上に構造を表示する構造ウィンドウと構造中の文字列を表示する文字列ウィンドウを表示し、該構造ウィンドウ中に編集前後の構造の表示と構造の追加、削除、変更を指示する表示をし、該文字列ウィンドウ中に編集前後の文字列の表示と文字列の追加、削除、変更を指示する表示を前記構造ウィンドウ中の編集前後の構造の表示の位置と対応する位置に行う出力された構造化差分情報を表示するステップと、
出力された構造化差分情報を保存するステップを有することを特徴とする構造化文書の版管理方法。
A processing device that performs editing such as deletion, insertion, or change on a structured document structured by a tag representing a logical structure, and a storage device that stores the structured document before and after the editing, and the processing device In the structured document version management method for managing both structured documents before and after editing,
A document reading step of reading a structured document before and after editing from the storage device;
A structural analysis step of analyzing the logical structure of both structured documents obtained in the reading step,
A structured document difference extraction step of extracting a changed portion between the two documents before and after the editing based on the logical structure information obtained by the structure analysis step;
A structured difference information output step of outputting the change information obtained by the difference extraction step as structured description difference information;
A structure window for displaying the structure on the display screen and a character string window for displaying the character strings in the structure are displayed. In the structure window, the display of the structure before and after editing and the display for instructing addition, deletion, and change of the structure are displayed. Then, in the character string window, the display of the character string before and after editing and the display indicating the addition, deletion, and change of the character string are performed at positions corresponding to the display positions of the structure before and after editing in the structure window. Displaying structured difference information;
A version management method for a structured document, comprising a step of storing the output structured difference information.
記憶装置と処理装置を備え、特定の文書型定義によって定義された論理構造を持ち、タグによって構造化された構造化文書に対して前記処理装置により削除、挿入、または変更などの編集を施し、前記記憶装置に該編集前後の構造化文書を格納し、前記処理装置により前記編集前後の両構造化文書を管理する構造化文書版管理装置において、
前記処理装置は、
前記記憶装置から編集前後の構造化文書を読み出す文書読込手段と、
上記文書読込手段で取得された両構造化文書の論理的な構造を解析する構造化文書解析手段と、
上記構造解析手段によって得られた論理構造情報に基づいて、上記編集前後の構造化文書間の変更箇所を抽出する構造化文書差分抽出手段と、
上記差分抽出手段により得られた変更情報を、構造化記述した差分情報として出力する構造化差分情報出力手段と、
差分抽出する構造化文書の前記文書型定義から、構造化した差分情報のための文書型定義を生成する差分文書型定義生成手段と、
出力された構造化差分情報を表示、保存する手段を備えることを特徴とする構造化文書の版管理装置。
With a storage device and a processing device, having a logical structure defined by a specific document type definition, for the structured document structured by tags, the processing device deletes, inserts, or performs editing such as change, In the structured document version management device that stores the structured document before and after editing in the storage device and manages both the structured document before and after editing by the processing device,
The processing device includes:
Document reading means for reading a structured document before and after editing from the storage device,
Structured document analysis means for analyzing the logical structure of both structured documents acquired by the document reading means,
Based on the logical structure information obtained by the structure analysis means, a structured document difference extraction means for extracting a changed portion between the structured documents before and after the editing,
Structured difference information output means for outputting the change information obtained by the difference extraction means as difference information structured and described;
A difference document type definition generating unit configured to generate a document type definition for structured difference information from the document type definition of the structured document from which the difference is extracted;
A structured document version management device comprising means for displaying and storing output structured difference information.
記憶装置と処理装置を備え、論理構造を表すタグによって構造化された構造化文書に対して前記処理装置により削除、挿入、または変更などの編集を施し、前記記憶装置に該編集前後の構造化文書を格納し、前記処理装置により前記編集前後の両構造化文書を管理する構造化文書版管理装置において、
前記処理装置は、
前記記憶装置から編集前後の構造化文書を読み出す文書読込手段と、
上記文書読込手段で取得された両構造化文書の論理的な構造を解析する構造化文書解析手段と、
上記構造解析手段によって得られた論理構造情報に基づいて、上記編集前後の構造化文書間の変更箇所を抽出する構造化文書差分抽出手段と、
上記差分抽出手段により得られた変更情報を、構造化記述した差分情報として出力する構造化差分情報出力手段と、
表示画面上に構造を表示する構造ウィンドウと構造中の文字列を表示する文字列ウィンドウを表示し、該構造ウィンドウ中に編集前後の構造の表示と構造の追加、削除、変更を指示する表示をし、該文字列ウィンドウ中に編集前後の文字列の表示と文字列の追加、削除、変更を指示する表示を前記構造ウィンドウ中の編集前後の構造の表示の位置と対応する位置に行う出力された構造化差分情報を表示する表示手段と、
出力された構造化差分情報を保存する手段を備えることを特徴とする構造化文書の版管理装置。
The storage device includes a storage device and a processing device, and the processing device performs editing such as deletion, insertion, or change on a structured document structured by a tag representing a logical structure, and performs structuring of the storage device before and after the editing. In a structured document version management device that stores a document and manages both the structured document before and after the editing by the processing device,
The processing device includes:
Document reading means for reading a structured document before and after editing from the storage device,
Structured document analysis means for analyzing the logical structure of both structured documents acquired by the document reading means,
Based on the logical structure information obtained by the structure analysis means, a structured document difference extraction means for extracting a changed portion between the structured documents before and after the editing,
Structured difference information output means for outputting the change information obtained by the difference extraction means as difference information structured and described;
A structure window for displaying the structure on the display screen and a character string window for displaying a character string in the structure are displayed. In the structure window, a display of the structure before and after editing and a display for instructing addition, deletion, and change of the structure are displayed. Then, in the character string window, the display of the character string before and after editing and the display of instructing addition, deletion, and change of the character string are performed at positions corresponding to the display positions of the structure before and after editing in the structure window. Display means for displaying the structured difference information,
An apparatus for managing a version of a structured document, comprising: means for storing the output structured difference information.
JP15920296A 1996-05-31 1996-05-31 Structured document version management method and apparatus Expired - Fee Related JP3566457B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP15920296A JP3566457B2 (en) 1996-05-31 1996-05-31 Structured document version management method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP15920296A JP3566457B2 (en) 1996-05-31 1996-05-31 Structured document version management method and apparatus

Publications (2)

Publication Number Publication Date
JPH09319632A JPH09319632A (en) 1997-12-12
JP3566457B2 true JP3566457B2 (en) 2004-09-15

Family

ID=15688561

Family Applications (1)

Application Number Title Priority Date Filing Date
JP15920296A Expired - Fee Related JP3566457B2 (en) 1996-05-31 1996-05-31 Structured document version management method and apparatus

Country Status (1)

Country Link
JP (1) JP3566457B2 (en)

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2242158C (en) 1997-07-01 2004-06-01 Hitachi, Ltd. Method and apparatus for searching and displaying structured document
JP2002024211A (en) * 2000-06-30 2002-01-25 Hitachi Ltd Method and system for document management and storage medium having processing program stored thereon
JP4737914B2 (en) * 2002-10-02 2011-08-03 ケープレックス・インク Document revision support program, computer-readable medium storing the support program, and document revision support apparatus
JP4340084B2 (en) * 2003-03-11 2009-10-07 パナソニック株式会社 Transmitting apparatus and transmitting method
JP4716709B2 (en) 2004-06-10 2011-07-06 インターナショナル・ビジネス・マシーンズ・コーポレーション Structured document processing apparatus, structured document processing method, and program
JP4236055B2 (en) 2005-12-27 2009-03-11 インターナショナル・ビジネス・マシーンズ・コーポレーション Structured document processing apparatus, method, and program
JP5037088B2 (en) * 2006-11-01 2012-09-26 株式会社日立ソリューションズ Document creation system
JP5163629B2 (en) 2009-12-18 2013-03-13 コニカミノルタビジネステクノロジーズ株式会社 Document processing device
JP5281029B2 (en) * 2010-03-31 2013-09-04 ヤフー株式会社 Confirmation system and method
WO2013075332A1 (en) * 2011-11-25 2013-05-30 Google Inc. Providing translation assistance in application localization
JP5553079B2 (en) * 2012-03-23 2014-07-16 日本電気株式会社 Product document management system, product document management method, and program
JP6011790B2 (en) * 2012-10-18 2016-10-19 バーチャレクス・コンサルティング株式会社 File management apparatus and computer program
CN105930174B (en) * 2016-05-22 2019-05-21 南京南瑞继保电气有限公司 A kind of graphical page program comparison in difference method and system
CN109740124A (en) * 2018-12-25 2019-05-10 东软集团股份有限公司 Difference output method, device, storage medium and the electronic equipment of document comparison
JP7090055B2 (en) * 2019-08-08 2022-06-23 Tis株式会社 Server equipment, programs, and information processing methods

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0769921B2 (en) * 1990-11-09 1995-07-31 株式会社日立製作所 Document logical structure generation method
JPH05128107A (en) * 1991-11-01 1993-05-25 Sharp Corp Structured document editing device
JPH07141335A (en) * 1993-06-29 1995-06-02 Canon Inc Document display device
JP3287679B2 (en) * 1993-12-28 2002-06-04 キヤノン株式会社 Document processing apparatus and method
JPH08221417A (en) * 1995-02-15 1996-08-30 Hitachi Ltd New/old comparing editing device for structured document
JP3724847B2 (en) * 1995-06-05 2005-12-07 株式会社日立製作所 Structured document difference extraction method and apparatus
JPH0969101A (en) * 1995-08-31 1997-03-11 Hitachi Ltd Method and device for generating structured document

Also Published As

Publication number Publication date
JPH09319632A (en) 1997-12-12

Similar Documents

Publication Publication Date Title
KR100324456B1 (en) Structured document searching display method and apparatus
JP3566457B2 (en) Structured document version management method and apparatus
RU2358311C2 (en) Word processing document, stored as single xml file, which can be manipulated by applications which can read xml language
US7673235B2 (en) Method and apparatus for utilizing an object model to manage document parts for use in an electronic document
US6560616B1 (en) Robust modification of persistent objects while preserving formatting and other attributes
US6526410B1 (en) Method and apparatus for structured document difference string extraction
EP1965308A1 (en) Document processing system and method
US20020188636A1 (en) System and method for in-line editing of web-based documents
US20060277452A1 (en) Structuring data for presentation documents
JPH08241332A (en) Device and method for retrieving all-sentence registered word
US8645344B2 (en) Document processing system and method therefor
WO2007071181A1 (en) Method for accessing the data in xml file
US20070061349A1 (en) Hierarchically describing shapes
JP3832693B2 (en) Structured document search and display method and apparatus
US7461337B2 (en) Exception markup documents
EP1965310A1 (en) Document processing method
GB2307571A (en) Automatically generating a document type definition
WO2006103760A1 (en) Document conversion use system
JP2008176777A (en) Web document style change system and its method
JPWO2005098698A1 (en) Document processing device
JP2000048024A (en) Structured document processor
JP2002157120A (en) Design document managing system
US7613709B2 (en) System and method for editing operations of a text object model
JPH0816576A (en) Structured document editing device
JP2003030180A (en) Structured document management device and its program

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040210

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20040316

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040412

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20040601

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20040610

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080618

Year of fee payment: 4

LAPS Cancellation because of no payment of annual fees