JP2009122949A - System, method and program for restoring xml data structure - Google Patents

System, method and program for restoring xml data structure Download PDF

Info

Publication number
JP2009122949A
JP2009122949A JP2007296042A JP2007296042A JP2009122949A JP 2009122949 A JP2009122949 A JP 2009122949A JP 2007296042 A JP2007296042 A JP 2007296042A JP 2007296042 A JP2007296042 A JP 2007296042A JP 2009122949 A JP2009122949 A JP 2009122949A
Authority
JP
Japan
Prior art keywords
hierarchy
tag
data
xml data
record
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2007296042A
Other languages
Japanese (ja)
Inventor
Naoki Oku
直樹 奥
Hideki Negishi
秀樹 根岸
Tadashi Inoue
正 井上
Ken Masuyama
健 増山
Atsumi Mano
敦美 真野
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 JP2007296042A priority Critical patent/JP2009122949A/en
Publication of JP2009122949A publication Critical patent/JP2009122949A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To accurately restore an XML data structure in interconversion between XML data and a text or CSV format data regardless of a description structure in the XML data. <P>SOLUTION: This restoration system 100 of the XML data structure includes: a data acquisition part 110 storing the XML data; a tag reading part 111 retrieving a start tag, and reading a tag to a layer Y wherein an end tag is detected; a position information storage part 112 numbering a tag position ID in association with the read tag, and storing a tag position ID group for a route to the layer Y from a layer X; a record generation part 113 generating and storing a record wherein the tag position ID and layer data are associated for the route from the layer X to the layer Y; a restoration processing part 114 generating a layer in the XML data structure for each tag position ID included in the record, setting the layer data, and restoring the XML data; and an output processing part 115 transmitting or outputting the restored XML data to a predetermined terminal. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、XMLデータ構造の復元システム、XMLデータ構造の復元方法、およびXMLデータ構造の復元プログラムに関し、具体的には、流通ビジネスメッセージ標準に準拠したXMLデータとテキストやCSV形式データとの相互変換における、XMLデータ構造の復元技術に関する。   The present invention relates to an XML data structure restoration system, an XML data structure restoration method, and an XML data structure restoration program. More specifically, the present invention relates to an XML data conforming to a distribution business message standard and text and CSV format data. The present invention relates to a technique for restoring an XML data structure in conversion.

企業間における商取引に関する各種データ(標準的書式に統一)をやりとりするEDI(Electronic Data Interchange)の仕組みが普及し始めている。この仕組みでは、商品の受発注や見積もり、決済、出入荷などに関わるデータを、あらかじめ定められた形式にしたがって電子化しネットワークを通じて取引企業の端末間で送受信する。こうした中で、流通ビジネスメッセージ標準に準拠したXMLファイルを用いてデータの送受信をする場合、取引相手等の端末から受信した流通ビジネスメッセージをテキスト又はCSV形式に変換する手段と、変換したテキスト又はCSV形式から、流通ビジネスメッセージ標準に準拠したXMLファイルの構造に再変換する手段とが提案されている。   An EDI (Electronic Data Interchange) mechanism for exchanging various types of data related to business transactions between companies (unified in a standard format) has begun to spread. In this system, data related to order placement / quotation, settlement, settlement, and arrival / departure of goods is digitized according to a predetermined format and transmitted / received between terminals of trading companies through a network. Under these circumstances, when data is transmitted / received using an XML file conforming to the distribution business message standard, a means for converting the distribution business message received from a terminal such as a business partner into text or CSV format, converted text or CSV Means for reconverting the format into an XML file structure that conforms to the distribution business message standard has been proposed.

例えば、構造を持つデータを受け渡す遠隔メソッド呼出しの処理負荷の軽減とこのXMLパーシングを行うシステム構築での記憶容量の削減とができることを課題とした、データ転送プロトコルを用いたクライアントとサーバとの間のサービス連携システムにおいて、プログラミング言語の構造型データ及び基本型データを、送付先で逆変換可能な高々一段の階層を持つテキスト文書に作成するクライアント非再帰データ表現生成シリアライザと、前記クライアント非再帰データ表現生成シリアライザで作成された高々一段の階層を持つテキスト文書を解釈して、サーバアプリケーション起動に必要な情報を取り出すサーバ非再帰データ表現解釈パーサと、サーバアプリケーションを起動した戻り値である構造型データ及び基本型データを、高々一段の階層でかつクライアント側で逆変換可能なテキスト文書に作成するサーバ非再帰データ表現生成シリアライザと、高々一段の階層を持つテキスト文書を入力して、サーバアプリケーションからの戻り値である構造を持ったパラメータを作成するクライアント非再帰データ表現解釈パーサとを有することにより、クライアントアプリケーションとサーバアプリケーションとの連携を可能とすることを特徴とするサービス連携システム(特許文献1参照)などが提案されている。   For example, it is possible to reduce the processing load of remote method invocation that delivers structured data, and to reduce the storage capacity in the construction of a system that performs this XML parsing. A non-recursive data representation generation serializer for creating structured text data and basic type data in a programming language into a text document having at most one level that can be inversely converted at a destination, and the client non-recursive data A server non-recursive data representation interpretation parser that interprets a text document with at most one level created by the data representation generation serializer and retrieves information necessary for starting the server application, and a structural type that is the return value that started the server application Data and basic data A server non-recursive data representation generation serializer that creates a text document that is one level of hierarchy and can be reverse-converted on the client side, and a text document that has at most one level of hierarchy, and a structure that is the return value from the server application Providing a service non-recursive data expression interpretation parser that creates a parameter with a service cooperation system (see Patent Document 1) that enables cooperation between a client application and a server application has been proposed. Yes.

また、データ変換後のデータをより柔軟に利用することを可能にしたデータ変換処理装置、変換処理方法およびそのプログラムを提供することを課題とした、レガシーシステムが使用するレガシーデータとXMLデータとをデータ変換処理する際に、前記レガシーシステムが使用するフォーマットをXMLで定義したフォーマット定義XMLファイルを参照してデータ変換処理を行うデータ変換手段を具備することを特徴とするデータ変換処理装置(特許文献2参照)なども提案されている。
特開2004−265164号公報 特開2004−318420号公報
In addition, legacy data and XML data used by a legacy system, which aims to provide a data conversion processing device, a conversion processing method, and a program thereof that make it possible to use data after data conversion more flexibly. A data conversion processing apparatus comprising data conversion means for performing data conversion processing with reference to a format definition XML file in which a format used by the legacy system is defined in XML when performing data conversion processing (Patent Document) 2) is also proposed.
JP 2004-265164 A JP 2004-318420 A

ところで、流通ビジネスメッセージ標準で定義されているXMLスキーマには、各項目(タグ)が階層構造で定義されることとなっている。また、このスキーマにおける繰り返し記述は、同一階層で異なる内容のタグが繰返し記述される場合と、上位階層のタグから所定階層のタグまで繰返し記述する場合の2つの構造パターンがある。この2つの構造パターンのそれぞれにおいて繰り返し記述されたタグが前記2パターン間で同じである場合、このXMLデータをテキスト又はCSV形式に変換すると変換結果が同じになってしまう。つまり、前記どちらの構造パターンで記述されていたXMLデータなのかが不明となる。このため、この変換後のテキスト又はCSV形式のデータをXMLデータに逆変換するとしても、元のXMLデータと同一構造への復元が保障されない。   By the way, in the XML schema defined in the distribution business message standard, each item (tag) is defined in a hierarchical structure. The repeated description in this schema has two structural patterns: a case where tags with different contents are repeatedly described in the same layer, and a case where tags are repeatedly described from a tag in a higher layer to a tag in a predetermined layer. If the tags repeatedly described in each of the two structural patterns are the same between the two patterns, the conversion result will be the same when the XML data is converted to text or CSV format. That is, it is unclear which XML pattern data is described in which structure pattern. For this reason, even if this converted text or CSV format data is reversely converted to XML data, restoration to the same structure as the original XML data is not guaranteed.

そこで、本発明は上記課題を鑑みてなされたものであり、XMLデータにおける記述構造によらず、XMLデータとテキストまたはCSV形式データとの相互変換時におけるXMLデータ構造の正確な復元を可能とする技術の提供を目的とする。   Therefore, the present invention has been made in view of the above problems, and enables accurate restoration of the XML data structure at the time of mutual conversion between XML data and text or CSV format data, regardless of the description structure in the XML data. The purpose is to provide technology.

本発明のXMLデータ構造の復元システムは、XMLデータとテキストまたはCSV形式のデータとを相互変換するコンピュータシステムであって、ネットワーク上の所定端末よりXMLデータを受信し、記憶装置に格納するデータ取得部と、前記記憶装置よりXMLデータをメモリに読み出して、前記XMLデータにおける開始タグを検索し、開始タグが検索された階層Xから下位階層に向けて、終了タグが検知される階層Yまでタグの読取り処理を実行する、タグ読取り部と、前記階層Xから前記階層Yまでの各階層で読み取ったタグに対応させて、各タグを一意に特定するタグ位置IDを採番し、前記階層Xから階層Yに至る経路についてのタグ位置ID群をメモリに格納する位置情報格納部と、前記XMLデータの階層Xから階層Yまでの各階層で記述されている階層データをXMLデータから読取り、各階層のXMLデータを、前記メモリにおけるタグ位置ID群が含む各階層のタグ位置IDに対応付けし、前記階層Xから階層Yに至る経路についてタグ位置IDと階層データとが対応付けされたレコードを生成し、テキストまたはCSV形式のデータとして記憶装置に格納するレコード生成部と、ネットワーク上の所定端末または入力インターフェイスからXMLデータ構造の復元指示を受け付けるか、記憶装置にて予め設定されていたXMLデータ構造の復元時期の到来を検知したならば、前記記憶装置より前記レコードをメモリに読み出して、当該レコードが含むタグ位置ID毎にXMLデータ構造における階層を生成し、生成した各階層に対し、該当タグ位置IDに対応する階層データを前記レコードより抽出して設定し、開始タグが検索された前記階層Xから終了タグが検知された階層Yまでの各階層が階層データを含んだ構造をなすXMLデータを復元する復元処理部と、前記メモリにて復元したXMLデータを、ネットワーク上の所定端末に送信するか、出力インターフェイスに出力する、出力処理部と、を備えること。   The XML data structure restoration system according to the present invention is a computer system for interconverting XML data and text or CSV data, and obtains data to be received from a predetermined terminal on a network and stored in a storage device. XML data is read from the storage device to the memory, a start tag in the XML data is searched, and the tag from the hierarchy X where the start tag is searched to the lower hierarchy until the hierarchy Y where the end tag is detected In response to the tag reading unit, the tag position ID that uniquely identifies each tag is assigned in correspondence with the tag read in each hierarchy from the hierarchy X to the hierarchy Y, and the hierarchy X A position information storage unit that stores in a memory a tag position ID group for a route from the level Y to the level Y, and the level X to level Y of the XML data The hierarchical data described in each hierarchy in FIG. 5 is read from the XML data, the XML data in each hierarchy is associated with the tag position ID of each hierarchy included in the tag position ID group in the memory, and the hierarchy X to the hierarchy Y A record generation unit for generating a record in which a tag position ID and hierarchical data are associated with each other for a route to the destination, and storing the record in a storage device as data in text or CSV format, and an XML data structure from a predetermined terminal or input interface on the network When the restoration instruction is received, or the arrival of the restoration time of the XML data structure preset in the storage device is detected, the record is read from the storage device to the memory, and each tag position ID included in the record is read. A hierarchy in the XML data structure is generated, and the corresponding tag position I is generated for each generated hierarchy. Hierarchical data corresponding to is extracted and set from the record, and XML data having a structure in which each hierarchy from the hierarchy X where the start tag is searched to the hierarchy Y where the end tag is detected includes the hierarchy data is restored. And an output processing unit that transmits the XML data restored in the memory to a predetermined terminal on the network or outputs it to an output interface.

これによれば、所定の端末から受信した、例えば、流通ビジネスメッセージ標準準拠のXMLデータを、XMLデータ構造についても配慮しつつテキスト又はCSV形式に変換し保存することができる。そのため、たとえXMLデータ自体を紛失した場合でも、テキスト又はCSV形式に変換し保存してあるデータから、前記端末から受信した時のデータ構造を備えたXMLデータに復元する事が保障できる。したがって、XMLデータにおける記述構造によらず、XMLデータとテキストまたはCSV形式データとの相互変換時におけるXMLデータ構造の正確な復元が可能なる。   According to this, XML data received from a predetermined terminal, for example, conforming to the distribution business message standard can be converted into a text or CSV format and stored while taking into consideration the XML data structure. Therefore, even if the XML data itself is lost, it can be guaranteed that the data converted into text or CSV format and stored is restored to XML data having a data structure as received from the terminal. Therefore, it is possible to accurately restore the XML data structure at the time of mutual conversion between the XML data and the text or CSV format data regardless of the description structure in the XML data.

また、前記XMLデータ構造の復元システムにおいて、前記タグ読取り部は、前記階層Yの終了タグの読取り処理を実行した後、当該階層Yを包含する上位の階層Aにおいて、前記階層Yのものとは別の開始タグを検索し、この開始タグが検索された階層Aから下位階層に向けて、前記階層Yのものとは別の終了タグが検知される階層Bまでタグの読取り処理を実行するものであり、前記位置情報格納部は、前記階層Aから前記階層Bまでの各階層で読み取ったタグに対応させて、各タグを一意に特定するタグ位置IDを採番し、既にタグ位置IDを採番済みの前記所定階層Xから前記階層Aの経路についてのタグ位置ID群に、前記階層Aから階層Bに至る経路について採番したタグ位置ID群をマージし、階層X〜A〜Bの経路についてのタグ位置ID群としてメモリに格納するものであり、前記レコード生成部は、前記XMLデータの階層X〜A〜Bの各階層で記述されている階層データをXMLデータから読取り、各階層のXMLデータを、前記メモリにおけるタグ位置ID群が含む各階層のタグ位置IDに対応付けし、前記階層X〜A〜Bに至る経路についてタグ位置IDと階層データとが対応付けされたレコードを生成し、テキストまたはCSV形式のデータとして記憶装置に格納するものであり、前記復元処理部は、前記記憶装置より前記レコードをメモリに読み出して、当該レコードが含むタグ位置IDのうち、前記階層Aから階層BまでのものについてXMLデータ構造における階層を生成し、生成した階層Aから階層Bまでの各階層に対し、該当タグ位置IDに対応する階層データを前記レコードより抽出して設定し、前記階層Aから階層Bまでの各階層が階層データを含んだ構造をなすXMLデータを復元し、このXMLデータを、既に復元済みの前記階層Xから階層YまでのXMLデータに追記し、前記階層X〜A〜Bの各階層が階層データを含んだ構造をなすXMLデータを復元するものである、としてもよい。   Further, in the XML data structure restoration system, the tag reading unit executes the reading process of the end tag of the hierarchy Y, and then, in the upper hierarchy A including the hierarchy Y, what is the hierarchy Y Search for another start tag, and execute a tag reading process from the hierarchy A in which the start tag is searched to the lower hierarchy to the hierarchy B where an end tag different from that of the hierarchy Y is detected. The position information storage unit assigns a tag position ID that uniquely identifies each tag in correspondence with the tag read in each hierarchy from the hierarchy A to the hierarchy B, and has already assigned the tag position ID. The tag position ID group for the route from the hierarchy A to the hierarchy B is merged with the tag position ID group for the route from the predetermined hierarchy X to the hierarchy A, and the layers X to A to B are merged. About the route The record generation unit reads the hierarchical data described in each of the hierarchical levels X to AB of the XML data from the XML data, and stores the XML data in each hierarchical level. Is associated with the tag position ID of each hierarchy included in the tag position ID group in the memory, and a record in which the tag position ID and the hierarchy data are associated with each other for the route to the hierarchy X to AB is generated. The data is stored in a storage device as text or CSV format data, and the restoration processing unit reads the record from the storage device into a memory, and among the tag position IDs included in the record, the hierarchy A to the hierarchy B A hierarchy in the XML data structure is generated for those up to and including the corresponding tag position ID for each hierarchy from hierarchy A to hierarchy B Corresponding hierarchical data is extracted and set from the record, XML data having a structure in which each hierarchy from the hierarchical level A to the hierarchical level B includes hierarchical data is restored, and this XML data is restored to the already restored hierarchical level. It is good also as what adds to the XML data from X to the hierarchy Y, and restore | restores the XML data which makes each hierarchy of the said hierarchy XA to B the hierarchy data.

これによれば、XMLデータの階層構造が多重化している状況にも対応して、タグ位置の把握および記憶を可能とし、XMLデータのテキストまたはCSV形式への変換と、テキストまたはCSV形式のデータからのXMLデータへの復元が、XMLデータ構造に沿って正確に実行できる。   According to this, in correspondence with the situation where the hierarchical structure of the XML data is multiplexed, the tag position can be grasped and stored, the conversion of the XML data into the text or CSV format, and the text or CSV format data. Can be accurately restored along with the XML data structure.

また、前記XMLデータ構造の復元システムにおいて、前記XMLデータは、流通ビジネスメッセージ標準に準拠したデータのうち、出荷梱包についてのデータであるとしてもよい。   In the XML data structure restoration system, the XML data may be data on shipping packaging among data compliant with a distribution business message standard.

これによれば、XMLデータとして現在広く取り扱われている流通ビジネスメッセージ標準準拠の出荷梱包データについて、一度テキストまたはCSV形式へ変換したデータからの正確なXMLデータ構造の復元が困難といった問題点を解消することが可能となる。   This solves the problem that it is difficult to restore the exact XML data structure from the data once converted to text or CSV format for the shipping packing data conforming to the distribution business message standard that is currently widely handled as XML data. It becomes possible to do.

また、本発明のXMLデータ構造の復元方法は、XMLデータとテキストまたはCSV形式のデータとを相互変換するコンピュータが、ネットワーク上の所定端末よりXMLデータを受信し、記憶装置に格納する処理と、前記記憶装置よりXMLデータをメモリに読み出して、前記XMLデータにおける開始タグを検索し、開始タグが検索された階層Xから下位階層に向けて、終了タグが検知される階層Yまでタグの読取り処理を実行する処理と、前記階層Xから前記階層Yまでの各階層で読み取ったタグに対応させて、各タグを一意に特定するタグ位置IDを採番し、前記階層Xから階層Yに至る経路についてのタグ位置ID群をメモリに格納する処理と、前記XMLデータの階層Xから階層Yまでの各階層で記述されている階層データをXMLデータから読取り、各階層のXMLデータを、前記メモリにおけるタグ位置ID群が含む各階層のタグ位置IDに対応付けし、前記階層Xから階層Yに至る経路についてタグ位置IDと階層データとが対応付けされたレコードを生成し、テキストまたはCSV形式のデータとして記憶装置に格納する処理と、ネットワーク上の所定端末または入力インターフェイスからXMLデータ構造の復元指示を受け付けるか、記憶装置にて予め設定されていたXMLデータ構造の復元時期の到来を検知したならば、前記記憶装置より前記レコードをメモリに読み出して、当該レコードが含むタグ位置ID毎にXMLデータ構造における階層を生成し、生成した各階層に対し、該当タグ位置IDに対応する階層データを前記レコードより抽出して設定し、開始タグが検索された前記階層Xから終了タグが検知された階層Yまでの各階層が階層データを含んだ構造をなすXMLデータを復元する処理と、前記メモリにて復元したXMLデータを、ネットワーク上の所定端末に送信するか、出力インターフェイスに出力する処理と、を実行することを特徴とする。   The XML data structure restoration method of the present invention includes a process in which a computer that mutually converts XML data and text or CSV format data receives XML data from a predetermined terminal on the network and stores it in a storage device. XML data is read from the storage device into the memory, a start tag in the XML data is searched, and a tag reading process is performed from the hierarchy X where the start tag is searched to the hierarchy Y where the end tag is detected from the lower hierarchy. And a path from the hierarchy X to the hierarchy Y by assigning a tag position ID that uniquely identifies each tag in correspondence with the tag read in each hierarchy from the hierarchy X to the hierarchy Y Processing for storing the tag position ID group in the memory, and hierarchical data described in each hierarchy from hierarchy X to hierarchy Y of the XML data The XML data is read from the ML data, the XML data of each layer is associated with the tag position ID of each layer included in the tag position ID group in the memory, and the tag position ID and the layer data are obtained for the route from the layer X to the layer Y. A process for generating the associated record and storing it in the storage device as data in text or CSV format, and receiving an instruction to restore the XML data structure from a predetermined terminal or input interface on the network, or preset in the storage device If it is detected that the restoration time of the XML data structure that has been stored is reached, the record is read from the storage device to the memory, and a hierarchy in the XML data structure is generated for each tag position ID included in the record, and each generated hierarchy On the other hand, the hierarchical data corresponding to the corresponding tag position ID is extracted from the record and set. Then, a process of restoring the XML data in which each hierarchy from the hierarchy X where the start tag is searched to the hierarchy Y where the end tag is detected includes a hierarchy data, and the XML data restored in the memory And transmitting to a predetermined terminal on the network or outputting to an output interface.

これによれば、所定の端末から受信した、例えば、流通ビジネスメッセージ標準準拠のXMLデータを、XMLデータ構造についても配慮しつつテキスト又はCSV形式に変換し保存することができる。そのため、たとえXMLデータ自体を紛失した場合でも、テキスト又はCSV形式に変換し保存してあるデータから、前記端末から受信した時のデータ構造を備えたXMLデータに復元する事が保障できる。したがって、XMLデータにおける記述構造によらず、XMLデータとテキストまたはCSV形式データとの相互変換時におけるXMLデータ構造の正確な復元が可能なる。   According to this, XML data received from a predetermined terminal, for example, conforming to the distribution business message standard can be converted into a text or CSV format and stored while taking into consideration the XML data structure. Therefore, even if the XML data itself is lost, it can be guaranteed that the data converted into text or CSV format and stored is restored to XML data having a data structure as received from the terminal. Therefore, it is possible to accurately restore the XML data structure at the time of mutual conversion between the XML data and the text or CSV format data, regardless of the description structure in the XML data.

また、本発明のXMLデータ構造の復元プログラムは、XMLデータとテキストまたはCSV形式のデータとを相互変換するコンピュータに、ネットワーク上の所定端末よりXMLデータを受信し、記憶装置に格納するステップと、前記記憶装置よりXMLデータをメモリに読み出して、前記XMLデータにおける開始タグを検索し、開始タグが検索された階層Xから下位階層に向けて、終了タグが検知される階層Yまでタグの読取り処理を実行するステップと、前記階層Xから前記階層Yまでの各階層で読み取ったタグに対応させて、各タグを一意に特定するタグ位置IDを採番し、前記階層Xから階層Yに至る経路についてのタグ位置ID群をメモリに格納するステップと、前記XMLデータの階層Xから階層Yまでの各階層で記述されている階層データをXMLデータから読取り、各階層のXMLデータを、前記メモリにおけるタグ位置ID群が含む各階層のタグ位置IDに対応付けし、前記階層Xから階層Yに至る経路についてタグ位置IDと階層データとが対応付けされたレコードを生成し、テキストまたはCSV形式のデータとして記憶装置に格納するステップと、ネットワーク上の所定端末または入力インターフェイスからXMLデータ構造の復元指示を受け付けるか、記憶装置にて予め設定されていたXMLデータ構造の復元時期の到来を検知したならば、前記記憶装置より前記レコードをメモリに読み出して、当該レコードが含むタグ位置ID毎にXMLデータ構造における階層を生成し、生成した各階層に対し、該当タグ位置IDに対応する階層データを前記レコードより抽出して設定し、開始タグが検索された前記階層Xから終了タグが検知された階層Yまでの各階層が階層データを含んだ構造をなすXMLデータを復元するステップと、前記メモリにて復元したXMLデータを、ネットワーク上の所定端末に送信するか、出力インターフェイスに出力するステップと、を実行させるプログラムである。   The XML data structure restoration program of the present invention includes a step of receiving XML data from a predetermined terminal on a network and storing the XML data in a storage device in a computer that mutually converts the XML data and text or CSV data. XML data is read from the storage device into the memory, a start tag in the XML data is searched, and a tag reading process is performed from the hierarchy X where the start tag is searched to the hierarchy Y where the end tag is detected from the lower hierarchy. And a path from the hierarchy X to the hierarchy Y by assigning a tag position ID that uniquely identifies each tag in correspondence with the tag read in each hierarchy from the hierarchy X to the hierarchy Y And a step of storing the tag position ID group in the memory, and the XML data are described in each hierarchy from hierarchy X to hierarchy Y. The hierarchical data is read from the XML data, the XML data of each hierarchy is associated with the tag position ID of each hierarchy included in the tag position ID group in the memory, and the tag position ID and the path from the hierarchy X to the hierarchy Y are A record in which hierarchical data is associated is generated and stored in the storage device as text or CSV format data, and an instruction to restore the XML data structure is received from a predetermined terminal or input interface on the network, or the storage device If the arrival of the restoration time of the preset XML data structure is detected, the record is read from the storage device to the memory, and a hierarchy in the XML data structure is generated for each tag position ID included in the record, For each generated hierarchy, the hierarchy data corresponding to the corresponding tag position ID is Extracting and setting from the code, restoring the XML data having a structure in which each hierarchy from the hierarchy X in which the start tag is searched to the hierarchy Y in which the end tag is detected includes hierarchy data; The step of transmitting the restored XML data to a predetermined terminal on the network or outputting the XML data to an output interface is executed.

これによれば、所定の端末から受信した、例えば、流通ビジネスメッセージ標準準拠のXMLデータを、XMLデータ構造についても配慮しつつテキスト又はCSV形式に変換し保存することができる。そのため、たとえXMLデータ自体を紛失した場合でも、テキスト又はCSV形式に変換し保存してあるデータから、前記端末から受信した時のデータ構造を備えたXMLデータに復元する事が保障できる。したがって、XMLデータにおける記述構造によらず、XMLデータとテキストまたはCSV形式データとの相互変換時におけるXMLデータ構造の正確な復元が可能なる。   According to this, XML data received from a predetermined terminal, for example, conforming to the distribution business message standard can be converted into a text or CSV format and stored while taking into consideration the XML data structure. Therefore, even if the XML data itself is lost, it can be guaranteed that the data converted into text or CSV format and stored is restored to XML data having a data structure as received from the terminal. Therefore, it is possible to accurately restore the XML data structure at the time of mutual conversion between the XML data and the text or CSV format data regardless of the description structure in the XML data.

その他、本願が開示する課題、及びその解決方法は、発明の実施の形態の欄、及び図面により明らかにされる。   In addition, the problems disclosed by the present application and the solutions thereof will be clarified by the embodiments of the present invention and the drawings.

本発明によれば、XMLデータにおける記述構造によらず、XMLデータとテキストまたはCSV形式データとの相互変換時におけるXMLデータ構造の正確な復元が可能となる。   According to the present invention, it is possible to accurately restore the XML data structure at the time of mutual conversion between the XML data and the text or CSV format data, regardless of the description structure in the XML data.

−−−システム構成−−−
以下に本発明の実施形態について図面を用いて詳細に説明する。図1は本実施形態におけるXMLデータ構造の復元システム100の構成図である。本実施形態におけるXMLデータ構造の復元システム100(以下、システム100)は、XMLデータとテキストまたはCSV形式のデータとを相互変換するコンピュータシステムであり、例えば、流通ビジネスメッセージ標準に準拠したXMLデータのやりとりを行う、企業のサーバ装置を想定できる。こうしたサーバ装置は、商取引に関する各種データ、例えば、商品の受発注や見積もり、決済、出入荷などに関わるデータを、あらかじめ定められた形式にしたがって電子化しネットワークを通じて他社の備える他社端末200との間で送受信するものとなる。
--- System configuration ---
Embodiments of the present invention will be described below in detail with reference to the drawings. FIG. 1 is a configuration diagram of an XML data structure restoration system 100 according to this embodiment. An XML data structure restoration system 100 (hereinafter, system 100) in the present embodiment is a computer system that mutually converts XML data and text or CSV format data. For example, XML data structure restoration system 100 conforms to a distribution business message standard. An enterprise server device that exchanges data can be assumed. Such a server device digitizes various data related to commercial transactions, for example, data related to ordering / quoting of products, settlement, settlement / in / out of goods, etc. in accordance with a predetermined format, and communicates with other company terminals 200 provided by other companies through a network. Send and receive.

流通ビジネスメッセージ標準に準拠したXMLデータを送受信するには、企業間での相対関係が前提となる。そこで本実施形態では、取引で相対する企業を他社と自社とに分けて示している。例えば、自社においては、本発明のXMLデータ構造の復元システムを実現する送受信サーバ100の他に、従来から商取引に関するデータ処理を制御していた基幹サーバ11、担当者からの指示を受け付けて前記送受信サーバに入力する運用端末12などが含まれると想定できる。また例えば、他社が備える他社端末200には、送受信サーバ20(機能として前記送受信サーバ100と同様)、従来から商取引に関するデータ処理を制御していた基幹システム21などが含まれると想定できる。なお、こうした構成例は具体的な装置構成をイメージした一例であり、以下の説明では、相対する企業からXMLデータを受信し、このXMLデータとてテキストまたはCSV形式のデータとを相互変換する装置をシステム100とし、このシステム100がテキストまたはCSV形式のデータから逆変換して生成したXMLデータを送信する先が他社端末200とする。   In order to send and receive XML data compliant with the distribution business message standard, a relative relationship between companies is a prerequisite. Therefore, in the present embodiment, the companies that are opposed to each other are shown separately for other companies and their own companies. For example, in-house, in addition to the transmission / reception server 100 that implements the XML data structure restoration system of the present invention, the backbone server 11 that has conventionally controlled data processing related to commercial transactions, receives instructions from the person in charge, and performs the transmission / reception. It can be assumed that the operation terminal 12 and the like input to the server are included. Further, for example, it can be assumed that the other company terminal 200 provided by the other company includes the transmission / reception server 20 (as in the function of the transmission / reception server 100), the backbone system 21 that has conventionally controlled data processing related to commercial transactions, and the like. In addition, such a configuration example is an example of an image of a specific device configuration. In the following description, a device that receives XML data from an opposing company and converts the XML data into text or CSV format data. Is the system 100, and the other company's terminal 200 is the destination to which the system 100 transmits XML data generated by performing reverse conversion from text or CSV format data.

勿論、流通ビジネスメッセージ標準準拠のXMLデータは他社端末200からシステム100側(前記他社に対して自社のもの)に送られるだけでなく、システム100から他社端末200に送られる訳であるから、システム100としての機能を前記他社端末200が備えて、自社のシステム100と他社の他社端末200とで相互にXMLデータの送受信と本発明のXMLデータ構造の復元方法を実行するとしてもよい。   Of course, the XML data compliant with the distribution business message standard is not only sent from the other company's terminal 200 to the system 100 side (the company's own with respect to the other company) but also sent from the system 100 to the other company's terminal 200. The other company terminal 200 may have the function 100, and the system 100 of the other company and the other company terminal 200 of the other company may perform the XML data transmission / reception and the XML data structure restoration method of the present invention.

前記システム100は、XMLデータ構造の復元方法を実行する機能を実現すべく不揮発性メモリなどの記憶装置101に格納されたプログラム102をメモリ103に読み出し、演算装置たるCPU104により実行する。また、前記システム100は、コンピュータ装置が一般に備えている各種ボタン類、キーボードなどの入力インターフェイス105や、LEDやディスプレイなどの出力インターフェイス106、ならびに他社の端末との通信を担う通信装置107などを有している。   The system 100 reads the program 102 stored in the storage device 101 such as a nonvolatile memory into the memory 103 and executes it by the CPU 104 which is an arithmetic device in order to realize the function of executing the method for restoring the XML data structure. Further, the system 100 includes various buttons generally provided in a computer device, an input interface 105 such as a keyboard, an output interface 106 such as an LED and a display, and a communication device 107 that is responsible for communication with terminals of other companies. is doing.

続いて、前記システム100が例えばプログラム102に基づき構成・保持する機能部につき説明を行う。前記システム100は、ネットワーク140上の所定端末たる他社端末200よりXMLデータを受信し、記憶装置101に格納するデータ取得部110を備える。   Next, functional units that are configured and held by the system 100 based on the program 102 will be described. The system 100 includes a data acquisition unit 110 that receives XML data from another company terminal 200 that is a predetermined terminal on the network 140 and stores the XML data in the storage device 101.

また、前記システム100は、前記記憶装置101よりXMLデータをメモリ103に読み出して、前記XMLデータにおける開始タグを検索し、開始タグが検索された階層Xから下位階層に向けて、終了タグが検知される階層Yまでタグの読取り処理を実行する、タグ読取り部111を備える。   Further, the system 100 reads the XML data from the storage device 101 to the memory 103, searches for the start tag in the XML data, and detects the end tag from the hierarchy X where the start tag is searched toward the lower hierarchy. A tag reading unit 111 is provided that executes a tag reading process up to level Y.

また、前記システム100は、前記階層Xから前記階層Yまでの各階層で読み取ったタグに対応させて、各タグを一意に特定するタグ位置IDを採番し、前記階層Xから階層Yに至る経路についてのタグ位置ID群をメモリ103に格納する位置情報格納部112を備える。   Further, the system 100 assigns a tag position ID that uniquely identifies each tag in correspondence with the tag read in each hierarchy from the hierarchy X to the hierarchy Y, and reaches from the hierarchy X to the hierarchy Y. A location information storage unit 112 that stores a tag location ID group for the route in the memory 103 is provided.

また、前記システム100は、前記XMLデータの階層Xから階層Yまでの各階層で記述されている階層データをXMLデータから読取り、各階層のXMLデータを、前記メモリ103におけるタグ位置ID群が含む各階層のタグ位置IDに対応付けし、前記階層Xから階層Yに至る経路についてタグ位置IDと階層データとが対応付けされたレコードを生成し、テキストまたはCSV形式のデータとして記憶装置101に格納するレコード生成部113を備える。   In addition, the system 100 reads hierarchical data described in each hierarchy from the hierarchy X to the hierarchy Y of the XML data from the XML data, and the tag position ID group in the memory 103 includes the XML data of each hierarchy. Corresponding to the tag position ID of each hierarchy, a record in which the tag position ID and the hierarchy data are associated with each other for the route from the hierarchy X to the hierarchy Y is generated, and stored in the storage device 101 as data in text or CSV format The record generation unit 113 is provided.

また、前記システム100は、ネットワーク140上の所定端末200または入力インターフェイス105からXMLデータ構造の復元指示を受け付けるか、記憶装置101にて予め設定されていたXMLデータ構造の復元時期の到来を検知したならば、前記記憶装置101より前記レコードをメモリ103に読み出して、当該レコードが含むタグ位置ID毎にXMLデータ構造における階層を生成し、生成した各階層に対し、該当タグ位置IDに対応する階層データを前記レコードより抽出して設定し、開始タグが検索された前記階層Xから終了タグが検知された階層Yまでの各階層が階層データを含んだ構造をなすXMLデータを復元する復元処理部114を備える。   In addition, the system 100 receives an XML data structure restoration instruction from the predetermined terminal 200 or the input interface 105 on the network 140 or detects the arrival of the restoration time of the XML data structure preset in the storage device 101. Then, the record is read from the storage device 101 to the memory 103, a hierarchy in the XML data structure is generated for each tag position ID included in the record, and a hierarchy corresponding to the corresponding tag position ID is generated for each generated hierarchy. A restoration processing unit that extracts and sets data from the record and restores XML data having a structure in which each hierarchy from the hierarchy X where the start tag is searched to the hierarchy Y where the end tag is detected includes the hierarchy data 114.

また、前記システム100は、前記メモリ103にて復元したXMLデータを、ネットワーク140上の所定端末200に送信するか、出力インターフェイス106に出力する、出力処理部115を備える。   The system 100 further includes an output processing unit 115 that transmits the XML data restored in the memory 103 to a predetermined terminal 200 on the network 140 or outputs the XML data to the output interface 106.

なお、前記タグ読取り部111は、前記階層Yの終了タグの読取り処理を実行した後、当該階層Yを包含する上位の階層Aにおいて、前記階層Yのものとは別の開始タグを検索し、この開始タグが検索された階層Aから下位階層に向けて、前記階層Yのものとは別の終了タグが検知される階層Bまでタグの読取り処理を実行するものである、としてもよい。この場合、前記位置情報格納部112は、前記階層Aから前記階層Bまでの各階層で読み取ったタグに対応させて、各タグを一意に特定するタグ位置IDを採番し、既にタグ位置IDを採番済みの前記所定階層Xから前記階層Aの経路についてのタグ位置ID群に、前記階層Aから階層Bに至る経路について採番したタグ位置ID群をマージし、階層X〜A〜Bの経路についてのタグ位置ID群としてメモリ103に格納するものとなる。また、前記レコード生成部113は、前記XMLデータの階層X〜A〜Bの各階層で記述されている階層データをXMLデータから読取り、各階層のXMLデータを、前記メモリ103におけるタグ位置ID群が含む各階層のタグ位置IDに対応付けし、前記階層X〜A〜Bに至る経路についてタグ位置IDと階層データとが対応付けされたレコードを生成し、テキストまたはCSV形式のデータとして記憶装置101に格納するものとなる。また、前記復元処理部114は、前記記憶装置101より前記レコードをメモリ103に読み出して、当該レコードが含むタグ位置IDのうち、前記階層Aから階層BまでのものについてXMLデータ構造における階層を生成し、生成した階層Aから階層Bまでの各階層に対し、該当タグ位置IDに対応する階層データを前記レコードより抽出して設定し、前記階層Aから階層Bまでの各階層が階層データを含んだ構造をなすXMLデータを復元し、このXMLデータを、既に復元済みの前記階層Xから階層YまでのXMLデータに追記し、前記階層X〜A〜Bの各階層が階層データを含んだ構造をなすXMLデータを復元するものとなる。   In addition, after the tag reading unit 111 executes the reading process of the end tag of the hierarchy Y, in the upper hierarchy A including the hierarchy Y, the tag reading unit 111 searches for a start tag different from that of the hierarchy Y, The tag reading process may be executed from the hierarchy A where the start tag is searched to the lower hierarchy until the hierarchy B where the end tag different from that of the hierarchy Y is detected. In this case, the position information storage unit 112 assigns a tag position ID that uniquely identifies each tag in association with the tag read in each hierarchy from the hierarchy A to the hierarchy B, and already has the tag position ID. Are merged with the tag position ID group assigned to the route from the hierarchy A to the hierarchy B, and the hierarchy X to AB. This is stored in the memory 103 as a tag position ID group for the route. In addition, the record generation unit 113 reads the hierarchical data described in the hierarchical levels X to A to B of the XML data from the XML data, and the XML data of each hierarchical level is a tag position ID group in the memory 103. Is generated in association with the tag position ID of each hierarchy included in the record, and a record in which the tag position ID and the hierarchy data are associated with each other for the route to the hierarchy X to AB is generated and stored as text or CSV format data 101 is stored. In addition, the restoration processing unit 114 reads the record from the storage device 101 to the memory 103 and generates a hierarchy in the XML data structure for the tag position IDs included in the record from the hierarchy A to the hierarchy B. Then, for each of the generated layers A to B, the layer data corresponding to the corresponding tag position ID is extracted and set from the record, and each layer from the layer A to the layer B includes the layer data. The XML data having the structure is restored, the XML data is added to the already restored XML data from the hierarchy X to the hierarchy Y, and each of the hierarchies X to A to B includes the hierarchy data The XML data forming the above is restored.

また、前記システム100において、前記XMLデータは、流通ビジネスメッセージ標準に準拠したデータのうち、出荷梱包についてのデータであるとしてもよい。   In the system 100, the XML data may be data on shipping packaging among data compliant with the distribution business message standard.

なお、これまで示した前記システム100における各機能部110〜115は、ハードウェアとして実現してもよいし、メモリやHDD(Hard Disk Drive)などの適宜な記憶装置に格納したプログラムとして実現するとしてもよい。この場合、システム100のCPUがプログラム実行に合わせて記憶装置より該当プログラムをメモリに読み出して、これを実行することとなる。   The functional units 110 to 115 in the system 100 described so far may be realized as hardware, or as a program stored in an appropriate storage device such as a memory or an HDD (Hard Disk Drive). Also good. In this case, the CPU of the system 100 reads the corresponding program from the storage device into the memory in accordance with the program execution, and executes it.

−−−全体フロー例1−−−
以下、本実施形態におけるXMLデータ構造の復元方法の実際手順について、図に基づき説明する。なお、以下で説明するXMLデータ構造の復元方法に対応する各種動作は、前記システム100がメモリに読み出して実行するプログラムによって実現される。そしてこのプログラムは、以下に説明される各種の動作を行うためのコードから構成されている。
---- Example of overall flow 1 ---
The actual procedure of the XML data structure restoration method in the present embodiment will be described below with reference to the drawings. Various operations corresponding to the XML data structure restoration method described below are realized by a program that the system 100 reads into the memory and executes. And this program is comprised from the code | cord | chord for performing the various operation | movement demonstrated below.

図2は、本実施形態の全体シーケンス例1である。ここで、前記システム100のデータ取得部110は、ネットワーク140上の他社端末200よりXMLデータを受信し、記憶装置101に格納する(s100)。   FIG. 2 is an entire sequence example 1 of the present embodiment. Here, the data acquisition unit 110 of the system 100 receives the XML data from the other company's terminal 200 on the network 140 and stores it in the storage device 101 (s100).

また、前記システム100のタグ読取り部111は、前記記憶装置101よりXMLデータをメモリ103に読み出して、前記XMLデータにおける開始タグを検索し、開始タグが検索された階層Xから下位階層に向けて、終了タグが検知される階層Yまでタグの読取り処理を実行する(s101)。   Further, the tag reading unit 111 of the system 100 reads the XML data from the storage device 101 to the memory 103, searches for the start tag in the XML data, and starts from the hierarchy X where the start tag is searched toward the lower hierarchy. The tag reading process is executed up to level Y where the end tag is detected (s101).

次に、前記システム100の位置情報格納部112は、前記階層Xから前記階層Yまでの各階層で読み取ったタグに対応させて、各タグを一意に特定するタグ位置IDを採番し、前記階層Xから階層Yに至る経路についてのタグ位置ID群をメモリ103に格納する(s102)。   Next, the position information storage unit 112 of the system 100 assigns a tag position ID that uniquely identifies each tag in association with the tag read in each hierarchy from the hierarchy X to the hierarchy Y, and The tag position ID group for the route from the hierarchy X to the hierarchy Y is stored in the memory 103 (s102).

また、前記システム100のレコード生成部113は、前記XMLデータの階層Xから階層Yまでの各階層で記述されている階層データをXMLデータから読取り、各階層のXMLデータを、前記メモリ103におけるタグ位置ID群が含む各階層のタグ位置IDに対応付けし、前記階層Xから階層Yに至る経路についてタグ位置IDと階層データとが対応付けされたレコードを生成し、テキストまたはCSV形式のデータとして記憶装置101に格納する(s103)。   In addition, the record generation unit 113 of the system 100 reads the hierarchical data described in the hierarchical levels from the hierarchical level X to the hierarchical level Y of the XML data from the XML data, and reads the XML data of each hierarchical level in the tag in the memory 103. Corresponding to the tag position ID of each hierarchy included in the position ID group, a record in which the tag position ID and the hierarchy data are associated with each other for the route from the hierarchy X to the hierarchy Y is generated, and the data is text or CSV format data. The data is stored in the storage device 101 (s103).

また、その後、前記システム100の復元処理部114は、ネットワーク140上の他社端末200または入力インターフェイス105からXMLデータ構造の復元指示を受け付けるか、記憶装置101にて予め設定されていたXMLデータ構造の復元時期の到来を検知したならば、前記記憶装置101より前記レコードをメモリ103に読み出して、当該レコードが含むタグ位置ID毎にXMLデータ構造における階層を生成し、生成した各階層に対し、該当タグ位置IDに対応する階層データを前記レコードより抽出して設定し、開始タグが検索された前記階層Xから終了タグが検知された階層Yまでの各階層が階層データを含んだ構造をなすXMLデータを復元する(s104)。   Thereafter, the restoration processing unit 114 of the system 100 receives an instruction to restore the XML data structure from the other company's terminal 200 or the input interface 105 on the network 140, or has an XML data structure preset in the storage device 101. If the arrival of the restoration time is detected, the record is read from the storage device 101 to the memory 103, and a hierarchy in the XML data structure is generated for each tag position ID included in the record. Hierarchical data corresponding to the tag position ID is extracted from the record and set, and each hierarchy from the hierarchy X where the start tag is searched to the hierarchy Y where the end tag is detected has a structure including hierarchy data. The data is restored (s104).

また、前記システム100の出力処理部115は、前記メモリ103にて復元したXMLデータを、ネットワーク140上の他社端末200に送信するか、出力インターフェイス106に出力する(s105)。   The output processing unit 115 of the system 100 transmits the XML data restored in the memory 103 to the other company's terminal 200 on the network 140 or outputs it to the output interface 106 (s105).

−−−全体フロー例2−−−
図3は、本実施形態の全体シーケンス例2である。次に、前記タグ読取り部111が、前記階層Yの終了タグの読取り処理を実行した後、当該階層Yを包含する上位の階層Aにおいて、前記階層Yのものとは別の開始タグを検索した場合の処理について説明する。この場合、前記タグ読取り部111は、前記階層Yの終了タグの読取り処理を実行した後、当該階層Yを包含する上位の階層Aにおいて、前記階層Yのものとは別の開始タグを検索し、この開始タグが検索された階層Aから下位階層に向けて、前記階層Yのものとは別の終了タグが検知される階層Bまでタグの読取り処理を実行する(s200)。
--- Example of overall flow 2 ---
FIG. 3 is an overall sequence example 2 of the present embodiment. Next, after the tag reading unit 111 executes the reading process of the end tag of the hierarchy Y, the tag reading unit 111 searches the upper hierarchy A including the hierarchy Y for a start tag different from that of the hierarchy Y. The processing in the case will be described. In this case, the tag reading unit 111 executes the reading process of the end tag of the hierarchy Y, and then searches for a start tag different from that of the hierarchy Y in the upper hierarchy A including the hierarchy Y. The tag reading process is executed from the hierarchy A where the start tag is searched to the hierarchy below the hierarchy B where the end tag different from that of the hierarchy Y is detected (s200).

また前記位置情報格納部112は、前記階層Aから前記階層Bまでの各階層で読み取ったタグに対応させて、各タグを一意に特定するタグ位置IDを採番し、既にタグ位置IDを採番済みの前記所定階層Xから前記階層Aの経路についてのタグ位置ID群に、前記階層Aから階層Bに至る経路について採番したタグ位置ID群をマージし、階層X〜A〜Bの経路についてのタグ位置ID群としてメモリ103に格納する(s201)。   In addition, the position information storage unit 112 assigns a tag position ID that uniquely identifies each tag in correspondence with the tag read in each hierarchy from the hierarchy A to the hierarchy B, and already assigns the tag position ID. The tag position ID group assigned to the route from the hierarchy A to the hierarchy B is merged with the tag position ID group for the route from the predetermined hierarchy X to the hierarchy A, and the route of the hierarchy X to AB is merged. Is stored in the memory 103 as a tag position ID group (S201).

次に、前記レコード生成部113は、前記XMLデータの階層X〜A〜Bの各階層で記述されている階層データをXMLデータから読取り、各階層のXMLデータを、前記メモリ103におけるタグ位置ID群が含む各階層のタグ位置IDに対応付けし、前記階層X〜A〜Bに至る経路についてタグ位置IDと階層データとが対応付けされたレコードを生成し、テキストまたはCSV形式のデータとして記憶装置101に格納する(s202)。 またその後、前記復元処理部114は、前記記憶装置101より前記レコードをメモリ103に読み出して、当該レコードが含むタグ位置IDのうち、前記階層Aから階層BまでのものについてXMLデータ構造における階層を生成し、生成した階層Aから階層Bまでの各階層に対し、該当タグ位置IDに対応する階層データを前記レコードより抽出して設定し、前記階層Aから階層Bまでの各階層が階層データを含んだ構造をなすXMLデータを復元し、このXMLデータを、既に復元済みの前記階層Xから階層YまでのXMLデータに追記し、前記階層X〜A〜Bの各階層が階層データを含んだ構造をなすXMLデータを復元する(s203)。   Next, the record generation unit 113 reads the hierarchical data described in the hierarchical levels X to A to B of the XML data from the XML data, and uses the XML data of each hierarchical level as the tag position ID in the memory 103. Corresponding to the tag position ID of each hierarchy included in the group, a record in which the tag position ID and the hierarchy data are associated with each other for the route to the hierarchy X to AB is generated and stored as text or CSV format data The data is stored in the device 101 (s202). After that, the restoration processing unit 114 reads the record from the storage device 101 to the memory 103, and among the tag position IDs included in the record, the hierarchy in the XML data structure is assigned to the hierarchy from the hierarchy A to the hierarchy B. The hierarchy data corresponding to the corresponding tag position ID is extracted from the record and set for each hierarchy from the hierarchy A to the hierarchy B generated, and each hierarchy from the hierarchy A to the hierarchy B stores the hierarchy data. The XML data having the included structure is restored, and the XML data is added to the already restored XML data from the hierarchy X to the hierarchy Y, and each of the hierarchies X to A to B includes the hierarchy data. The XML data having the structure is restored (s203).

−−−XMLデータおよびテキストまたはCSV形式データの構造例−−−
次に、XMLデータおよびXMLデータを変換したテキストまたはCSV形式データのの構造例について説明する。図4は流通ビジネスメッセージ標準で定義されているXMLデータの構造例を示している。この例のXMLデータ40は、発注、受領、返品、支払、請求、出荷伝票、出荷梱包といったデータ種の内、出荷梱包のXMLデータ構造を示す。本XMLデータ構造は、最上位階層(階層1)をSBDH(Standard Business Document Header)として定義しており、そのSBDH内に内包される形で出荷梱包ファイルヘッダ(ListOfPackageShipments:階層2)を定義している。同様に、前記階層2に内包されているのが出荷梱包発注元情報(PackageShipmentByReciever:階層3)となり、出荷梱包情報(PackageInfo:階層4)および出荷梱包明細情報(ItemInfo:階層5)もそれぞれ1段階上位の階層に内包されている。
--- Example structure of XML data and text or CSV format data ---
Next, an example of the structure of XML data and text or CSV format data obtained by converting the XML data will be described. FIG. 4 shows an example of the structure of XML data defined in the distribution business message standard. The XML data 40 in this example indicates the XML data structure of the shipping packing among the data types such as ordering, receiving, returning, payment, billing, shipping slip, shipping packing. In this XML data structure, the highest hierarchy (tier 1) is defined as SBDH (Standard Business Document Header), and a shipping packing file header (ListOfPackageShipments: hierarchy 2) is defined in a form included in the SBDH. Yes. Similarly, what is included in the hierarchy 2 is shipping package order source information (PackageShipmentByReciever: Hierarchy 3), and the shipping packing information (PackageInfo: Hierarchy 4) and the shipping packing item information (ItemInfo: Hierarchy 5) are also in one stage. It is included in the upper hierarchy.

また図5に、本実施形態におけるテキストまたはCSVファイルの構造例を示している。ここで示すテキストまたはCSVファイル50は、本発明のXMLデータ構造の復元方法によりXMLデータ40を変換して生成したものであり、XMLデータ構造中におけるタグ位置情報たるタグ位置IDを取入れたテキストまたはCSVファイルの構造体(出荷梱包)となっている。このCSVファイル50の構造は、図4において階層的に表したXMLデータ40の構造を2次元の表形式で表しており、XMLデータ40の各階層毎にタグ位置IDを取入れた構造となる。   FIG. 5 shows an example of the structure of a text or CSV file in this embodiment. The text or CSV file 50 shown here is generated by converting the XML data 40 by the XML data structure restoration method of the present invention. The text or CSV file 50 is a text or tag text ID that is tag position information in the XML data structure. It is a CSV file structure (shipping packaging). The structure of the CSV file 50 is a structure in which the structure of the XML data 40 represented hierarchically in FIG. 4 is represented in a two-dimensional table format, and the tag position ID is incorporated for each layer of the XML data 40.

−−−変換処理例1−−−
次に、XMLデータからのテキストまたはCSV形式データへの変換処理について詳細を説明する。図6は、本実施形態のXMLデータ構造の復元方法の処理手順例1を示すフローチャートである。まずこの説明での前提として、他社端末200がネットワーク140経由で送信した流通ビジネスメッセージ標準準拠のXMLデータを、システム100のデータ取得部110が受信し、記憶装置101等に格納する(s300)。
--- Conversion processing example 1 ---
Next, details of conversion processing from XML data to text or CSV format data will be described. FIG. 6 is a flowchart showing a processing procedure example 1 of the XML data structure restoration method of the present embodiment. First, as a premise in this description, the data acquisition unit 110 of the system 100 receives XML data conforming to the distribution business message standard transmitted from the other company terminal 200 via the network 140, and stores it in the storage device 101 or the like (s300).

次に、前記システム100のタグ読取り部111は、記憶装置101に格納したXMLデータが、例えば、メッセージ種情報208(図4参照)のエリアに引数を含むか判定する(s301)。   Next, the tag reading unit 111 of the system 100 determines whether the XML data stored in the storage device 101 includes an argument in the area of the message type information 208 (see FIG. 4), for example (s301).

前記タグ読取り部111は、前記判定処理にて引数がXMLデータ中に存在すると判明した場合は(s301:Yes)、メモリ103上に該当引数を待避する(s302)。他方、記判定処理にて引数がXMLデータに存在しないと判明した場合は(s301:No)、本フローを終了する。   If it is determined in the determination process that the argument exists in the XML data (s301: Yes), the tag reading unit 111 saves the corresponding argument on the memory 103 (s302). On the other hand, if it is determined in the determination process that the argument does not exist in the XML data (s301: No), this flow ends.

前記ステップs302に続いて前記タグ読取り部111は、前記ステップs302でメモリ103上に待避した引数と、記憶装置101にて予め備えている引数一覧で定義している引数とが一致するか判定する(s303)。引数一覧としては、発注:order、受領:RecievingNotification、・・・全て:ALL、などが想定できる。一例として、XMLデータとテキストまたはCSV形式データとの相互変換時に、XMLデータ構造の復元が従来は困難であった「出荷梱包」に関する引数のみを前記引数一覧に定義しておき、この出荷梱包に関するXMLデータの存在をシステム100が検知することを想定する。   Subsequent to step s302, the tag reading unit 111 determines whether the argument saved in the memory 103 in step s302 matches the argument defined in the argument list provided in advance in the storage device 101. (S303). As the argument list, order: order, receipt: RecievingNotification, ... all: ALL, etc. can be assumed. As an example, at the time of mutual conversion between XML data and text or CSV format data, only the argument related to “shipping packing”, which has been difficult to restore the XML data structure in the past, is defined in the argument list. Assume that the system 100 detects the presence of XML data.

前記タグ読取り部111は、前記ステップs303でメモリ103上に待避した引数と前記引数一覧で設定された引数とが一致した場合(s303:Yes)、該当XMLデータに関して図4の例で示した最上位階層(SBDH)から下位の階層に向けて順次開始タグを検索し、開始タグが検索された階層X(図4の場合だと階層1)から下位階層に向けて、終了タグが検知される階層Y(図4の場合だと階層5)までタグの読取り処理を実行する(s304)。なお、メモリ103上に待避した引数と前記引数一覧で設定された引数とが一致しなかった場合(s303:No)、本フローを終了する。   When the argument saved in the memory 103 in step s303 matches the argument set in the argument list (s303: Yes), the tag reading unit 111 performs the process shown in the example of FIG. The start tag is sequentially searched from the upper hierarchy (SBDH) toward the lower hierarchy, and the end tag is detected from the hierarchy X (hierarchy 1 in the case of FIG. 4) where the start tag is searched toward the lower hierarchy. The tag reading process is executed up to level Y (level 5 in the case of FIG. 4) (s304). If the argument saved in the memory 103 does not match the argument set in the argument list (s303: No), this flow ends.

続いて前記システム100の位置情報格納部112は、前記階層Xたる階層1から前記階層Yたる階層5までの各階層で読み取ったタグに対応させて、各タグを一意に特定するタグ位置IDを採番し、前記階層Xから階層Yに至る経路についてのタグ位置ID群をメモリ103に格納する(s305)。   Subsequently, the position information storage unit 112 of the system 100 sets a tag position ID that uniquely identifies each tag in correspondence with the tag read in each hierarchy from the hierarchy 1 as the hierarchy X to the hierarchy 5 as the hierarchy Y. Numbering is performed, and the tag position ID group for the route from the hierarchy X to the hierarchy Y is stored in the memory 103 (s305).

そして、前記システム100のレコード生成部113は、前記XMLデータの階層Xから階層Yまでの各階層で記述されている階層データをXMLデータから読取り、各階層のXMLデータを、前記メモリ103におけるタグ位置ID群が含む各階層のタグ位置IDに対応付けし、前記階層Xから階層Yに至る経路についてタグ位置IDと階層データとが対応付けされたレコードを生成し、テキストまたはCSV形式のデータとして記憶装置101に格納する(s306)。なお、前記レコードにおけるタグ位置ID群の設定先としては、図5に示したCSVファイル50におけるタグ位置ID欄297〜301となる。   Then, the record generation unit 113 of the system 100 reads the hierarchical data described in the hierarchical levels from the hierarchical level X to the hierarchical level Y of the XML data from the XML data, and reads the XML data of each hierarchical level in the tag in the memory 103. Corresponding to the tag position ID of each hierarchy included in the position ID group, a record in which the tag position ID and the hierarchy data are associated with each other for the route from the hierarchy X to the hierarchy Y is generated, and the data is text or CSV format data. The data is stored in the storage device 101 (s306). The tag position ID group in the record is set in the tag position ID fields 297 to 301 in the CSV file 50 shown in FIG.

ここで、前記タグ位置IDの採番やレコードへの設定処理の詳細について説明しておく。ここでの説明に際して採用するXMLデータとしては図8に示すXMLデータ41を想定する。また、このXMLデータ41を変換して得られるCSVファイル(またはテキスト)としては図10に示すCSVファイル51を想定する。   Here, the details of the tag position ID numbering and record setting processing will be described. As XML data used in the description here, XML data 41 shown in FIG. 8 is assumed. Also, a CSV file 51 shown in FIG. 10 is assumed as a CSV file (or text) obtained by converting the XML data 41.

例えば図8のXMLデータ41のように、階層5(開始タグ217、219、221)のレベルで繰返しデータが記述されている場合、前記タグ読取り部111は、階層1の開始タグ213を検知して読込み、階層1における階層データ282(データ“AAA”)をメモリ103に待避させる。そして、次の開始タグである階層2の開始タグ214を読込むと、これに応じてメモリカウンター(システム100が備えてタグ読取り部111が制御するものであり、初期値:000)に1を加算して“001”を採番する。   For example, when the repeated data is described in the level 5 (start tags 217, 219, and 221) as in the XML data 41 in FIG. 8, the tag reading unit 111 detects the start tag 213 in the layer 1. The hierarchical data 282 (data “AAA”) in the hierarchical level 1 is saved in the memory 103. Then, when the next start tag 214 of level 2 is read, 1 is added to the memory counter (the system 100 is equipped with the tag reading unit 111 and controlled by the initial value: 000). Then, “001” is assigned.

前記レコード生成部113は、前記タグ読取り部111が採番した“001”のデータをタグ位置IDとして、CSVファイル51(図10)における1レコード目の階層1のタグ位置ID欄243にセットする。また、タグ位置IDのセット後、メモリ103に待避させた階層1における階層データ282(“AAA”)を前記CSVファイル51における1レコード目の階層1のデータ欄244にセットする。そして、階層2以降、階層4まで、階層1で先に示した内容と同様の処理を実施し、CSVファイル51における1レコード目の階層2、階層3、階層4それぞれのタグ位置ID欄245、247、249に、それぞれタグ位置ID“002”、“003”、“004”、をセットする。また、データ欄246、248、250に、それぞれ階層データ“BBB”、“CCC”、“DDD”をセットする。   The record generation unit 113 sets the data “001” numbered by the tag reading unit 111 as a tag position ID in the tag position ID column 243 of the first record in the CSV file 51 (FIG. 10). . After the tag position ID is set, the hierarchical data 282 (“AAA”) in the hierarchical level 1 saved in the memory 103 is set in the hierarchical column 1 data column 244 of the first record in the CSV file 51. Then, the same processing as described above in the hierarchy 1 is performed from the hierarchy 2 to the hierarchy 4, and the tag position ID column 245 for each of the hierarchy 2, the hierarchy 3, and the hierarchy 4 of the first record in the CSV file 51, Tag position IDs “002”, “003”, and “004” are set in 247 and 249, respectively. In addition, the hierarchical data “BBB”, “CCC”, and “DDD” are set in the data columns 246, 248, and 250, respectively.

階層5についても同様に、前記タグ読取り部111は、階層5の最初の開始タグ217を検知し、階層5における階層データ286(“EEE”)をメモリ103に待避させる。そして、次に検知できる開始タグが階層5の終了タグ218となるので、階層4までについて加算されていた前記メモリカウンタ(この時点で“004”)に1を加算してタグ位置ID“005”を採番する。   Similarly, for the layer 5, the tag reading unit 111 detects the first start tag 217 of the layer 5 and saves the layer data 286 (“EEE”) in the layer 5 in the memory 103. Since the start tag that can be detected next is the end tag 218 of the hierarchy 5, 1 is added to the memory counter ("004" at this time) that has been added up to the hierarchy 4, and the tag position ID "005". Number.

そしてレコード生成部113は、前記タグ位置ID“005”をCSVファイル51における1レコード目の階層5のタグ位置ID欄251にセットする。このタグ位置ID“005”のセット後、メモリ103に待避させた階層5における階層データ286(“EEE”)をCSVファイル51における1レコード目の階層5のデータ欄252にセットする。   Then, the record generation unit 113 sets the tag position ID “005” in the tag position ID column 251 of the first record in the hierarchy 5 in the CSV file 51. After the tag position ID “005” is set, the hierarchy data 286 (“EEE”) in the hierarchy 5 saved in the memory 103 is set in the data field 252 in the hierarchy 5 of the first record in the CSV file 51.

次に、前記タグ読取り部111は、階層4の終了タグ223を読込む前に、階層5における他の開始タグ219を検知する。また、この開始タグ219に対応した階層5の階層データ287(“FFF”)をメモリ103に待避させ、メモリカウンター(この時点で“005”)に1を加算してタグ位置ID“006”を採番する。   Next, the tag reading unit 111 detects another start tag 219 in the hierarchy 5 before reading the end tag 223 in the hierarchy 4. Further, the hierarchical data 287 (“FFF”) corresponding to the start tag 219 is saved in the memory 103, 1 is added to the memory counter (“005” at this time), and the tag position ID “006” is set. Numbering.

前記レコード生成部113は、前記CSVファイル51において新たなレコード(2レコード目となる)を生成し、前記タグ位置ID“006”をこの2レコード目の階層5のタグ位置ID欄261にセットする。このタグ位置IDのセット後、メモリ103に待避させていた階層5における階層データ287(“FFF”)を、前記2レコード目の階層5のデータ欄262にセットする。   The record generation unit 113 generates a new record (second record) in the CSV file 51 and sets the tag position ID “006” in the tag position ID column 261 of the hierarchy 5 of the second record. . After the tag position ID is set, the hierarchical data 287 (“FFF”) in the hierarchical level 5 saved in the memory 103 is set in the hierarchical column 5 data column 262 of the second record.

なお、前記レコード生成部113は、前記2レコード目を生成する際、2レコード目の階層1、階層2、階層3、階層4それぞれのタグ位置ID欄253、255、257、259には、前記1レコード目の階層1、階層2、階層3、階層4のそれぞれのタグ位置ID“001”、“002”、“003”、“004”、をセットする。また、2レコード目のデータ欄254、256、258、260には、前記1レコード目の階層データ“AAA”、“BBB”、“CCC”、“DDD”、をセットする。   When the record generation unit 113 generates the second record, the tag position ID fields 253, 255, 257, and 259 of the second record, the hierarchy 1, the hierarchy 2, the hierarchy 3, and the hierarchy 4, respectively, The tag position IDs “001”, “002”, “003”, and “004” of the first layer, the first layer 2, the second layer 3, and the fourth layer are set. In the data fields 254, 256, 258, and 260 of the second record, the hierarchical data “AAA”, “BBB”, “CCC”, and “DDD” of the first record are set.

こうして、前記XMLデータ41について、XMLデータ構造の情報を取り込んだCSVファイル51が生成されることとなる。   Thus, a CSV file 51 incorporating XML data structure information is generated for the XML data 41.

−−−変換処理例2−−−
また、図9に示すXMLデータ42のように、開始タグ230と終了タグ233で区切られた階層4(階層データ292と1つの階層5を含むもの)と、同じく階層4あって、開始タグ234と終了タグ239で区切られた他の階層4(階層データ294と2つの階層5を含むもの)とを含むXMLデータについて、前記タグ位置IDの採番やレコードへの設定処理の詳細について説明しておく。
--- Conversion processing example 2 ---
Further, as in the XML data 42 shown in FIG. 9, there is a hierarchy 4 (including hierarchy data 292 and one hierarchy 5) divided by the start tag 230 and the end tag 233, and the start tag 234. Details of the tag position ID numbering and the record setting processing are described for XML data including the other layer 4 (including the layer data 294 and the two layers 5) separated by the end tag 239. Keep it.

この場合まず、前記タグ読取り部111は、階層1の開始タグ227を検知して読込み、階層1における階層データ289(“AAA”)をメモリ103に待避させる。そして、次の開始タグである階層2の開始タグ228を検知して読込んで、前記メモリカウンター(初期値:000)に1を加算してタグ位置ID“001”を採番する。   In this case, first, the tag reading unit 111 detects and reads the start tag 227 of the hierarchy 1 and stores the hierarchy data 289 (“AAA”) in the hierarchy 1 in the memory 103. Then, the start tag 228 of level 2 which is the next start tag is detected and read, and 1 is added to the memory counter (initial value: 000) to assign the tag position ID “001”.

また、前記レコード生成部113は、前記タグ位置ID“001”を、図11に示すCSVファイル52における1レコード目の階層1のタグ位置ID欄263にセットする。レコード生成部113は、このタグ位置IDのセット後、メモリ103に待避させていた階層1における階層データ“AAA”を前記CSVファイル52における1レコード目の階層1のデータ欄264にセットする。   Further, the record generation unit 113 sets the tag position ID “001” in the tag position ID column 263 of the first layer in the CSV file 52 shown in FIG. After the tag position ID is set, the record generation unit 113 sets the hierarchy data “AAA” in the hierarchy 1 saved in the memory 103 in the data field 264 of the first record in the CSV file 52.

前記レコード生成部113は、階層2以降、階層4まで前記階層1について示した処理内容と同様の処理を実施し、前記CSVファイル52における1レコード目の階層2、階層3、階層4それぞれの、タグ位置ID欄265、267、269に、タグ位置ID“002”、“003”、“004”をセットする。また、前記CSVファイル52における1レコード目の階層2、階層3、階層4それぞれのデータ欄266、268、270に、階層データ“BBB”、“CCC”、“DDD”をセットする。   The record generation unit 113 performs processing similar to the processing contents shown for the layer 1 up to the layer 2 and subsequent layers, and each of the layer 2, layer 3, and layer 4 of the first record in the CSV file 52, Tag position IDs “002”, “003”, and “004” are set in the tag position ID columns 265, 267, and 269. In addition, the hierarchy data “BBB”, “CCC”, and “DDD” are set in the data fields 266, 268, and 270 of the hierarchy 2, 3, and 4, respectively, of the first record in the CSV file 52.

前記タグ読取り部111は、階層5についても上記と同様に、前記階層4の開始タグ230の読み込み後に、階層5の開始タグ231を検知して読込み、前記階層5における階層データ293(“FFF”)をメモリ103に待避させる。また、次に読み込むタグが階層5の終了タグ232となるので、階層4までについて加算されていたメモリカウンタ(“004”)に1を加算してタグ位置ID“005”を採番する。   Similarly to the above, the tag reading unit 111 detects and reads the start tag 231 of the layer 5 after reading the start tag 230 of the layer 4 and reads the layer data 293 (“FFF”) in the layer 5. ) Is saved in the memory 103. Further, since the next tag to be read is the end tag 232 of the hierarchy 5, 1 is added to the memory counter ("004") added up to the hierarchy 4, and the tag position ID "005" is assigned.

前記レコード生成部113は、前記タグ位置ID“005”を、前記CSVファイル52における1レコード目の階層5のタグ位置ID欄271にセットする。また、タグ位置IDのセット後、メモリ103に待避していた階層5の階層データ“FFF”を、CSVファイル52の1レコード目の階層5のデータ欄272にセットする。   The record generation unit 113 sets the tag position ID “005” in the tag position ID column 271 of the first layer in the CSV file 52. Further, after setting the tag position ID, the hierarchical data “FFF” of the hierarchical level 5 saved in the memory 103 is set in the hierarchical column 5 data column 272 of the first record of the CSV file 52.

前記タグ読取り部111は、前記階層4の終了タグ233を読込んだ後に、階層3の終了タグ240を読み込む前に、別の階層4の開始タグ234を新たに検知して読込むこととなる。その為、この新たな階層4における階層データ294(“GGG”)をメモリ103に待避させる。また、前記メモリカウンタ(この時点で“005”)に1を加算してタグ位置ID“006”を採番する。   After reading the end tag 233 of level 4 after reading the end tag 233 of level 4, the tag reading unit 111 newly detects and reads the start tag 234 of another level 4. . Therefore, the hierarchy data 294 (“GGG”) in the new hierarchy 4 is saved in the memory 103. Further, 1 is added to the memory counter (“005” at this time), and the tag position ID “006” is assigned.

その後、レコード生成部113は、前記CSVファイル52における2レコード目を生成し、この2レコード目の階層4のタグ位置ID欄279に前記タグ位置ID“006”をセットする。そして、前記タグ位置ID“006”のセット後、メモリ103に待避させていた前記階層4の階層データ“GGG”を、前記CSVファイル52における2レコード目の階層4のデータ欄280にセットする。   After that, the record generation unit 113 generates the second record in the CSV file 52 and sets the tag position ID “006” in the tag position ID column 279 of the hierarchy 4 of the second record. Then, after the tag position ID “006” is set, the hierarchical data “GGG” saved in the memory 103 is set in the data field 280 of the second record in the CSV file 52.

なお、前記レコード生成部113が前記階層4の2レコード目をセットする際、2レコード目の階層1、階層2、階層3それぞれの、タグ位置ID欄273、275、277には、1レコード目の階層1、階層2、階層3それぞれのタグ位置ID“001”、“002”、“003”をそれぞれセットする。また前記2レコード目の階層1、階層2、階層3それぞれの、データ欄274、276、278には、1レコード目の階層1、階層2、階層3それぞれの、階層データ“AAA”、“BBB”、“CCC”、をセットする。   When the record generation unit 113 sets the second record of the level 4, the tag position ID fields 273, 275, and 277 of the level 1, level 2, and level 3 of the second record respectively include the first record. Tag position IDs “001”, “002”, and “003” are set for each of layer 1, layer 2, and layer 3, respectively. In the data fields 274, 276, and 278 for the first record, the first record, the second record, and the second record, the hierarchy data “AAA” and “BBB” for the first record, the first record, the second record, and the second record, respectively. "," CCC ".

前記タグ読取り部111は、前記階層4の階層データ294を読み込んだ後、新たな階層5の開始タグ235を検知して読込むこととなる。そこで、この階層5の階層データ295(“HHH”)をメモリ103に待避させる。また、次に読み込むタグが階層5の終了タグ236となるので、前記2レコード目の階層4についてまで加算されていたメモリカウンタ(この時点で“006”)に1を加算してタグ位置ID“007”を採番する。   After reading the hierarchical data 294 of the hierarchy 4, the tag reading unit 111 detects and reads the new start tag 235 of the hierarchy 5. Therefore, the hierarchical data 295 (“HHH”) of the hierarchical level 5 is saved in the memory 103. Further, since the next tag to be read is the end tag 236 of the hierarchy 5, 1 is added to the memory counter ("006" at this time) that has been added up to the hierarchy 4 of the second record, and the tag position ID " Number 007 ".

そしてレコード生成部113は、CSVファイル52における1レコード目の階層5のタグ位置ID欄281に、前記タグ位置ID“007”をセットする。このタグ位置IDのセット後、メモリ103に待避させていた階層5の階層データ“HHH”を、CSVファイル52における2レコード目の階層5のデータ欄282にセットする。   Then, the record generation unit 113 sets the tag position ID “007” in the tag position ID column 281 of the hierarchy 5 of the first record in the CSV file 52. After the tag position ID is set, the hierarchy data “HHH” of the hierarchy 5 saved in the memory 103 is set in the data field 282 of the hierarchy 5 of the second record in the CSV file 52.

前記タグ読取り部111は、前記階層5の終了タグ236を読込んだ後に、階層4の終了タグ239を読み込む前に、別の階層5の開始タグ237を新たに検知して読込むこととなる。その為、この新たな階層5における階層データ296(“III”)をメモリ103に待避させる。また、前記メモリカウンタ(この時点で“007”)に1を加算してタグ位置ID“008”を採番する。   After reading the end tag 236 of level 5 and before reading the end tag 239 of level 4, the tag reading unit 111 newly detects and reads the start tag 237 of another level 5. . Therefore, the hierarchy data 296 (“III”) in the new hierarchy 5 is saved in the memory 103. Further, 1 is added to the memory counter (“007” at this time), and the tag position ID “008” is assigned.

その後、レコード生成部113は、前記CSVファイル52における3レコード目を生成し、この3レコード目の階層5のタグ位置ID欄291に前記タグ位置ID“008”をセットする。そして、前記タグ位置ID“008”のセット後、メモリ103に待避させていた前記階層5の階層データ“III”を、前記CSVファイル52における3レコード目の階層5のデータ欄292にセットする。   Thereafter, the record generation unit 113 generates the third record in the CSV file 52 and sets the tag position ID “008” in the tag position ID column 291 of the third layer in the third record. Then, after setting the tag position ID “008”, the hierarchical data “III” of the hierarchical level 5 saved in the memory 103 is set in the data field 292 of the hierarchical level 5 of the third record in the CSV file 52.

なお、前記レコード生成部113が前記階層5の3レコード目をセットする際、3レコード目の階層1、階層2、階層3それぞれの、タグ位置ID欄283、285、287、289には、2レコード目の階層1、階層2、階層3、階層4それぞれのタグ位置ID“001”、“002”、“003”、“006”をそれぞれセットする。また前記3レコード目の階層1、階層2、階層3それぞれの、データ欄284、286、288、290には、2レコード目の階層1、階層2、階層3それぞれの、階層データ“AAA”、“BBB”、“CCC”、“DDD”、をセットする。   Note that when the record generation unit 113 sets the third record of the hierarchy 5, the tag position ID fields 283, 285, 287, and 289 of the third record, the hierarchy 1, the hierarchy 2, and the hierarchy 3 respectively have 2 Tag position IDs “001”, “002”, “003”, and “006” are set for each of layer 1, layer 2, layer 3, and layer 4 of the record. In the data fields 284, 286, 288, and 290 for the first record, the first record, the second record, and the second record, the hierarchy data “AAA” of the second record, the first record, the second record, and the second record, respectively. “BBB”, “CCC”, “DDD” are set.

こうして、前記XMLデータ42について、XMLデータ構造の情報を取り込んだCSVファイル52が生成されることとなる。   Thus, a CSV file 52 incorporating the XML data structure information is generated for the XML data 42.

−−−逆変換処理について−−−
次に、XMLデータから生成したCSVファイルを逆変換して元のXMLデータを復元する処理について説明する。図7は、本実施形態のXMLデータ構造の復元方法の処理手順例2を示す図である。ここで、前記システム100の復元処理部114は、ネットワーク140上の他社端末200または入力インターフェイス105からXMLデータ構造の復元指示を受け付けるか、記憶装置101にて予め設定されていたXMLデータ構造の復元時期の到来を検知(例:コンピュータが備えるクロック機能やカレンダ機能で所定日時到来を検知)したならば(s400)、復元指示を受けたXMLデータないしは復元時期が到来したXMLデータについて生成されているテキストまたはCSVファイルを、記憶装置101よりメモリ103に読み出す(s401)。勿論、XMLデータとこれに基づいて生成したテキストまたはCSVファイルとは、記憶装置101にて対照表が予め生成されている。
--- About inverse transformation process ---
Next, a process for restoring the original XML data by inversely converting the CSV file generated from the XML data will be described. FIG. 7 is a diagram illustrating a processing procedure example 2 of the restoration method of the XML data structure according to the present embodiment. Here, the restoration processing unit 114 of the system 100 receives an XML data structure restoration instruction from the other company's terminal 200 or the input interface 105 on the network 140, or restores the XML data structure preset in the storage device 101. If the arrival of the time is detected (eg, the arrival of a predetermined date and time is detected by the clock function or calendar function of the computer) (s400), the XML data that has received the restoration instruction or the XML data that has come to the restoration time is generated. The text or CSV file is read from the storage device 101 to the memory 103 (s401). Of course, a comparison table is generated in advance in the storage device 101 for the XML data and the text or CSV file generated based on the XML data.

また、前記復元処理部114は、前記テキストまたはCSVファイルを構成する前記レコードを1つずつ読込み、メモリ103に待避させる(s402)。そして、前記レコードが含むタグ位置ID間で重複を判定し、重複無いタグ位置ID毎にXMLデータ構造における階層を生成する(s403)。また、生成した各階層に対し、該当タグ位置IDに対応する階層データを前記レコードより抽出して設定し(s404)、開始タグが検索された階層Xから終了タグが検知された階層Yまでの各階層が階層データを含んだ構造をなすXMLデータを復元する(s405)。   The restoration processing unit 114 reads the records constituting the text or CSV file one by one and saves them in the memory 103 (s402). Then, duplication is determined between the tag position IDs included in the record, and a hierarchy in the XML data structure is generated for each tag position ID that does not overlap (s403). Further, for each generated hierarchy, the hierarchy data corresponding to the corresponding tag position ID is extracted and set from the record (s404), and from the hierarchy X where the start tag is searched to the hierarchy Y where the end tag is detected. XML data having a structure in which each hierarchy includes hierarchy data is restored (s405).

そして前記システム100の出力処理部115は、前記メモリ103にて復元したXMLデータを、ネットワーク上の他社端末200に送信するか、出力インターフェイス106に出力し、処理を終了する。   Then, the output processing unit 115 of the system 100 transmits the XML data restored in the memory 103 to the other company's terminal 200 on the network or outputs it to the output interface 106, and ends the processing.

続いて、前記レコードからのタグ位置IDの取込やCSVファイル生成の処理詳細について説明する。なお、この説明においては、逆変換対象のCSVファイルとして図12に示すCSVファイル60を想定し、逆変換により復元されたXMLデータとして図13に示すXMLデータ70を想定するものとする。例えば、図12に示すように、CSVファイル60が2つのレコードを含むものである場合、前記復元処理部114は、まず1レコード目を読込み、階層1、階層2、階層3、階層4、階層5それぞれの、タグ位置ID欄305、306、307、308、309におけるタグ位置ID“001”、“002”、“003”、“004”、“005”、をメモリ103に待避させる。また同様に、前記1レコード目が含む、階層データを各階層1〜5毎に、“AAA”、“BBB”、“CCC”、“DDD”、“EEE”、と読み出してメモリ103に退避させる。そして、メモリ103に退避させていた、各タグ位置ID毎に階層を生成し、この階層に対応する階層データを設定してXMLデータ350に生成する。   Next, details of processing for importing the tag position ID from the record and CSV file generation will be described. In this description, it is assumed that the CSV file 60 shown in FIG. 12 is assumed as the CSV file to be inversely transformed, and the XML data 70 shown in FIG. 13 is assumed as the XML data restored by the inverse transformation. For example, as shown in FIG. 12, when the CSV file 60 includes two records, the restoration processing unit 114 first reads the first record, and each of the hierarchy 1, the hierarchy 2, the hierarchy 3, the hierarchy 4, and the hierarchy 5 respectively. Tag position IDs “001”, “002”, “003”, “004”, “005” in the tag position ID fields 305, 306, 307, 308, and 309 are saved in the memory 103. Similarly, the hierarchical data included in the first record is read as “AAA”, “BBB”, “CCC”, “DDD”, “EEE” and saved in the memory 103 for each of the hierarchical levels 1 to 5. . Then, a hierarchy is generated for each tag position ID saved in the memory 103, hierarchical data corresponding to this hierarchy is set, and the XML data 350 is generated.

次に、復元処理部114は、前記CSVファイル60の2レコード目を読込み、1レコード目と同様、階層1、階層2、階層3、階層4それぞれの、タグ位置ID310、311、312、313、314として、“001”、“002”、“006”、“007”、“008”、を読み取る。そしてこのタグ位置IDのデータをメモリ103に待避させる(前記メモリ103において1レコード目の記憶領域とは別の記憶領域に退避)。   Next, the restoration processing unit 114 reads the second record of the CSV file 60, and similarly to the first record, the tag position IDs 310, 311, 312, 313, tiers of the tier 1, tier 2, tier 3, and tier 4, respectively. As 314, “001”, “002”, “006”, “007”, “008” are read. Then, the data of the tag position ID is saved in the memory 103 (saved in a storage area different from the storage area of the first record in the memory 103).

また、復元処理部114は、1レコード目で待避させた各階層のタグ位置ID群315のタグ位置IDそれぞれと、2レコード目で待避させた各階層のタグ位置ID群316のタグ位置IDそれぞれとで比較し、異なる階層のタグ位置ID317が存在した場合は、この異なる階層から新たにタグ(図中の囲み318)を生成する。生成されたXMLデータ360は、前記出力処理部115が他社端末200に送信し、処理を終了する。   Further, the restoration processing unit 114 has a tag position ID of each tag position ID group 315 saved in the first record and a tag position ID of each layer tag position ID group 316 saved in the second record. If there is a tag position ID 317 in a different hierarchy, a new tag (box 318 in the figure) is generated from this different hierarchy. The generated XML data 360 is transmitted to the other company's terminal 200 by the output processing unit 115, and the process is terminated.

こうして、CSVファイル等から、正確なデータ構造を再現しつつXMLデータを復元することができる。   Thus, XML data can be restored from a CSV file or the like while reproducing an accurate data structure.

本実施形態によれば、所定の端末から受信した、例えば、流通ビジネスメッセージ標準準拠のXMLデータを、XMLデータ構造についても配慮しつつテキスト又はCSV形式に変換し保存することができる。そのため、たとえXMLデータ自体を紛失した場合でも、テキスト又はCSV形式に変換し保存してあるデータから、前記端末から受信した時のデータ構造を備えたXMLデータに復元する事が保障できる。   According to the present embodiment, for example, XML data conforming to a distribution business message standard received from a predetermined terminal can be converted into a text or CSV format and stored while considering the XML data structure. Therefore, even if the XML data itself is lost, it can be guaranteed that the data converted into text or CSV format and stored is restored to XML data having a data structure as received from the terminal.

したがって、XMLデータにおける記述構造によらず、XMLデータとテキストまたはCSV形式データとの相互変換時におけるXMLデータ構造の正確な復元を可能となる。   Therefore, it is possible to accurately restore the XML data structure at the time of mutual conversion between the XML data and the text or CSV format data regardless of the description structure in the XML data.

以上、本発明の実施の形態について、その実施の形態に基づき具体的に説明したが、これに限定されるものではなく、その要旨を逸脱しない範囲で種々変更可能である。   As mentioned above, although embodiment of this invention was described concretely based on the embodiment, it is not limited to this and can be variously changed in the range which does not deviate from the summary.

本実施形態におけるXMLデータ構造の復元システムの全体構成図である。1 is an overall configuration diagram of an XML data structure restoration system in the present embodiment. 本実施形態の全体シーケンス例1を示す図である。It is a figure which shows the example 1 of the whole sequence of this embodiment. 本実施形態の全体シーケンス例2を示す図である。It is a figure which shows the whole sequence example 2 of this embodiment. 本実施形態におけるXMLデータ構造の例1を示す図である。It is a figure which shows Example 1 of the XML data structure in this embodiment. 本実施形態におけるテキストまたはCSVファイルの構造例を示す図である。It is a figure which shows the structural example of the text or CSV file in this embodiment. 本実施形態のXMLデータ構造の復元方法の処理手順例1を示すフローチャートである。It is a flowchart which shows the process procedure example 1 of the decompression | restoration method of the XML data structure of this embodiment. 本実施形態のXMLデータ構造の復元方法の処理手順例2を示す図である。It is a figure which shows process procedure example 2 of the decompression | restoration method of the XML data structure of this embodiment. 本実施形態におけるXMLデータ構造の例2を示す図である。It is a figure which shows Example 2 of the XML data structure in this embodiment. 本実施形態におけるXMLデータ構造の例3を示す図である。It is a figure which shows Example 3 of the XML data structure in this embodiment. 本実施形態の変換後のテキストまたはCSVファイルの構造例1を示す図である。It is a figure which shows the structural example 1 of the text or CSV file after conversion of this embodiment. 本実施形態の変換後のテキストまたはCSVファイルの構造例2を示す図である。It is a figure which shows the structural example 2 of the text or CSV file after the conversion of this embodiment. 本実施形態の逆変換処理対象のテキストまたはCSVファイルの構造例を示す図である。It is a figure which shows the structural example of the text or CSV file of the reverse conversion process object of this embodiment. 本実施形態の逆変換処理により生成したXMLデータ構造例1を示す図である。It is a figure which shows the XML data structure example 1 produced | generated by the inverse transformation process of this embodiment. 本実施形態の逆変換処理により生成したXMLデータ構造例2を示す図である。It is a figure which shows the XML data structure example 2 produced | generated by the inverse transformation process of this embodiment.

符号の説明Explanation of symbols

100 XMLデータ構造の復元システム
101 記憶装置
102 プログラム
103 メモリ
104 CPU
105 入力インターフェイス
106 出力インターフェイス
107 通信装置
110 データ取得部
111 タグ読取り部
112 位置情報格納部
113 レコード生成部
114 復元処理部
115 出力処理部
200 他社端末
100 XML Data Structure Restoration System 101 Storage Device 102 Program 103 Memory 104 CPU
105 Input Interface 106 Output Interface 107 Communication Device 110 Data Acquisition Unit 111 Tag Reading Unit 112 Location Information Storage Unit 113 Record Generation Unit 114 Restoration Processing Unit 115 Output Processing Unit 200 Other Company Terminal

Claims (5)

XMLデータとテキストまたはCSV形式のデータとを相互変換するコンピュータシステムであって、
ネットワーク上の所定端末よりXMLデータを受信し、記憶装置に格納するデータ取得部と、
前記記憶装置よりXMLデータをメモリに読み出して、前記XMLデータにおける開始タグを検索し、開始タグが検索された階層Xから下位階層に向けて、終了タグが検知される階層Yまでタグの読取り処理を実行する、タグ読取り部と、
前記階層Xから前記階層Yまでの各階層で読み取ったタグに対応させて、各タグを一意に特定するタグ位置IDを採番し、前記階層Xから階層Yに至る経路についてのタグ位置ID群をメモリに格納する位置情報格納部と、
前記XMLデータの階層Xから階層Yまでの各階層で記述されている階層データをXMLデータから読取り、各階層のXMLデータを、前記メモリにおけるタグ位置ID群が含む各階層のタグ位置IDに対応付けし、前記階層Xから階層Yに至る経路についてタグ位置IDと階層データとが対応付けされたレコードを生成し、テキストまたはCSV形式のデータとして記憶装置に格納するレコード生成部と、
ネットワーク上の所定端末または入力インターフェイスからXMLデータ構造の復元指示を受け付けるか、記憶装置にて予め設定されていたXMLデータ構造の復元時期の到来を検知したならば、前記記憶装置より前記レコードをメモリに読み出して、当該レコードが含むタグ位置ID毎にXMLデータ構造における階層を生成し、生成した各階層に対し、該当タグ位置IDに対応する階層データを前記レコードより抽出して設定し、開始タグが検索された前記階層Xから終了タグが検知された階層Yまでの各階層が階層データを含んだ構造をなすXMLデータを復元する復元処理部と、
前記メモリにて復元したXMLデータを、ネットワーク上の所定端末に送信するか、出力インターフェイスに出力する、出力処理部と、
を備えることを特徴とするXMLデータ構造の復元システム。
A computer system for interconverting XML data and text or CSV format data,
A data acquisition unit that receives XML data from a predetermined terminal on the network and stores it in a storage device;
XML data is read from the storage device into the memory, a start tag in the XML data is searched, and a tag reading process is performed from the hierarchy X where the start tag is searched to the hierarchy Y where the end tag is detected from the lower hierarchy. Executing a tag reading unit;
A tag position ID group for assigning a tag position ID that uniquely identifies each tag in correspondence with the tag read in each hierarchy from the hierarchy X to the hierarchy Y, and for a route from the hierarchy X to the hierarchy Y A position information storage unit for storing the
The hierarchical data described in each hierarchical level from the hierarchical level X to the hierarchical level Y of the XML data is read from the XML data, and the XML data of each hierarchical level corresponds to the tag positional ID of each hierarchical level included in the tag positional ID group in the memory. A record generation unit that generates a record in which the tag position ID and the hierarchy data are associated with each other for the route from the hierarchy X to the hierarchy Y, and stores the record in the storage device as text or CSV data;
If an instruction to restore the XML data structure is received from a predetermined terminal or input interface on the network, or if the arrival of the restoration time of the XML data structure preset in the storage device is detected, the record is stored in the memory from the storage device. And generating a hierarchy in the XML data structure for each tag position ID included in the record, extracting and setting the hierarchy data corresponding to the tag position ID from the record for each generated hierarchy, and starting tag A restoration processing unit for restoring XML data having a structure in which each hierarchy from the hierarchy X searched for the hierarchy X to the hierarchy Y where the end tag is detected includes hierarchy data;
An output processing unit that transmits the XML data restored in the memory to a predetermined terminal on the network or outputs it to an output interface;
An XML data structure restoration system comprising:
前記タグ読取り部は、前記階層Yの終了タグの読取り処理を実行した後、当該階層Yを包含する上位の階層Aにおいて、前記階層Yのものとは別の開始タグを検索し、この開始タグが検索された階層Aから下位階層に向けて、前記階層Yのものとは別の終了タグが検知される階層Bまでタグの読取り処理を実行するものであり、
前記位置情報格納部は、前記階層Aから前記階層Bまでの各階層で読み取ったタグに対応させて、各タグを一意に特定するタグ位置IDを採番し、既にタグ位置IDを採番済みの前記所定階層Xから前記階層Aの経路についてのタグ位置ID群に、前記階層Aから階層Bに至る経路について採番したタグ位置ID群をマージし、階層X〜A〜Bの経路についてのタグ位置ID群としてメモリに格納するものであり、
前記レコード生成部は、前記XMLデータの階層X〜A〜Bの各階層で記述されている階層データをXMLデータから読取り、各階層のXMLデータを、前記メモリにおけるタグ位置ID群が含む各階層のタグ位置IDに対応付けし、前記階層X〜A〜Bに至る経路についてタグ位置IDと階層データとが対応付けされたレコードを生成し、テキストまたはCSV形式のデータとして記憶装置に格納するものであり、
前記復元処理部は、前記記憶装置より前記レコードをメモリに読み出して、当該レコードが含むタグ位置IDのうち、前記階層Aから階層BまでのものについてXMLデータ構造における階層を生成し、生成した階層Aから階層Bまでの各階層に対し、該当タグ位置IDに対応する階層データを前記レコードより抽出して設定し、前記階層Aから階層Bまでの各階層が階層データを含んだ構造をなすXMLデータを復元し、このXMLデータを、既に復元済みの前記階層Xから階層YまでのXMLデータに追記し、前記階層X〜A〜Bの各階層が階層データを含んだ構造をなすXMLデータを復元するものである、
ことを特徴とする請求項1に記載のXMLデータ構造の復元システム。
The tag reading unit, after executing the reading process of the end tag of the layer Y, searches for a start tag different from that of the layer Y in the upper layer A including the layer Y, and this start tag From the hierarchy A searched for to the lower hierarchy, the tag reading process is executed up to the hierarchy B where an end tag different from that of the hierarchy Y is detected,
The position information storage unit assigns a tag position ID that uniquely identifies each tag in correspondence with tags read in each hierarchy from the hierarchy A to the hierarchy B, and has already assigned a tag position ID. The tag position ID group numbered for the route from the hierarchy A to the hierarchy B is merged with the tag position ID group for the route from the predetermined hierarchy X to the hierarchy A, and the route of the hierarchy X to A to B is merged. It is stored in the memory as a tag position ID group,
The record generation unit reads hierarchical data described in each of the hierarchical levels X to AB of the XML data from the XML data, and each hierarchical level included in the tag position ID group in the memory includes the XML data of each hierarchical level A record in which the tag position ID and the hierarchical data are associated with each other for the route to the hierarchy X to AB is generated and stored in the storage device as text or CSV format data. And
The restoration processing unit reads the record from the storage device into the memory, generates a hierarchy in the XML data structure for the tag position IDs included in the record from the hierarchy A to the hierarchy B, and generates the generated hierarchy For each hierarchy from A to B, the hierarchy data corresponding to the corresponding tag position ID is extracted from the record and set, and each hierarchy from the hierarchy A to the hierarchy B has a structure including hierarchy data The data is restored, and the XML data is added to the already restored XML data from the hierarchy X to the hierarchy Y, and the XML data having a structure in which each of the hierarchies X to A to B includes the hierarchy data is added. To restore,
The XML data structure restoration system according to claim 1, wherein:
前記XMLデータは、流通ビジネスメッセージ標準に準拠したデータのうち、出荷梱包についてのデータであることを特徴とする請求項1または2に記載のXMLデータ構造の復元システム。   The XML data structure restoration system according to claim 1 or 2, wherein the XML data is data on shipping packaging among data compliant with a distribution business message standard. XMLデータとテキストまたはCSV形式のデータとを相互変換するコンピュータが、
ネットワーク上の所定端末よりXMLデータを受信し、記憶装置に格納する処理と、
前記記憶装置よりXMLデータをメモリに読み出して、前記XMLデータにおける開始タグを検索し、開始タグが検索された階層Xから下位階層に向けて、終了タグが検知される階層Yまでタグの読取り処理を実行する処理と、
前記階層Xから前記階層Yまでの各階層で読み取ったタグに対応させて、各タグを一意に特定するタグ位置IDを採番し、前記階層Xから階層Yに至る経路についてのタグ位置ID群をメモリに格納する処理と、
前記XMLデータの階層Xから階層Yまでの各階層で記述されている階層データをXMLデータから読取り、各階層のXMLデータを、前記メモリにおけるタグ位置ID群が含む各階層のタグ位置IDに対応付けし、前記階層Xから階層Yに至る経路についてタグ位置IDと階層データとが対応付けされたレコードを生成し、テキストまたはCSV形式のデータとして記憶装置に格納する処理と、
ネットワーク上の所定端末または入力インターフェイスからXMLデータ構造の復元指示を受け付けるか、記憶装置にて予め設定されていたXMLデータ構造の復元時期の到来を検知したならば、前記記憶装置より前記レコードをメモリに読み出して、当該レコードが含むタグ位置ID毎にXMLデータ構造における階層を生成し、生成した各階層に対し、該当タグ位置IDに対応する階層データを前記レコードより抽出して設定し、開始タグが検索された前記階層Xから終了タグが検知された階層Yまでの各階層が階層データを含んだ構造をなすXMLデータを復元する処理と、
前記メモリにて復元したXMLデータを、ネットワーク上の所定端末に送信するか、出力インターフェイスに出力する処理と、
を実行することを特徴とするXMLデータ構造の復元方法。
A computer that interconverts XML data and text or CSV data,
A process of receiving XML data from a predetermined terminal on the network and storing it in a storage device;
XML data is read from the storage device into the memory, a start tag in the XML data is searched, and a tag reading process is performed from the hierarchy X where the start tag is searched to the hierarchy Y where the end tag is detected from the lower hierarchy. Processing to execute
A tag position ID group for assigning a tag position ID that uniquely identifies each tag in correspondence with the tag read in each hierarchy from the hierarchy X to the hierarchy Y, and for a route from the hierarchy X to the hierarchy Y Storing the data in memory,
The hierarchical data described in each hierarchy from the hierarchy X to the hierarchy Y of the XML data is read from the XML data, and the XML data of each hierarchy corresponds to the tag position ID of each hierarchy included in the tag position ID group in the memory. Processing for generating a record in which the tag position ID and the hierarchy data are associated with each other for the route from the hierarchy X to the hierarchy Y, and storing the record in the storage device as text or CSV data;
If an instruction to restore the XML data structure is received from a predetermined terminal or input interface on the network, or if the arrival of the restoration time of the XML data structure preset in the storage device is detected, the record is stored in the memory from the storage device. And generating a hierarchy in the XML data structure for each tag position ID included in the record, extracting and setting the hierarchy data corresponding to the tag position ID from the record for each generated hierarchy, and starting tag A process of restoring XML data having a structure in which each hierarchy from the hierarchy X searched for the hierarchy to the hierarchy Y where the end tag is detected includes hierarchy data;
A process of transmitting the XML data restored in the memory to a predetermined terminal on the network or outputting it to an output interface;
A method for restoring an XML data structure, comprising:
XMLデータとテキストまたはCSV形式のデータとを相互変換するコンピュータに、
ネットワーク上の所定端末よりXMLデータを受信し、記憶装置に格納するステップと、
前記記憶装置よりXMLデータをメモリに読み出して、前記XMLデータにおける開始タグを検索し、開始タグが検索された階層Xから下位階層に向けて、終了タグが検知される階層Yまでタグの読取り処理を実行するステップと、
前記階層Xから前記階層Yまでの各階層で読み取ったタグに対応させて、各タグを一意に特定するタグ位置IDを採番し、前記階層Xから階層Yに至る経路についてのタグ位置ID群をメモリに格納するステップと、
前記XMLデータの階層Xから階層Yまでの各階層で記述されている階層データをXMLデータから読取り、各階層のXMLデータを、前記メモリにおけるタグ位置ID群が含む各階層のタグ位置IDに対応付けし、前記階層Xから階層Yに至る経路についてタグ位置IDと階層データとが対応付けされたレコードを生成し、テキストまたはCSV形式のデータとして記憶装置に格納するステップと、
ネットワーク上の所定端末または入力インターフェイスからXMLデータ構造の復元指示を受け付けるか、記憶装置にて予め設定されていたXMLデータ構造の復元時期の到来を検知したならば、前記記憶装置より前記レコードをメモリに読み出して、当該レコードが含むタグ位置ID毎にXMLデータ構造における階層を生成し、生成した各階層に対し、該当タグ位置IDに対応する階層データを前記レコードより抽出して設定し、開始タグが検索された前記階層Xから終了タグが検知された階層Yまでの各階層が階層データを含んだ構造をなすXMLデータを復元するステップと、
前記メモリにて復元したXMLデータを、ネットワーク上の所定端末に送信するか、出力インターフェイスに出力するステップと、
を実行させるXMLデータ構造の復元プログラム。
To a computer that converts XML data and text or CSV format data,
Receiving XML data from a predetermined terminal on the network and storing it in a storage device;
XML data is read from the storage device into the memory, a start tag in the XML data is searched, and a tag reading process is performed from the hierarchy X where the start tag is searched to the hierarchy Y where the end tag is detected from the lower hierarchy. A step of performing
A tag position ID group for assigning a tag position ID that uniquely identifies each tag in correspondence with the tag read in each hierarchy from the hierarchy X to the hierarchy Y, and for a route from the hierarchy X to the hierarchy Y Storing in a memory;
The hierarchical data described in each hierarchy from the hierarchy X to the hierarchy Y of the XML data is read from the XML data, and the XML data of each hierarchy corresponds to the tag position ID of each hierarchy included in the tag position ID group in the memory. And generating a record in which the tag position ID and the hierarchy data are associated with each other for the path from the hierarchy X to the hierarchy Y, and storing the record in the storage device as text or CSV data;
If an instruction to restore the XML data structure is received from a predetermined terminal or input interface on the network, or if the arrival of the restoration time of the XML data structure preset in the storage device is detected, the record is stored in the memory from the storage device. And generating a hierarchy in the XML data structure for each tag position ID included in the record, extracting and setting the hierarchy data corresponding to the tag position ID from the record for each generated hierarchy, and starting tag Restoring the XML data having a structure in which each hierarchy from the hierarchy X searched for to the hierarchy Y where the end tag is detected includes hierarchy data;
Transmitting the XML data restored in the memory to a predetermined terminal on the network or outputting it to an output interface;
A program for restoring the XML data structure.
JP2007296042A 2007-11-14 2007-11-14 System, method and program for restoring xml data structure Pending JP2009122949A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007296042A JP2009122949A (en) 2007-11-14 2007-11-14 System, method and program for restoring xml data structure

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007296042A JP2009122949A (en) 2007-11-14 2007-11-14 System, method and program for restoring xml data structure

Publications (1)

Publication Number Publication Date
JP2009122949A true JP2009122949A (en) 2009-06-04

Family

ID=40815040

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007296042A Pending JP2009122949A (en) 2007-11-14 2007-11-14 System, method and program for restoring xml data structure

Country Status (1)

Country Link
JP (1) JP2009122949A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013015935A (en) * 2011-07-01 2013-01-24 Hitachi Ltd Method for restoring xml file configuration
JP2017073123A (en) * 2015-10-05 2017-04-13 株式会社トゥービーソフトTobesoft Co., Ltd. Bulk data transfer device and method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013015935A (en) * 2011-07-01 2013-01-24 Hitachi Ltd Method for restoring xml file configuration
JP2017073123A (en) * 2015-10-05 2017-04-13 株式会社トゥービーソフトTobesoft Co., Ltd. Bulk data transfer device and method

Similar Documents

Publication Publication Date Title
US8332520B2 (en) Web server for managing session and method thereof
CN101146106B (en) Concatenation discovery web service
US20100001834A1 (en) System and method for a message registry and message handling in a service -oriented business framework
CN109145205A (en) A kind of across chain data manipulation method and device based on block chain
US7559052B2 (en) Meta-model for associating multiple physical representations of logically equivalent entities in messaging and other applications
JP2008047067A (en) Encapsulated document managing device, encapsulated document managing method and encapsulated document management program
CN102754411A (en) Managing objects using a client-server bridge
JP2006235840A (en) Database access system and database access method
US20070282616A1 (en) Systems and methods for providing template based output management
US6766350B1 (en) Shared management of data objects in a communication network
CN101710274A (en) Method and system for generating help information of application software
JP2012243123A (en) Method, program, and system for converting part of graph data to data structure as image of homomorphism
CN103810272A (en) Data processing method and system
US8380549B2 (en) Architectural design for embedded support application software
TWI313819B (en) A system and method for building component applications using metadata defined mapping between message and data domains
KR20040081790A (en) Connecting entities with general functionality in aspect patterns
US20070094278A1 (en) Data transfer services
JP2005242904A (en) Document group analysis device, document group analysis method, document group analysis system, program and storage medium
JP2009122949A (en) System, method and program for restoring xml data structure
JP7381290B2 (en) Computer system and data management method
US20080307432A1 (en) Method and apparatus for exchanging data using data transformation
CN112000679B (en) Block chain data processing method and device with separated business operation and data operation
JP2008250861A (en) Code conversion system, code conversion method, code correspondence relationship information generation method and computer program
JP4529766B2 (en) Information providing system, information providing method, server, and information providing program
JP5237030B2 (en) Software development support program, software development support apparatus, and software development support method