Abstract
In this paper, we propose a system for generating skeleton programs for directly transforming an XML document to another document, whose structure is defined in the target DTD with GUI environment. With the generated code, the users can easily update or insert their own codes into the program so that they can convert the document as the way that they want and can be connected with other classes or library files. Since most of the currently available code generation systems or methods for transforming XML documents use XSLT or XQuery, it is very difficult or impossible for users to manipulate the source code for further updates or refinements. As the generated code in this paper reveals the code along the XPaths of the target DTD, the result code is quite readable. The code generating procedure is simple; once the user maps the related elements represented as trees in the GUI interface, the source document is transformed into the target document and its corresponding Java source program is generated, where DTD is given or extracted from XML documents automatically by parsing it. The mapping is classified 1:1, 1:N, and N:1, according to the structure and semantics of elements of the DTD. The functions for changing the structure of elements designated by the user are amalgamated into the metadata interface. A real world example of transforming articles written in XML file into a bibliographical XML document is shown with the transformed result and its code.
본 논문에서는 목표 문서의 DTD에 정의된 구조에 따라 원시문서를 목표 문서로 변환하는 XML 문서변환기와 골격 원시 프로그램을 생성하는 방법을 제안한다. 사용자는 생성된 프로그램을 이용하여 코드를 추가하거나 프로그램을 변경하고, 외부 클래스나 라이브러리 파일들을 연결하여 자신이 원하는 방법으로 쉽게 문서를 변환할 수 있다. 생성된 프로그램은 목표 DTD 경로(path)를 기준으로 코드를 생성하기 때문에 가독성이 높다. 현재까지의 대부분의 XML 문서변환은 XSLT를 이용하거나 XQuery를 이용하여 Java 프로그램을 생성하고 있으나, 각 요소별로 코드를 조작할 수 없는 단점이 있다. 본 논문에서 제안된 방법은 사용자가 원시/목표 문서에서 제공되는 DTD 혹은 문서에서 자동으로 추출된 DTD를 이용하여 원소 사이의 관계를 지정하면 자동적으로 문서가 변환되고 Java 원시 프로그램을 생성하기 때문에 코드 생성과정이 매우 단순하다. 메타데이터 인터페이스는 Java GUI를 이용하여 트리 형태로 표현된 DTD의 원소를 클릭하여 쉽게 생성할 수 있다. 문서변환을 위한 매핑은 원소의 특성에 따라 1:1, 1:N, N:1로 구분되며 데이터의 분해 혹은 합성을 위한 사용자 지정 함수가 메타데이터 인터페이스에 저장된다. 본 시스템은 실제 사용되고 있는 논문 XML 문서를 서지문서로 변환한 결과 및 프로그램 코드를 예제로 구현하여 결과를 제시하였다.