JP4447067B2 - Document type definition converter - Google Patents
Document type definition converter Download PDFInfo
- Publication number
- JP4447067B2 JP4447067B2 JP02661399A JP2661399A JP4447067B2 JP 4447067 B2 JP4447067 B2 JP 4447067B2 JP 02661399 A JP02661399 A JP 02661399A JP 2661399 A JP2661399 A JP 2661399A JP 4447067 B2 JP4447067 B2 JP 4447067B2
- Authority
- JP
- Japan
- Prior art keywords
- name
- tag
- tag name
- syntax element
- attribute
- 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
Links
Images
Landscapes
- Document Processing Apparatus (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Description
【0001】
【発明の属する技術分野】
この発明は、文書型定義により作成された文書を伝送する際に、文書のデータ量を短縮する文書型定義変換装置に関するものである。
【0002】
【従来の技術】
文書をデータ伝送等の情報処理に使用する場合、文書の構造を明示する方式で情報処理が行われる。この方式では、文書の構造は、ISO(International Standards Organization 国際標準化機構)規格によるSGML(Standard Generalized Markup Language)という言語、又はXML(eXtensible Markup Language)という言語を使用し、DTD(Document Type Definition 文書型定義)により定義されている。このDTDは、文書の構成要素の名前と、その構成要素における互いの構造上の関係を定義したものである。
【0003】
このDTDにより作成された文書は、文字列の内容、特徴等を示すタグ名が記号「<」と記号「>」の間に挿入されたタグを含んでおり、タグ付き文書と呼ばれている。このようなタグ付き文書では、タグを目印として、各文書の共通の情報を容易に抽出することができるので、多数の文書の蓄積、加工、伝送等を行う上で有効である。
【0004】
ところが、このようなタグ付き文書をEDI(Electronic Data Interchange 電子的データ交換)等に適用し、データ伝送を多数回繰り返してデータ交換を行うと、各文書で共通なタグが繰り返し伝送されることになる。
【0005】
【発明が解決しようとする課題】
従来は、以上のように、EDI等において、DTDにより作成された各文書で共通なタグを繰り返し伝送しているので、全体のデータ伝送量が大きくなり、通信コストが高くなるという課題があった。
【0006】
この発明は上記のような課題を解決するためになされたもので、伝送する文書のデータ量を短縮し、通信コストを削減する文書型定義変換装置を得ることを目的とする。
【0007】
【課題を解決するための手段】
この発明に係る文書型定義変換装置は、文書の構造を定義した文書型定義から、構文要素を抽出する構文要素抽出部と、上記構文要素抽出部が抽出した構文要素を解析する構文要素解析部と、上記構文要素に含まれている文字列の内容等を示すタグ名に対応する短縮タグ名をタグ名対応表として格納するタグ名メモリと、上記タグ名とそのタグ名に付属する属性名に対応する短縮タグ名と短縮属性名を属性名対応表として格納する属性名メモリと、上記構文要素解析部により解析した構文要素に、上記タグ名が含まれている場合に、上記タグ名メモリを検索して上記タグ名を上記短縮タグ名に変換すると共に、上記構文要素解析部により解析した構文要素に、上記属性名が付加されたタグ名が含まれている場合に、上記属性名メモリを検索して上記タグ名及び上記属性名を、上記短縮タグ名及び上記短縮属性名に変換する構文要素変換部と、上記構文要素変換部が変換した上記短縮タグ名及び上記短縮属性名により構成された構文要素を結合し短縮文書型定義として出力する出力部とを備え、構文要素変換部がタグ名メモリを検索した際に、上記タグ名メモリに検索したタグ名が格納されていない場合、そのタグ名に対応する短縮タグ名を生成し、上記タグ名メモリに格納し、構文要素変換部が属性名メモリを検索した際に、上記属性名メモリに検索したタグ名と属性名が格納されていない場合、そのタグ名に対応する短縮タグ名とその属性名に対応する短縮属性名を生成し、上記属性名メモリに格納するものである。
【0008】
この発明に係る文書型定義変換装置は、構文要素解析部が、抽出された構成要素について、タグ名のないコメントであるか、属性名が付加されていないタグ名により構成された要素型宣言であるか、属性名が付加されているタグ名により構成された属性リスト型宣言であるかを解析するものである。
【0009】
【発明の実施の形態】
以下、この発明の実施の一形態を説明する。
実施の形態1.
図1は実施の形態1による文書変換装置の構成を示す図である。図において、1は文書変換装置、2は文書型定義(DTD)により作成された文書型定義整合文書、3は文書変換装置1により変換された短縮文書型定義整合文書、4は文書型定義整合文書2に使用されている文字列の内容等を示すタグ名と、短縮された短縮タグ名との対応を示すタグ名対応表、5は文書型定義整合文書2に使用されているタグ名、及びそのタグ名に付属する属性名と、短縮された短縮タグ名、及び短縮された短縮属性名との対応を示す属性名対応表である。
【0010】
また、図1の文書変換装置1において、11はタグ名対応表4が格納されているタグ名メモリ、12は属性名対応表5が格納されている属性名メモリ、13は文書型定義整合文書2から構文要素を抽出する構文要素抽出部、14は構文要素抽出部13が抽出した構文要素を解析する構文要素解析部である。15は構文要素におけるタグ名、属性名により、タグ名メモリ11,属性名メモリ12を検索し、タグ名、属性名を短縮タグ名、短縮属性名に変換する構文要素変換部であり、16は構文要素変換部15が変換した構文要素を結合し短縮文書型定義整合文書3として出力する出力部である。
【0011】
図2はEDI等で使用される文書型定義整合文書2の例を示す図である。図において、101の「<?xml version…>」はバージョン情報、102の「<!DOCTYPE 見積依頼情報 SYSTEM ……>」は文書型宣言、103の「<見積依頼情報>……</見積依頼情報>」は文書型定義整合文書2の本文が記載されている部分、104の「m_irai.dtd」はファイル名を示している。
【0012】
また、図2において、105の「見積依頼情報」、「見積依頼番号」、「見積依頼日」、「数量」、「商品番号」はタグ名、106の「年」、「月」、「日」は属性名、107の「年=…月=…日=…」は属性リスト、108の「<……>」は構文要素、109の「<タグ名105>」はタグを示す。このように、タグ名105は、文字列の内容、特徴、性質等を示す情報であり、属性名106は、タグ名105を識別するための指標を示している。また、バージョン情報101には、タグ名105が含まれていないが、文書型宣言102には、タグ名105が含まれている。
【0013】
図3はタグ名対応表4を示す図であり、図において、115は各タグ名105に対応した短縮タグ名である。図3に示すように、タグ名対応表4は、タグ名105に対応した短縮タグ名115が記載されており、タグ名メモリ11に格納されている。
【0014】
図4は属性名対応表5を示す図であり、図において、116は属性名106に対応した短縮属性名である。図4に示すように、属性名対応表5は、各タグ名105に対応した短縮タグ名115と、属性名106に対応した短縮属性名116が記載されており、属性名メモリ12に格納されている。
【0015】
次に動作について説明する。
図5は文書変換装置1の処理を示すフローチャートである。ステップST11において、構文要素抽出部13は、図2に示す文書型定義整合文書2から構文要素108を抽出する。すなわち、図2における1つの「<……>」を抽出する。ステップST12において、構文要素解析部14は、抽出された構文要素108が文書型宣言102であるかをチェックする。
【0016】
上記ステップST12において、抽出された構文要素108が文書型宣言102でない場合、ステップST13において、構文要素解析部14は、抽出された構文要素108がタグ109であるかをチェックする。すなわち、構文要素108が「<タグ名105>」であるかをチェックする。
【0017】
上記ステップST13において、抽出された構文要素108がタグ109でない場合、例えば、図2に示すバージョン情報101の場合、ステップST14において、構文要素変換部15は、抽出された構文要素108を、そのまま出力して、ステップST15において、文書型定義整合文書2に次の構文要素108があるかをチェックし、次の構文要素108がある場合には、ステップST11以降の処理を行う。
【0018】
上記ステップST15において、文書型定義整合文書2に次の構文要素108がない場合は、ステップST16において、出力部16は、構文要素変換部15が出力した各構文要素108を結合し、短縮文書型定義整合文書3として出力する。
【0019】
上記ステップST13において、抽出された構文要素108がタグ109である場合、例えば、図2に示す「<見積依頼番号>」の場合、ステップST17において、構文要素解析部14は、タグ109の中に属性リスト107があるかをチェックする。
【0020】
上記ステップST17において、タグ109の中に属性リスト107がない場合、例えば、図2に示す「<見積依頼番号>」の場合、ステップST18において、構文要素変換部15は、タグ109の中のタグ名105により、タグ名メモリ11を検索し、タグ名105に対応する短縮タグ名115を抽出する。例えば、「見積依頼番号」に対応する「B」を抽出する。
【0021】
ステップST19において、構文要素変換部15は、タグ名105を短縮タグ名115に変換して、例えば、「見積依頼番号」を「B」に変換して、ステップST14以降の処理を行う。
【0022】
上記ステップST17において、タグ109の中に属性リスト107がある場合、例えば、図2に示す「<見積依頼日 年=“1998” 月=“7” 日=“28”>」の場合、ステップST20において、構文要素変換部15は、タグ109の中のタグ名105と属性名106により、属性名メモリ12を検索し、タグ名105に対応する短縮タグ名115と、属性名106に対応する短縮属性名116を抽出する。例えば、「見積依頼日」に対応する「C」と、「年」に対応する「C1」,「月」に対応する「C2」,「日」に対応する「C3」を抽出する。
【0023】
ステップST21において、構文要素変換部15は、タグ名105を短縮タグ名115に変換し、属性名106を短縮属性名116に変換して、例えば、「見積依頼日」を「C」に変換し、「年」を「C1」,「月」を「C2」,「日」を「C3」に変換して、ステップST14以降の処理を行う。
【0024】
上記ステップST12において、抽出された構文要素108が文書型宣言102である場合、例えば、図2に示す文書型宣言102の「<!DOCTYPE 見積依頼情報 SYSTEM…」の場合、ステップST22において、構文要素変換部15は、タグ109の中のタグ名105により、タグ名メモリ11を検索し、タグ名105に対応する短縮タグ名115を抽出する。例えば、「見積依頼情報」に対応する「A」を抽出する。
【0025】
ステップST23において、構文要素変換部15は、タグ名105を短縮タグ名115に変換、例えば、「見積依頼情報」を「A」に変換する。ステップST24において、構文要素変換部15は、文書型宣言102の中のファイル名104を変換、例えば、文書型宣言102の中の「m_irai.dtd」を「m_irai_c.dtd」に変換して、ステップST14以降の処理を行う。
【0026】
上記処理において、例えば、図2に示す「<見積依頼番号>ABCD0001</見積依頼番号>」における「<……>」以外の「ABCD0001」は、そのまま出力される。
【0027】
図6は文書変換装置1により変換された短縮文書型定義整合文書3を示す図であり、図2の文書型定義整合文書2に対して、タグ名105、属性名106が短縮タグ名115、短縮属性名116に変換され、ファイル名104が114に変換されている。図2に示す文書型定義整合文書2のデータ量は302バイトであるが、図6に示す短縮文書型定義整合文書3のデータ量は157バイトであり、データ量がほぼ1/2に削減されている。このように、データ量が削減された短縮文書をEDIに使用することにより、データ伝送量が小さくなる。
【0028】
伝送された短縮文書型定義整合文書3を受信する受信側では、送信側と同じタグ名対応表4と属性名対応表5を保有しておくことにより、伝送された短縮文書型定義整合文書3を元の文書型定義整合文書2に読み替えることができる。
【0029】
また、受信側で文書変換装置1と同等の文書変換装置を備えておくことにより、伝送された短縮文書型定義整合文書3を元の文書型定義整合文書2に自動的に変換することも可能である。例えば、図1の構成で、文書型定義整合文書2と短縮文書型定義整合文書3を入れ替え、構文要素変換部15が、短縮タグ名115,短縮属性名116により、タグ名メモリ11,属性名メモリ12を検索し、タグ名105,属性名106に変換すれば良い。
【0030】
以上のように、この実施の形態1によれば、EDI等の少量のデータ交換を多数回繰り返し行う場合に、構文要素変換部15が、タグ名105,属性名106を、短縮タグ名115,短縮属性名116に変換することにより、伝送するデータ量を削減でき、通信コストを安くすることができるという効果が得られる。
【0031】
実施の形態2.
図7は実施の形態2による文書型定義変換装置6を示す図である。図において、6は実施の形態1におけるタグ名対応表4,属性名対応表5を自動的に生成、更新する文書型定義変換装置である。7は文EDI等で使用する文書型定義(DTD)、8は文書型定義変換装置6により変換された短縮文書型定義である。
【0032】
また、図7の文書型定義変換装置6において、61はタグ名105を格納するタグ名メモリ、62は属性名106を格納する属性名メモリ、63は文書型定義7から構文要素を抽出する構文要素抽出部、64は構文要素抽出部63が抽出した構文要素を解析する構文要素解析部である。65は構文要素におけるタグ名105,属性名106により、タグ名メモリ61,属性名メモリ62を検索し、短縮タグ名115,短縮属性名116に変換する構文要素変換部である。
【0033】
さらに、図7において、66は構文要素変換部65の指示により、タグ名メモリ61に格納されていないタグ名105に対応する短縮タグ名115を生成する短縮タグ名生成部であり、67は構文要素変換部65の指示により、属性名メモリ62に格納されていないタグ名105,属性名106に対応する短縮タグ名115,短縮属性名116を生成する短縮属性名生成部であり、68は構文要素変換部65が変換した構文要素を結合し短縮文書型定義8として出力する出力部である。
【0034】
図8は文書型定義7の例を示す図である。図において、201の「<!−− 見積依頼DTD例…>」はコメント、202の「<!ELEMENT…>」は要素型宣言、203の「<!ATTLIST…>」は属性リスト宣言、204の「(……)」は内容モデル、205の「EMPYTY」,「CDATA」,「#PCDATA」はシステム定義を示している。また、タグ名105,属性名106,構文要素108は、実施の形態1の図2と同じものである。
【0035】
次に動作について説明する。
図9は文書型定義変換装置6の処理を示すフローチャートである。ステップST31において、構文要素抽出部63は、図8に示す文書型定義7から構文要素108を抽出する。すなわち、図8における1つの「<……>」を抽出する。ステップST32において、構文要素解析部64は、抽出された構文要素108が要素型宣言202であるかをチェックする。
【0036】
上記ステップST32において、抽出された構文要素108が要素型宣言202でない場合、ステップST33において、構文要素解析部64は、抽出された構文要素108が属性リスト宣言203であるかをチェックする。
【0037】
上記ステップST33において、抽出された構文要素108が属性リスト宣言203でない場合、例えば、図8に示すコメント201の場合、ステップST34において、構文要素変換部65は、抽出された構文要素108を、そのまま出力して、ステップST35において、文書型定義7に次の構文要素108があるかをチェックし、次の構文要素108がある場合には、ステップST31以降の処理を行う。
【0038】
上記ステップST35において、文書型定義7に次の構文要素108がない場合には、ステップST36において、出力部68は、構文要素変換部65が出力した各構文要素108を結合し、短縮文書型定義8として出力する。
【0039】
上記ステップST32において、抽出された構文要素108が要素型宣言202である場合、例えば、図8に示す202の「<!ELEMENT 見積依頼情報…>」である場合、ステップST37において、構文要素変換部65は、要素型宣言202の中のタグ名105により、タグ名メモリ61を検索し、タグ名105に対応する短縮タグ名115を抽出し、例えば、「見積依頼情報」に対応する「A」を抽出し、構文要素変換部65は、タグ名105を短縮タグ名115に変換、例えば、「見積依頼情報」を「A」に変換する。
【0040】
ステップST38において、構文要素解析部64は、抽出された要素型宣言202の中に、内容モデル204「(……)」があるかをチェックし、内容モデル204がない場合には、例えば図8の要素型宣言202の「<!ELEMENT 見積依頼日 EMPTY>」である場合には、ステップST34以降の処理を行う。
【0041】
上記ステップST38において、内容モデル204がある場合には、ステップST39において、構文要素解析部64は、内容モデル204にシステム定義205があるかをチェックし、システム定義205がある場合には、例えば、図8の要素型宣言202の「<!ELEMENT 見積依頼番号 (#PCDATA)>」である場合には、ステップST34以降の処理を行う。
【0042】
上記ステップST39において、システム定義205がない場合には、例えば、図8の要素型宣言202の「<!ELEMENT 見積依頼情報 (見積依頼番号 見積依頼日 数量 商品番号)>」である場合には、ステップST40において、構文要素変換部65は、内容モデル204の中のタグ名105により、タグ名メモリ61を検索し、タグ名105に対応する短縮タグ名115を抽出し、例えば、「見積依頼番号」に対応する「B」,「見積依頼日」に対応する「C」,「数量」に対応する「D」,「商品番号」に対応する「E」を抽出し、構文要素変換部65は、タグ名105を短縮タグ名115に変換、例えば、「見積依頼番号」を「B」,「見積依頼日」を「C」,「数量」を「D」,「商品番号」を「E」に変換し、ステップST34以降の処理を行う。
【0043】
上記ステップST33において、抽出された構文要素108が属性リスト宣言203である場合、例えば、図8に示す「<!ATTLIST 見積依頼日 年 CDATA 月 CDATA 日 CDATA)>」である場合には、ステップST41において、構文要素変換部65は、属性リスト宣言203の中のタグ名105,属性名106により、属性名メモリ62を検索し、タグ名105,属性名106に対応する短縮タグ名115,短縮属性名116を抽出し、例えば、「見積依頼日」に対応する「C」,「年、月、日」に対応する「C1,C2,C3」を抽出し、構文要素変換部65は、タグ名105を短縮タグ名115に変換し、属性名106を短縮属性名116に変換し、例えば、「見積依頼日」を「C」,「年、月、日」をそれぞれ「C1,C2,C3」に変換し、ステップST34以降の処理を行う。
【0044】
図10は図9に示すステップST37,ST40における短縮タグ名115への変換処理を示すフローチャートである。ステップST51において、構文要素変換部65は、要素型宣言202の中のタグ名105により、タグ名メモリ61を検索し、ステップST52において、構文要素変換部65は、タグ名メモリ61に、変換しようとするタグ名105が格納されているかをチェックする。
【0045】
上記ステップST52において、タグ名メモリ61に、変換しようとするタグ名105が格納されていない場合には、ステップST53において、短縮タグ名生成部66は、構文要素変換部65の指示により、変換しようとするタグ名105とそのタグ名105に対応する短縮タグ名115を生成し、ステップST54において、短縮タグ名生成部66は、生成したタグ名105とそのタグ名105に対応する短縮タグ名115を、タグ名メモリ61に格納する。
【0046】
ステップST55において、構文要素変換部65は、タグ名105を、短縮タグ名生成部66が生成した短縮タグ名115に変換する。上記ステップST52において、タグ名メモリ61に、変換しようとするタグ名105が格納されている場合には、ステップST55の処理を行う。
【0047】
図11は図9に示すステップST41における短縮タグ名115,短縮属性名116の変換処理を示すフローチャートである。ステップST61において、構文要素変換部65は、属性リスト宣言203の中のタグ名105,属性名106により、属性名メモリ62を検索し、ステップST62において、構文要素変換部65は、属性名メモリ62に、変換しようとするタグ名105,属性名106が格納されているかをチェックする。
【0048】
上記ステップST62において、属性名メモリ62に、変換しようとするタグ名105,属性名106が格納されていない場合には、ステップST63において、短縮属性名生成部67は、構文要素変換部65の指示により、変換しようとするタグ名105,属性名106と、そのタグ名105,属性名106に対応する短縮タグ名115,短縮属性名116を生成し、ステップST64において、短縮属性名生成部67は、生成したタグ名105,属性名106と、そのタグ名105,属性名106に対応する短縮タグ名115,短縮属性名116を、属性名メモリ62に格納する。
【0049】
ステップST65において、構文要素変換部65は、タグ名105,属性名106を、短縮タグ名生成部66が生成した短縮タグ名115,短縮属性名116に変換する。上記ステップST62において、属性名メモリ62に、変換しようとするタグ名105,属性名106が格納されている場合には、ステップST65の処理を行う。
【0050】
図12は文書型定義変換装置6により変換された短縮文書型定義8を示す図であり、図8の文書型定義7に対して、タグ名105,属性名106が短縮タグ名115,短縮属性名116に変換され、コメント201aが追加されている。図12に示す短縮文書型定義8は、EDI等における個々のデータ伝送には使用されないが、実施の形態1における短縮文書型定義整合文書3に誤りがないかを照合するのに使用される。
【0051】
このようにして、文書型定義7から、タグ名105,属性名106に対応する短縮タグ名115,短縮属性名116を生成することにより、タグ名対応表4,属性名対応表5を自動的に生成、更新し、実施の形態1のタグ名メモリ11,属性名メモリ12に格納することにより、実際のEDI等における個々のデータ伝送に使用する短縮文書型定義整合文書3を作成することができる。
【0052】
以上のように、この実施の形態2によれば、文書型定義7を、自動的に短縮文書型定義8に変換できるので、実際のEDI等における個々のデータ伝送に使用する短縮文書型定義整合文書3に誤りがないかを照合することができるという効果が得られる。
【0053】
また、この実施の形態2によれば、文書型定義7から、短縮タグ名生成部66,短縮属性名生成部67が、タグ名105,属性名106に対応する短縮タグ名115,短縮属性名116を生成することにより、タグ名対応表4,属性名対応表5を自動的に生成、更新できるので、実際のEDI等における個々のデータ伝送に使用する短縮文書型定義整合文書3を作成するときのタグ名対応表4,属性名対応表5を効率的に生成することができるという効果が得られる。
【0054】
【発明の効果】
以上のように、この発明によれば、構文要素変換部が、構文要素にタグ名が含まれている場合に、タグ名メモリを検索してタグ名を短縮タグ名に変換すると共に、構文要素に属性名が付加されたタグ名が含まれている場合に、属性名メモリを検索してタグ名及び属性名を、短縮タグ名及び短縮属性名に変換することにより、文書型定義を自動的に短縮文書型定義に変換できるので、個々のデータ伝送に使用する短縮文書型定義整合文書に誤りがないかを照合することができるという効果がある。
また、構文要素変換部がタグ名メモリを検索した際に、タグ名メモリに検索したタグ名が格納されていない場合、そのタグ名に対応する短縮タグ名を生成し、タグ名メモリに格納することにより、タグ名対応表を自動的に生成、更新できるので、個々のデータ伝送に使用する短縮文書型定義整合文書を作成するときのタグ名対応表を効率的に生成することができるという効果がある。
さらに、構文要素変換部が属性名メモリを検索した際に、属性名メモリに検索したタグ名と属性名が格納されていない場合、そのタグ名に対応する短縮タグ名とその属性名に対応する短縮属性名を生成し、上記属性名メモリに格納することにより、属性名対応表を自動的に生成、更新できるので、個々のデータ伝送に使用する短縮文書型定義整合文書を作成するときの属性名対応表を効率的に生成することができるという効果がある。
【図面の簡単な説明】
【図1】 この発明の実施の形態1による文書変換装置の構成を示す図である。
【図2】 EDI等で使用される文書型定義整合文書の例を示す図である。
【図3】 この発明の実施の形態1によるタグ名対応表を示す図である。
【図4】 この発明の実施の形態1による属性名対応表を示す図である。
【図5】 この発明の実施の形態1による文書変換装置の処理を示すフローチャートである。
【図6】 この発明の実施の形態1による短縮文書型定義整合文書の例を示す図である。
【図7】 この発明の実施の形態2による文書型定義変換装置の構成を示す図である。
【図8】 EDI等で使用される文書型定義の例を示す図である。
【図9】 この発明の実施の形態2による文書型定義変換装置の処理を示すフローチャートである。
【図10】 この発明の実施の形態2による文書型定義変換装置の処理を示すフローチャートである。
【図11】 この発明の実施の形態2による文書型定義変換装置の処理を示すフローチャートである。
【図12】 この発明の実施の形態2による短縮文書型定義の例を示す図である。
【符号の説明】
1 文書変換装置、2 文書型定義整合文書、3 短縮文書型定義整合文書、4 タグ名対応表、5 属性名対応表、6 文書型定義変換装置、7 文書型定義、8 短縮文書型定義、11,61 タグ名メモリ、12,62 属性名メモリ、13,63 構文要素抽出部、14,64 構文要素解析部、15,65 構文要素変換部、16,68 出力部。[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a document type definition conversion apparatus that reduces the data amount of a document when transmitting a document created by the document type definition.
[0002]
[Prior art]
When a document is used for information processing such as data transmission, information processing is performed in a manner that clearly shows the structure of the document. In this method, the document structure is SGML (Standard Generalized Markup Language) according to the ISO (International Standards Organization International Standardization Organization) standard, or XML (extensive Markup Language D), which is a language that uses the D language (eXtensible Markup Language). Definition). This DTD defines the name of the component of the document and the structural relationship between the components.
[0003]
A document created by this DTD includes a tag in which a tag name indicating the content, characteristics, etc. of a character string is inserted between the symbols “<” and “>”, and is called a tagged document. . In such a tagged document, since information common to each document can be easily extracted using the tag as a mark, it is effective in storing, processing, transmitting, etc. a large number of documents.
[0004]
However, when such a tagged document is applied to EDI (Electronic Data Interchange Electronic Data Exchange) and the like, and data exchange is repeated many times, a common tag is repeatedly transmitted in each document. Become.
[0005]
[Problems to be solved by the invention]
Conventionally, as described above, in EDI and the like, since a common tag is repeatedly transmitted in each document created by DTD, there is a problem that the entire data transmission amount is increased and the communication cost is increased. .
[0006]
The present invention has been made to solve the above-described problems, and an object of the present invention is to obtain a document type definition conversion apparatus that shortens the data amount of a document to be transmitted and reduces the communication cost.
[0007]
[Means for Solving the Problems]
A document type definition conversion apparatus according to the present invention includes a syntax element extraction unit that extracts a syntax element from a document type definition that defines a document structure, and a syntax element analysis unit that analyzes a syntax element extracted by the syntax element extraction unit A tag name memory for storing a short tag name corresponding to a tag name indicating the content of the character string included in the syntax element as a tag name correspondence table, and the tag name and its tag name.Attached toIf the tag name is included in the attribute name memory that stores the short tag name corresponding to the attribute name and the short attribute name as an attribute name correspondence table, and the syntax element analyzed by the syntax element analysis unit, the tag When the name memory is searched and the tag name is converted to the short tag name, and the syntax element analyzed by the syntax element analysis unit includes the tag name to which the attribute name is added, the attribute A syntax element conversion unit that searches the name memory and converts the tag name and the attribute name into the short tag name and the short attribute name, and the short tag name and the short attribute name converted by the syntax element conversion unit An output unit that combines the syntax elements configured by the above and outputs an abbreviated document type definition. When the syntax element conversion unit searches the tag name memory, the searched tag name is not stored in the tag name memory. If, to generate a short tag name corresponding to the tag name, stored in the tag name memoryIf the searched tag name and attribute name are not stored in the attribute name memory when the syntax element conversion unit searches the attribute name memory, it corresponds to the short tag name corresponding to the tag name and the attribute name. A short attribute name to be generated is generated and stored in the attribute name memory.
[0008]
In the document type definition conversion apparatus according to the present invention, the syntax element analysis unit uses an element type declaration composed of a comment without a tag name or a tag name without an attribute name added to the extracted component. This is to analyze whether there is an attribute list type declaration composed of a tag name to which an attribute name is added.
[0009]
DETAILED DESCRIPTION OF THE INVENTION
An embodiment of the present invention will be described below.
FIG. 1 is a diagram showing a configuration of a document conversion apparatus according to the first embodiment. In the figure, 1 is a document conversion device, 2 is a document type definition matching document created by document type definition (DTD), 3 is a shortened document type definition matching document converted by the
[0010]
In the
[0011]
FIG. 2 is a diagram showing an example of the document type definition matching
[0012]
In FIG. 2, “Quote Request Information”, “Quotation Request Number”, “Quotation Request Date”, “Quantity”, and “Product Number” are the tag names, and “Year”, “Month”, “Day” are 106. "Is an attribute name, 107 is" year = ... month = ... day = ... "is an attribute list, 108 is" <...> "is a syntax element, 109 is" <
[0013]
FIG. 3 is a diagram showing the tag name correspondence table 4, in which 115 is a shortened tag name corresponding to each
[0014]
FIG. 4 is a diagram showing the attribute name correspondence table 5, in which 116 is a shortened attribute name corresponding to the
[0015]
Next, the operation will be described.
FIG. 5 is a flowchart showing processing of the
[0016]
If the extracted syntax element 108 is not the
[0017]
If the extracted syntax element 108 is not the tag 109 in step ST13, for example, in the case of the
[0018]
In step ST15, when the document type
[0019]
When the extracted syntax element 108 is the tag 109 in step ST13, for example, in the case of “<estimation request number>” illustrated in FIG. 2, the syntax
[0020]
If the
[0021]
In step ST19, the syntax
[0022]
If the
[0023]
In step ST21, the syntax
[0024]
If the extracted syntax element 108 is the
[0025]
In step ST23, the syntax
[0026]
In the above processing, for example, “ABCD0001” other than “<...>” In “<estimation request number> ABCD0001 </ quote>” shown in FIG. 2 is output as it is.
[0027]
FIG. 6 is a diagram showing the abbreviated document type
[0028]
The receiving side that receives the transmitted short document type
[0029]
Further, by providing a document conversion device equivalent to the
[0030]
As described above, according to the first embodiment, when a small amount of data exchange such as EDI is repeated many times, the syntax
[0031]
FIG. 7 is a diagram showing a document type
[0032]
In the document type
[0033]
Further, in FIG. 7,
[0034]
FIG. 8 is a diagram showing an example of the
[0035]
Next, the operation will be described.
FIG. 9 is a flowchart showing processing of the document type
[0036]
If the extracted syntax element 108 is not the
[0037]
In step ST33, if the extracted syntax element 108 is not the
[0038]
In step ST35, if the
[0039]
If the extracted syntax element 108 is the
[0040]
In step ST38, the syntax element analysis unit 64 checks whether or not the content model 204 “(...)” Is included in the extracted
[0041]
In step ST38, if the content model 204 is present, in step ST39, the syntax element analysis unit 64 checks whether the content model 204 has a
[0042]
If there is no
[0043]
If the extracted syntax element 108 is the
[0044]
FIG. 10 is a flowchart showing the conversion process to the
[0045]
If the
[0046]
In step ST55, the syntax
[0047]
FIG. 11 is a flowchart showing the conversion process of the
[0048]
If the
[0049]
In step ST65, the syntax
[0050]
FIG. 12 is a diagram showing the abbreviated document type definition 8 converted by the document type
[0051]
In this way, by generating the
[0052]
As described above, according to the second embodiment, since the
[0053]
Further, according to the second embodiment, from the
[0054]
【The invention's effect】
As described above, according to the present invention, when the syntax element conversion unit includes a tag name in the syntax element, the syntax element conversion unit searches the tag name memory and converts the tag name to the short tag name. If a tag name with an attribute name added is included, the document type definition is automatically determined by searching the attribute name memory and converting the tag name and attribute name to the short tag name and short attribute name. Therefore, there is an effect that it is possible to collate whether there is an error in the shortened document type definition matching document used for individual data transmission.
When the searched tag name is not stored in the tag name memory when the syntax element conversion unit searches the tag name memory, a short tag name corresponding to the tag name is generated and stored in the tag name memory. As a result, the tag name correspondence table can be automatically generated and updated, and the tag name correspondence table can be efficiently generated when creating a short document type definition matching document used for individual data transmission. There is.
Furthermore, when the syntax element conversion unit searches the attribute name memory and the searched tag name and attribute name are not stored in the attribute name memory, it corresponds to the short tag name corresponding to the tag name and the attribute name. By creating a short attribute name and storing it in the above attribute name memory, the attribute name correspondence table can be automatically created and updated, so attributes when creating a short document type definition consistent document used for individual data transmission There is an effect that the name correspondence table can be generated efficiently.
[Brief description of the drawings]
FIG. 1 is a diagram showing a configuration of a document conversion apparatus according to
FIG. 2 is a diagram illustrating an example of a document type definition matching document used in EDI or the like.
FIG. 3 is a diagram showing a tag name correspondence table according to
FIG. 4 shows an attribute name correspondence table according to the first embodiment of the present invention.
FIG. 5 is a flowchart showing processing of the document conversion apparatus according to
FIG. 6 is a diagram showing an example of a shortened document type definition matching document according to the first embodiment of the present invention.
FIG. 7 is a diagram showing a configuration of a document type definition conversion apparatus according to
FIG. 8 is a diagram illustrating an example of a document type definition used in EDI or the like.
FIG. 9 is a flowchart showing processing of the document type definition conversion apparatus according to the second embodiment of the present invention.
FIG. 10 is a flowchart showing processing of the document type definition conversion apparatus according to the second embodiment of the present invention.
FIG. 11 is a flowchart showing processing of the document type definition conversion apparatus according to the second embodiment of the present invention.
FIG. 12 is a diagram showing an example of a shortened document type definition according to the second embodiment of the present invention.
[Explanation of symbols]
1 Document conversion device, 2 Document type definition consistent document, 3 Short document type definition consistent document, 4 Tag name correspondence table, 5 Attribute name correspondence table, 6 Document type definition conversion device, 7 Document type definition, 8 Short document type definition, 11, 61 Tag name memory, 12, 62 Attribute name memory, 13, 63 Syntax element extraction unit, 14, 64 Syntax element analysis unit, 15, 65 Syntax element conversion unit, 16, 68 Output unit.
Claims (2)
上記構文要素抽出部が抽出した構文要素を解析する構文要素解析部と、
上記構文要素に含まれている文字列の内容等を示すタグ名に対応する短縮タグ名をタグ名対応表として格納するタグ名メモリと、
上記タグ名とそのタグ名に付属する属性名に対応する短縮タグ名と短縮属性名を属性名対応表として格納する属性名メモリと、
上記構文要素解析部により解析した構文要素に、上記タグ名が含まれている場合に、上記タグ名メモリを検索して上記タグ名を上記短縮タグ名に変換すると共に、上記構文要素解析部により解析した構文要素に、上記属性名が付加されたタグ名が含まれている場合に、上記属性名メモリを検索して上記タグ名及び上記属性名を、上記短縮タグ名及び上記短縮属性名に変換する構文要素変換部と、
上記構文要素変換部が変換した上記短縮タグ名及び上記短縮属性名により構成された構文要素を結合し短縮文書型定義として出力する出力部とを備え、
上記構文要素変換部が上記タグ名メモリを検索した際に、上記タグ名メモリに検索したタグ名が格納されていない場合、そのタグ名に対応する短縮タグ名を生成し、上記タグ名メモリに格納し、
上記構文要素変換部が上記属性名メモリを検索した際に、上記属性名メモリに検索したタグ名と属性名が格納されていない場合、そのタグ名に対応する短縮タグ名とその属性名に対応する短縮属性名を生成し、上記属性名メモリに格納することを特徴とする文書型定義変換装置。A syntax element extractor that extracts syntax elements from a document type definition that defines the structure of the document;
A syntax element analysis unit for analyzing the syntax element extracted by the syntax element extraction unit;
A tag name memory for storing, as a tag name correspondence table, a shortened tag name corresponding to a tag name indicating the content of the character string included in the syntax element;
An attribute name memory storing the short tag name and short attribute name corresponding to the tag name and the attribute name attached to the tag name as an attribute name correspondence table;
When the tag name is included in the syntax element analyzed by the syntax element analysis unit, the tag name memory is searched to convert the tag name to the short tag name, and the syntax element analysis unit When the analyzed syntax element includes a tag name to which the attribute name is added, the attribute name memory is searched and the tag name and the attribute name are converted into the short tag name and the short attribute name. A syntax element converter to convert;
An output unit that combines the syntax element formed by the short tag name and the short attribute name converted by the syntax element conversion unit and outputs the combined short element name as a short document type definition;
When the syntax element conversion unit searches the tag name memory and the searched tag name is not stored in the tag name memory, a short tag name corresponding to the tag name is generated and stored in the tag name memory. Store and
When the syntax element conversion unit searches the attribute name memory and the searched tag name and attribute name are not stored in the attribute name memory, it corresponds to the short tag name corresponding to the tag name and the attribute name. A document type definition conversion apparatus characterized in that a short attribute name to be generated is generated and stored in the attribute name memory .
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP02661399A JP4447067B2 (en) | 1999-02-03 | 1999-02-03 | Document type definition converter |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP02661399A JP4447067B2 (en) | 1999-02-03 | 1999-02-03 | Document type definition converter |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2000222404A JP2000222404A (en) | 2000-08-11 |
JP4447067B2 true JP4447067B2 (en) | 2010-04-07 |
Family
ID=12198350
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP02661399A Expired - Fee Related JP4447067B2 (en) | 1999-02-03 | 1999-02-03 | Document type definition converter |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4447067B2 (en) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2008084341A (en) * | 1999-06-21 | 2008-04-10 | Fujitsu Ltd | Structured document compressing method, compressing device, and computer-readable recording medium recording structured document compressing program |
US6829614B2 (en) * | 1999-09-30 | 2004-12-07 | Nec Corporation | Scrambling method of the data files |
US20060184547A1 (en) * | 2005-02-11 | 2006-08-17 | Fujitsu Limited | Method and system for fast encoding of data documents |
JP4735155B2 (en) * | 2005-09-21 | 2011-07-27 | 富士ゼロックス株式会社 | Display device and character string database redefinition method |
US7620645B2 (en) * | 2006-02-24 | 2009-11-17 | Microsoft Corporation | Scalable algorithm for sharing EDI schemas |
JP4571991B2 (en) * | 2008-04-02 | 2010-10-27 | 富士通株式会社 | Structured document converter |
-
1999
- 1999-02-03 JP JP02661399A patent/JP4447067B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2000222404A (en) | 2000-08-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
AU2003243169B2 (en) | System and method for processing of XML documents represented as an event stream | |
US8484552B2 (en) | Extensible stylesheet designs using meta-tag information | |
US7519903B2 (en) | Converting a structured document using a hash value, and generating a new text element for a tree structure | |
US6182029B1 (en) | System and method for language extraction and encoding utilizing the parsing of text data in accordance with domain parameters | |
US20060041838A1 (en) | System and method for automatically generating XML schema for validating XML input documents | |
US8332745B2 (en) | Electronic filing system and electronic filing method | |
JPH0969101A (en) | Method and device for generating structured document | |
US20040148612A1 (en) | System and method for generating an application programming interface from a schema | |
JP4042830B2 (en) | Content attribute information normalization method, information collection / service provision system, and program storage recording medium | |
JP4447067B2 (en) | Document type definition converter | |
Castan et al. | Extensible markup language (XML) for music applications: An introduction | |
US20080114797A1 (en) | Importing non-native content into a document | |
US20090199089A1 (en) | Converting a Heterogeneous Document | |
Romary et al. | : serialising the ISO SynAF syntactic object model | |
KR100631086B1 (en) | Method and apparatus for text normalization using extensible markup language(xml) | |
JP2002182915A (en) | Source program storage method, its system, source program restoring method and system, and compiling method and device | |
Lemnitzer et al. | Representing human and machine dictionaries in Markup languages | |
Hayashi et al. | LAF/GrAF-grounded Representation of Dependency Structures. | |
JP4410005B2 (en) | Structured document structure conversion device and program | |
CN111259634A (en) | XSD format file analyzing method and generating method | |
KR20070013770A (en) | Document conversion system using synchronization of structured documents, and it's method | |
Romary et al. | EAD ODD: a solution for project-specific EAD schemes | |
JP4786695B2 (en) | Structure conversion device for structured documents | |
Papaleo | Introduction to XML and its applications | |
Dekhtyar et al. | A framework for management of concurrent XML markup |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20060117 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20070518 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20070522 |
|
A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20070731 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20071001 |
|
A911 | Transfer to examiner for re-examination before appeal (zenchi) |
Free format text: JAPANESE INTERMEDIATE CODE: A911 Effective date: 20071005 |
|
A912 | Re-examination (zenchi) completed and case transferred to appeal board |
Free format text: JAPANESE INTERMEDIATE CODE: A912 Effective date: 20071026 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20091209 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20100120 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130129 Year of fee payment: 3 |
|
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: 20130129 Year of fee payment: 3 |
|
LAPS | Cancellation because of no payment of annual fees |