WO2006046665A1 - 文書処理装置及び文書処理方法 - Google Patents

文書処理装置及び文書処理方法 Download PDF

Info

Publication number
WO2006046665A1
WO2006046665A1 PCT/JP2005/019824 JP2005019824W WO2006046665A1 WO 2006046665 A1 WO2006046665 A1 WO 2006046665A1 JP 2005019824 W JP2005019824 W JP 2005019824W WO 2006046665 A1 WO2006046665 A1 WO 2006046665A1
Authority
WO
WIPO (PCT)
Prior art keywords
document
namespace
name space
name
unit
Prior art date
Application number
PCT/JP2005/019824
Other languages
English (en)
French (fr)
Inventor
Jumpei Aoki
Original Assignee
Justsystems Corporation
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 Justsystems Corporation filed Critical Justsystems Corporation
Priority to US11/576,239 priority Critical patent/US20080141112A1/en
Priority to JP2006543264A priority patent/JPWO2006046665A1/ja
Publication of WO2006046665A1 publication Critical patent/WO2006046665A1/ja

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/93Document management systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/38Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/14Tree-structured documents
    • G06F40/143Markup, e.g. Standard Generalized Markup Language [SGML] or Document Type Definition [DTD]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • G06F40/221Parsing markup language streams

Definitions

  • the present invention relates to a document processing technique, and more particularly to a document processing apparatus and a document processing method for processing a structured document having a hierarchical structure.
  • XML extensible Markup Language
  • Patent Document 1 An XML document is created based on a vocabulary (tag set) defined by a document type definition or the like.
  • Patent Document 1 Japanese Patent Laid-Open No. 2001-290804
  • the present invention has been made in view of such a situation, and an object of the present invention is to perform appropriate processing on a structure document that cannot identify information such as a name space, and to perform display and editing without delay. To provide technology.
  • This document processing device is a markup
  • a name space detection unit for detecting a name space to which a constituent element included in a document described in a language belongs, and when the name space detection unit does not detect an accurate name space
  • a name space specifying unit for extracting a keyword based on the name and specifying the name space based on the keyword
  • a name space information storing unit for storing information relating to a correspondence relationship between the keyword and the name space.
  • the namespace identification unit identifies the namespace by referring to the namespace information storage unit based on the extracted keyword, and is identified by the namespace detection unit or the namespace identification unit.
  • the document is displayed based on the name space, and editing of the document by a user is accepted.
  • the markup language may be a form of XML, such as XHTML (extensible HyperText Markup Language), 3 ⁇ 4 V "G (Scalable Vector uraphics), MathML (Mathematical Markup Language), etc. (Standard Generalized Markup Language), HTML (HyperText Markup Language), etc. Keywords include extensions included in document file names, element names (tag names) or attribute names described in documents, etc. Anything that can guess the namespace can be used.
  • the document processing apparatus presents a plurality of name spaces detected by the data name identifying unit to the user, and the name space is identified by the user selecting one of them. A part may be further included.
  • the namespace information storage unit sequentially stores information related to the correspondence relationship between the namespace included in the previously processed document and the keywords included in the document, and based on the information Namespace identification may be performed.
  • This document processing method includes a step of detecting a name space to which a constituent element included in a document described in a markup language belongs, and when an accurate name space is not identified in the detecting step.
  • a step of extracting a keyword based on a predetermined condition from a written document and identifying the name space by referring to information related to a correspondence relationship between the keyword and the name space stored in advance based on the keyword And displaying the document based on the detected or identified namespace and accepting editing of the document by a user.
  • FIG. 1 is a diagram showing a configuration of a document processing apparatus according to a base technology.
  • FIG. 2 is a diagram showing an example of an XML document to be processed.
  • FIG. 3 is a diagram showing an example of mapping the XML document shown in FIG. 2 to a table described in HTML.
  • FIG. 4 (a) is a diagram showing an example of a definition file for mapping the XML document shown in FIG. 2 to the table shown in FIG.
  • FIG. 4 (b) is a diagram showing an example of a definition file for mapping the XML document shown in FIG. 2 to the table shown in FIG.
  • FIG. 5 is a diagram showing an example of a screen displayed by mapping the XML document described in the grade management vocabulary shown in FIG. 2 to HTML according to the correspondence shown in FIG.
  • FIG. 6 is a diagram showing an example of a graphical user interface presented to the user by the definition file generation unit in order for the user to generate a definition file.
  • FIG. 7 is a diagram showing another example of the screen layout generated by the definition file generation unit.
  • FIG. 8 is a diagram showing an example of an XML document editing screen by the document processing apparatus.
  • FIG. 9 is a diagram showing another example of an XML document edited by the document processing apparatus.
  • FIG. 10 is a diagram showing an example of a screen displaying the document shown in FIG.
  • FIG. 11 is a diagram illustrating a configuration of a document processing apparatus according to an embodiment.
  • FIG. 12 is a flowchart showing a procedure for specifying a name space.
  • FIG. 13 is a diagram showing an example of an XHTML document without a namespace URI.
  • FIG. 14 is a diagram showing a configuration example of a table showing associations between extensions and namespaces.
  • FIG. 15 is a diagram illustrating an example of an XHTML document in which a namespace URI is described.
  • Fig.16 An example of an XML document using a diary tag without a namespace URI.
  • FIG.17 An example of an XML document using a diary tag with a namespace URI.
  • FIG. 18 is a diagram showing an example of a style sheet file specified in the XML document of FIG.
  • FIG. 19 is a diagram showing an example of an XML document in which a style sheet is specified.
  • FIG. 20 is a diagram showing an example of a style sheet file specified in the XML document of FIG.
  • FIG. 1 shows the configuration of the document processing apparatus 20 according to the base technology.
  • the document processing apparatus 20 processes a structured document in which data in the document is classified into a plurality of components having a hierarchical structure.
  • an example of processing an XML document as an example of a structured document is used. I ’ll explain it.
  • the document processing apparatus 20 includes a main control unit 22, an editing unit 24, a DOM unit 30, a CSS unit 40, an HTML unit 50, an SVG unit 60, and a VC unit 80 which is an example of a conversion unit.
  • these configurations are realized by the CPU, memory, and programs loaded in the memory of any computer.
  • the functional blocks realized by their cooperation are depicted. Therefore, those skilled in the art will understand that these functional blocks can be realized in various forms by hardware only, software only, or a combination thereof.
  • the main control unit 22 provides a framework for loading plug-ins and executing commands.
  • the editing unit 24 provides a framework for editing XML documents.
  • the document display and editing functions in the document processing device 20 are realized by plug-ins, and necessary plug-ins are loaded by the main control unit 22 or the editing unit 24 according to the document type.
  • the main control unit 22 or the editing unit 24 refers to the name space of the XML document to be processed, determines whether the XML document is described by a misplaced library, and displays or displays the document corresponding to the missing library. Load the editing plug-in to display or edit.
  • the document processing device 20 has a display system and an editing system plug-in for each vocabulary (tag set) such as an HTML unit 50 that displays and edits HTML documents and an SVG unit 60 that displays and edits SVG documents.
  • the HTML unit 50 is loaded when editing an HTML document
  • the SVG unit 60 is loaded when editing an S VG document.
  • both HTML unit 50 and SVG unit 60 are loaded.
  • the user can select and install only the necessary functions and add or delete functions as needed later, so that the recording medium such as a hard disk for storing the program can be used.
  • the storage area can be used effectively, and memory can be prevented from being wasted during program execution.
  • it has excellent function expandability, and as a development entity, it is possible to cope with a new vocabulary in the form of a plug-in, making development easier, and as a user, it is easy and low by adding plug-ins. Additional functions can be added at cost.
  • the editing unit 24 accepts an editing instruction event via the user interface, notifies the appropriate plug-in of the event, and re-executes the event (redo) or cancels execution (undo). Control the process.
  • the DOM unit 30 includes a DOM providing unit 32, a DOM generation unit 34, and an output unit 36. It implements a function that complies with the Document Object Model (DOM) defined to provide an access method when handling ML documents as data.
  • the DOM provider 32 is a DOM implementation that satisfies the interface defined in the editing unit 24.
  • the DOM generator 34 also generates a DOM tree with XML document capabilities. As will be described later, when XML document power to be processed is mapped to another library by VC unit 80, the source tree corresponding to the mapping source XML document and the destination tree corresponding to the mapping destination XML document Is generated.
  • the output unit 36 outputs the DOM tree as an XML document at the end of editing, for example.
  • the CSS unit 40 includes a CSS analysis unit 42, a CSS providing unit 44, and a rendering unit 46, and provides a display function compliant with CSS.
  • the CSS analysis unit 42 has a function of a parser that analyzes the syntax of CSS.
  • the CSS provider 44 is an implementation of a CSS object and performs CSS cascade processing on the DOM tree.
  • the rendering unit 46 is a CSS rendering engine, and is used to display a document described in a vocabulary such as HTML that is laid out using CSS.
  • the HTML unit 50 displays or edits a document described in HTML.
  • the SVG unit 60 displays or edits documents written in SVG.
  • These display Z editing systems are realized in the form of plug-ins.
  • Each display unit (Canvas) 56 and 66 displays a document, and each control unit (Editlet) 52 and 62 receives and transmits an event including an editing instruction. It is equipped with editing sections (Zone) 54 and 64 that receive editing commands and edit the DOM.
  • the control unit 52 or 62 accepts a DOM tree editing command even when an external force is received, the editing unit 54 or 64 changes the DOM tree, and the display unit 56 or 66 updates the display.
  • MVC Model-View-Controller
  • the display units 56 and 66 are changed to "View”, and the control units 52 and 62 are changed to "Controller”. Parts 54 and 64 and the entity of the DOM correspond to “Model”, respectively.
  • the document processing apparatus 20 of the base technology enables not only editing of an XML document in a tree display format but also editing according to the respective vocabulary.
  • the HTML unit 50 provides a user interface for editing an HTML document in a manner similar to a word processor
  • the SVG unit 60 provides a user interface for editing an SVG document in a manner similar to an image drawing tool. Provide the service.
  • the VC unit 80 includes a mapping unit 82, a definition file acquisition unit 84, and a definition file generation unit 86.
  • a mapping destination Provides a framework for displaying or editing documents with a display editing plug-in that supports the vocabulary. In this base technology, this function is called Vocabulary Connection (VC).
  • the definition file acquisition unit 84 acquires a script file in which the mapping definition is described. This definition file describes the correspondence (connection) between nodes for each node. At this time, whether to edit the element value or attribute value of each node may be specified. Also, an arithmetic expression using the element value or attribute value of the node may be described.
  • the mapping unit 82 refers to the script file acquired by the definition file acquisition unit 84, causes the DOM generation unit 34 to generate a destination tree, and manages the correspondence between the source tree and the destination tree.
  • the definition file generator 86 provides a graphical user interface for the user to generate a definition file.
  • the VC unit 80 monitors the connection between the source tree and the destination tree and receives an editing instruction via the user interface provided by the plug-in responsible for display, the VC unit 80 first applies the corresponding source tree. Change the node to be used.
  • the DOM unit 30 issues a mutation event indicating that the source tree has been changed
  • the VC unit 80 receives the mutation event and synchronizes the destination tree with the change in the source tree. Change the destination tree node corresponding to the changed node.
  • a plug-in that displays / edits the destination tree for example, the HTML unit 50, receives a mutation event indicating that the destination tree has been changed, and updates the display with reference to the changed destination tree.
  • the DOM generation unit 34 displays the XML document. Force also generates a DOM tree. Further, the main control unit 22 or the editing unit 24 refers to the name space to determine the vocabulary describing the document. If a plug-in corresponding to the vocabulary is installed in the document processing apparatus 20, the plug-in is loaded to display / edit the document. If the plug-in linker S is not installed, check whether the mapping definition file exists. If the definition file exists, the definition file acquisition unit 84 acquires the definition file, generates a destination tree according to the definition, and displays and edits the document by the plug-in corresponding to the mapping destination library.
  • the corresponding parts of the document are displayed and edited by plug-ins corresponding to each vocabulary as described later. If the definition file does not exist, the document source or tree structure is displayed and edited on the display screen.
  • FIG. 2 shows an example of an XML document to be processed.
  • This XML document is used to manage student grade data.
  • the component “score” that is the top node of the XML document has a plurality of component “students” provided for each student under the subordinate.
  • the component “student” has an attribute value “name” and child elements “national language”, “mathematics”, “science”, and “society”.
  • the attribute value “name” stores the name of the student.
  • the constituent elements “National language”, “Mathematics”, “Science”, and “Society” store the results of national language, mathematics, science, and society, respectively.
  • the student with the name “A” has a national grade of “90”, a mathematical grade of “50”, a science grade of “75”, and a social grade of “60”.
  • the vocabulary (tag set) used in this document will be referred to as the “results management vocabulary”.
  • the document processing apparatus 20 of the base technology does not have a plug-in that supports display Z editing of the grade management vocabulary, in order to display this document by a method other than source display and tree display,
  • the VC function is used.
  • the user interface for creating a definition file by the user himself will be described later.
  • the description will proceed assuming that a definition file has already been prepared.
  • Fig. 3 shows an example of mapping the XML document shown in Fig. 2 to a table written in HTML.
  • the “Student” node in the Grade Management Library is associated with the row (“TR” node) of the table (“TA BLE” node) in HTML, and the attribute value “name” appears in the first column of each row.
  • the element value of the "National Language” node the element value of the "Mathematics” node in the third column, the element value of the "Science” node in the fourth column, and " Associate the element values of the “Society” node.
  • the XML document shown in FIG. 2 can be displayed in an HTML table format.
  • the sixth column specifies the formula for calculating the weighted average of national language, mathematics, science, and society, and displays the average score of the students. In this way, by making it possible to specify an arithmetic expression in the definition file, more flexible display is possible, and user convenience during editing can be improved. Note that the sixth column specifies that editing is not possible, so that only the average score cannot be edited individually. In this way, by making it possible to specify whether or not editing can be performed in the mapping definition, it is possible to prevent erroneous operations by the user.
  • FIGS. 4 (a) and 4 (b) show examples of definition files for mapping the XML document shown in FIG. 2 to the table shown in FIG.
  • This definition file is described in the script language defined for the definition file.
  • the definition file contains command definitions and display templates.
  • "add student” and “delete student” are defined as commands, respectively, the operation of inserting the node “student” into the source tree, and the source tree The operation of deleting the node “student” from the node is associated.
  • headings such as “name” and “national language” are displayed in the first line of the table, and the contents of the node “student” are displayed in the second and subsequent lines.
  • FIG. 5 shows an XML document described in the results management library shown in FIG. 2, as shown in FIG.
  • An example of a screen that is mapped and displayed in HTML is shown below.
  • Each row in Table 90 shows, from the left, each student's name, national language grade, mathematics grade, science grade, social grade, and average score.
  • the user can edit the XML document on this screen. For example, if the value in the second row and third column is changed to “70”, the element value of the source corresponding to this node, that is, the math grade of the student “B” is changed to “70”.
  • the VC unit 80 changes the corresponding part of the destination tree that causes the destination tree to follow the source tree, and updates the display based on the changed destination tree. Therefore, also in the table on the screen, the mathematics score of the student “B” is changed to “70”, and the average score is changed to “55”.
  • the screen shown in FIG. 5 displays the “add student” and “delete student” command menus as defined in the definition file shown in FIGS. 4 (a) and 4 (b). Is displayed.
  • the node “Student” is added or deleted in the source tree.
  • Such a single-structure editing function may be provided to the user in the form of a command.
  • a command for adding or deleting a table row may be associated with an operation for adding or deleting the node “student”.
  • a command for embedding other vocabulary may be provided to the user.
  • this table as an input template, new student grade data can be added in the form of hole filling.
  • the VC function makes it possible to edit a document described in the grade management vocabulary while using the display Z editing function of the HTML unit 50.
  • FIG. 6 shows an example of a graphical user interface that the definition file generator 86 presents to the user in order for the user to generate a definition file.
  • the XML document of the mapping source is displayed in a tree.
  • the area 92 on the right side of the screen shows the screen layout of the mapping destination XML document.
  • This screen layout can be edited by the HTML unit 50, and the user creates a screen layout for displaying a document in an area 92 on the right side of the screen. Then, for example, the mapping source XML document displayed in the area 91 on the left side of the screen with a pointing device such as a mouse.
  • the definition file generation unit 86 By dragging and dropping this node into the HTML screen layout displayed in the area 92 on the right side of the screen, the connection between the mapping source node and the mapping destination node is specified. For example, if you drop “math”, which is a child element of the element “student”, into the first row and third column of Table 90 on the HTML screen, it will be between the “math” node and the “TD” node in the third column. A connection is established. Each node can be designated for editing. An arithmetic expression can also be embedded in the display screen. When the screen editing is completed, the definition file generation unit 86 generates a definition file describing the screen layout and the connection between the nodes.
  • FIG. 7 shows another example of the screen layout generated by the definition file generator 86.
  • a table 90 and a pie chart 93 are created on the screen for displaying the XML document described in the grade management vocabulary.
  • This pie chart 93 is described in SVG.
  • the document processing apparatus 20 of the base technology can process a compound document including a plurality of libraries in one XML document, and thus a table described in HTML as in this example. 90 and a pie chart 93 written in SVG can be displayed on one screen.
  • FIG. 8 shows an example of an XML document editing screen by the document processing apparatus 20.
  • one screen is divided into multiple parts, and the XML document to be processed is displayed in different display formats in each area.
  • the document 94 is displayed in the area 94
  • the tree structure of the document is displayed in the area 95
  • the table described in HTML shown in FIG. 5 is displayed in the area 96.
  • Documents can be edited on any of these screens.
  • the source tree is changed, and the plug-in linker and source responsible for displaying each screen are displayed. Update the screen to reflect the changes in the tree.
  • the display section of the plug-in responsible for displaying each editing screen is registered, and either plug-in or VC unit 80 is registered.
  • the source tree is changed by, all the display units displaying the edit screen receive the issued mutation event and update the screen.
  • the VC unit 80 changes the destination tree following the change of the source tree, and then refers to the changed destination tree.
  • the display unit updates the screen.
  • the source display plug-in and the tree display plug-in directly refer to the source tree without using the destination tree. And display.
  • the source display plug-in and the tree display plug-in update the screen with reference to the changed source tree, and take charge of the screen in area 96! /
  • the HTML unit 50 updates the screen by referring to the changed destination tree following the change of the source tree.
  • the source display and the tree display can also be realized by using the VC function. That is, the source and tree structure may be laid out in HTML, an XML document may be mapped to the HTML, and displayed by the HTML unit 50. In this case, three destination trees are generated: source format, tree format, and tabular format.
  • VC Unit 80 changes the source tree, then changes each of the three destination trees: source format, tree format, and tabular format. Refer to those destination trees and update the three screens.
  • the user can display and edit a document in a format that can be easily visually divided using the table 90 or the like while grasping the hierarchical structure of the document by the source display or the tree display.
  • the ability to divide a screen and display a screen in multiple display formats at the same time may display a screen in a single display format on a single screen, and the display format can be switched by a user instruction.
  • the main The control unit 22 receives a display format switching request from the user, and instructs each plug-in to switch the display.
  • FIG. 9 shows another example of an XML document edited by the document processing device 20.
  • the XHTML document is embedded in the “foreignObject” tag of the SVG document, and moreover, the mathematical expression described in MathML is included in the XHTML document.
  • the editing unit 24 refers to the name space and distributes the drawing work to an appropriate display system.
  • the editing unit 24 first causes the SVG unit 60 to draw a rectangle, and then causes the HTML unit 50 to draw an XHTML document.
  • the MathML unit (not shown) is made to draw mathematical expressions. In this way, a compound document including a plurality of vocabularies is appropriately displayed.
  • Figure 10 shows the display results.
  • the displayed menu may be switched according to the position of the cursor (carriage). That is, when the cursor is in the area where the SVG document is displayed, the menu defined by the SVG unit 60 or the command defined in the definition file for mapping the SVG document is displayed.
  • the menu defined by the HTML unit 50 or the command defined in the definition file for mapping the XHTML document is displayed. Thereby, an appropriate user interface can be provided according to the editing position.
  • the part described by the specified library may be displayed in the source display or the tree display.
  • the application power to display the embedded document S Installed powerful power that cannot display its contents
  • the contents can be grasped by displaying the XML document composed of text data in the source display or tree display. This is a unique feature of text-based documents such as XML.
  • a tag of another vocabulary may be used.
  • This XML document is not valid, but if it is well-formed (welH rmed), it can be processed as a valid XML document.
  • the tag of another inserted library may be mapped by the definition file. For example, you can use tags such as “Important” and “Most important” in an XHTML document and highlight the parts enclosed by these tags, or sort them in order of importance. Moyo.
  • the plug-in or VC unit 80 in charge of the edited part changes the source tree. Mutation event listeners can be registered for each node in the source tree. Normally, the plug-in display or VC cut 80 corresponding to the vocabulary to which each node belongs is registered as a listener. Is done.
  • the DOM provider 32 traces from the changed node to a higher hierarchy, and if there is a registered listener, issues a mutation event to that listener. For example, in the document shown in Fig.
  • the overall layout may change as the display is updated by the HTML unit 50.
  • the layout of the display area for each plug-in is updated by a configuration that manages the layout of the screen, for example, a plug-in that is responsible for displaying the top node.
  • the HTML unit 50 first draws a part that it is in charge of and determines the size of the display area. Then, it notifies the configuration that manages the layout of the screen of the size of the display area after the change, and requests a layout update.
  • the configuration that manages the layout of the screen receives the notification and re-lays out the display area for each plug-in.
  • the edited part is updated appropriately, and the layout of the entire screen is updated.
  • the document processing apparatus is configured on the basis of the above-described prerequisite technology, and the document processing apparatus according to the prerequisite technology is basically included in a part of the document processing apparatus according to the present embodiment.
  • Shall In this embodiment, an example of processing a document file structured in XML as an example of a structured document will be described.
  • FIG. 11 shows a document processing apparatus 300 according to the present embodiment.
  • the main control unit 22 includes a name space detection unit 310, a name space specifying unit 312, and a name space display unit 314.
  • the namespace information storage unit 316 is connected.
  • the name space detection unit 310 reads an XML document to be processed, and detects information for identifying the name space, for example, a line in which the name space UR I is described.
  • the namespace specifying unit 312 A signal to that effect is received from the namespace detection unit 310, and the namespace is searched and specified while inquiring the namespace information storage unit 316.
  • the namespace display unit 314 displays the specified namespace or namespace candidate. If the candidate namespace is not finally identified, the namespace display unit 314 may display the source of the XML document, for example.
  • the namespace information storage unit 3 16 includes a character string that is a key for deriving the namespace, for example, an extension included in the file name of the XML document to be processed, an element name described in the document, Information indicating the correspondence between the attribute name and the name space is stored in advance. For example, a table in which the namespace URI “htp: urinary w.w3.org/1999/xhtml” is associated with the extension “html”.
  • the name space information storage unit 316 stores information indicating the correspondence between the extension or tag name and the name space.
  • FIG. 12 shows that the name space specifying unit 312 cooperates with the name space information storage unit 316 to create a name space. It is a flowchart which shows the procedure which pinpoints a space
  • the file name of the XML document also acquires an extension (S 12). Based on the acquired extension, an inquiry is made to the namespace information storage unit 316, and a namespace corresponding to the extension is searched (S14). If there is only one name space corresponding to the extension (Y in S16), the data of the name space is sent to the name space display unit 314 (S18).
  • the element name (tag name) of the component included in the XML document Is extracted (S20).
  • the extraction may be attribute names in addition to tag names.
  • description will be made using tag names.
  • the name space display unit 314 may display the name space uniquely specified by the name space specifying unit 312 so that the user can finally confirm.
  • the main control unit 22 or the editing unit 24 determines the XML document vocabulary and displays or edits corresponding to the vocabulary as in the base technology. Use the plug-in to display and edit. If the plug-in that processes the specified namespace namespace is not installed on the document processing device, a message prompting the user to load the plug-in is displayed to the user, or it is automatically downloaded.
  • the name space specifying unit 312 may display them on the name space display unit 314 without automatically specifying the final name. For example, in S16 of FIG. 12, only the name space that is detected is the target of data transmission in S18. Well, ... At this time, the user may select an appropriate name space from among them and enable the setting. Also, calculate the probability using the calculation method described later, and display some of the high probability and namespaces!
  • the probability for the name space specification is increased by calculating the probability of the detected name space. Moreover, even when the name space cannot be automatically identified, the time and effort are reduced by narrowing down the name space candidates and presenting them to the user, compared to when the user performs all the work.
  • extension power search and the search from the tag name described above may be combined in any combination, such as by searching the tag power first, or performing only one of them.
  • Search keys are not limited to extensions, element names, and attribute names.
  • the namespace display unit 314 Upon receiving the correspondence absence signal from the namespace specifying unit 312, the namespace display unit 314 displays the source file of the XML document being processed as it is, and displays that the namespace is not detected. You can go to the user! In addition, users may be able to modify the XML document directly, such as inserting a description to identify the namespace.
  • FIG. 13 shows an example of an XHTML document that does not include a URI, which is information for identifying a namespace.
  • information for identifying the name space to which the element type belongs such as ⁇ hea d>, ⁇ title>, ⁇ body>, is not described.
  • names When estimating the space, it is practical to specify the name space by a rule-based method.
  • FIG. 14 shows a configuration example 400 of a table stored in the name space information storage unit 316 that is referred to by the rule-based method.
  • This table is composed of an extension name field 400a and a name space information field 400b.
  • the step of referring to this table and specifying the name space corresponds to S14 in FIG.
  • the file name of the document to be processed is “bunsho.ht ml”
  • the URI indicating the namespace is “http: ⁇ www.w3” by searching this table based on the extension “html”. .org / 1999 / xhtml ".
  • This search method is effective when the document is provided as a single XML file and is a non-compound document, with a low calculation cost.
  • the extension name field 40 Oa in the configuration example 400 of the table shown in FIG. instead, the rule-based approach may be applied by referring to a table with the tag name field as a component. This step corresponds to S24 in FIG.
  • the tag name of the root node is “html”.
  • the namespace is specified as “http: ⁇ www.w3.org/1999/xhtml” by referring to the same table as in FIG.
  • the user or system builder creates a table as shown in FIG. 14 and stores it in the namespace information storage unit 316.
  • the namespace information storage unit 316 may store, for example, a table provided with a first layer tag name column, a second layer tag name column, and a namespace information column.
  • a tag name force of the first layer s "html”
  • based on the fact tag name of the second layer is "head", "title”, "body”
  • the table stored in the namespace information storage unit 316 is searched to identify the namespace.
  • the tag name of the first layer is “3 8 ” and the tag name of the second layer is “desc”, “rect”, “polyline”, etc., it is described in SVG!
  • the first layer tag name S is “math”, and the second layer tag name S “mi”, “mo”, “mfrac” is described in MathML. You can do it.
  • the search key By increasing the name hierarchy, the accuracy of identifying the name space can be increased, and candidates can be narrowed down efficiently.
  • the power that gradually increased the search key such as the tag name of the extension and multiple layers
  • the name can be used as a search key, and only the tag name can be used as a search key.
  • the namespace information storage unit 316 an XML document having a namespace description is preferentially learned by the document processing apparatus, and the namespace referenced by the document, and the tag name and file in the document are stored.
  • a probabilistic classifier (not shown) that performs supervised learning that holds information on the correspondence relationship with the extension of the file may be further provided.
  • Existing methods such as Bayes' theorem and SVM (Support Vector Machine) may be applied to the probabilistic classifier that performs supervised learning.
  • the namespace of document C has a high probability of being an AVG of classification A.
  • the namespace URI will be “http: ⁇ www .w3.org / 1999 / xhtml ”can be identified based on the probability calculation as described above.
  • the namespace candidates are ordered by probability from the number of appearances of the tag name. For example, the top three probabilities can be used as namespace candidates, or a namespace with a higher probability can be set by setting a predetermined threshold such as 50% or more. It may be displayed on the space display unit 314. The user may make final identification of the namespace by selecting from among those namespace candidates.
  • FIG. 16 shows an example of an XML document using a diary tag without a namespace URI.
  • the probabilistic method described above is effective. is there. In this case, if all the documents that have been processed in the past and that contain the name space identification information are learned, the probability calculation according to the tendency of the processing contents of the user who uses the document processing device can be performed. Can narrow space candidates efficiently
  • FIG. 18 shows the contents of the file “case2.xsl” of the XML style sheet specified in the XML document of FIG.
  • the namespace URI http://xmlns.justsystem.co.jp/diary” is described, the XML document shown in FIG. 17 is displayed and edited without delay.
  • FIG. 19 shows an example of an XML document similar to FIG.
  • “case2b.xsl” is specified as the style sheet file.
  • Figure 20 shows the contents of the style sheet file “case2b xsl”.
  • the namespace URI in the style sheet in Figure 20 is "http: httpxmlns.justsystem.co.jp/dialy", and the spelling of "diary" It can be seen that there is an error.
  • the name space specifying unit 312 may search for a similar name space.
  • the name space information storage unit 316 is used to store the name space list so that the name space having the highest similarity to the erroneous name space described in the document is detected. Also good.
  • existing methods may be applied to determine similarity, such as counting the edit distance (laboratory distance).
  • the power described as an example of processing an XML document is also applicable to a document described in another markup language such as SGML or HTML. Can be processed.
  • the plug-in corresponding to the vocabulary is loaded, and the normal processing for displaying and editing the document is made possible.
  • the present invention can be used for an apparatus for processing a structured document.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Artificial Intelligence (AREA)
  • Data Mining & Analysis (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Business, Economics & Management (AREA)
  • General Business, Economics & Management (AREA)
  • Multimedia (AREA)
  • Library & Information Science (AREA)
  • Document Processing Apparatus (AREA)

Abstract

 マークアップ言語により記述された文書の名前空間を特定する。  名前空間検出部310は、処理対象となるXML文書を読込み、名前空間が記述されている行を検出する。正確な名前空間が識別できなかったとき、名前空間特定部312は、名前空間情報格納部316に問い合わせながら、名前空間の検索、特定を行う。名前空間表示部314は、特定された名前空間または名前空間候補などを表示し、後者の場合はユーザが選択できるようにする。名前空間情報格納部316には、名前空間を導出するためのキーとなるXML文書の拡張子や、文書内部に記述されているタグ名などの文字列と、名前空間との対応関係に係る情報をあらかじめ格納しておく。

Description

明 細 書
文書処理装置及び文書処理方法
技術分野
[0001] 本発明は、文書処理技術に関し、特に、階層構造を有する構造化文書を処理する 文書処理装置及び文書処理方法に関する。
背景技術
[0002] XML (extensible Markup Language)は、ネットワークなどを介して他者とデータを 共有するのに適した形式として注目されており、 XML文書を作成、表示、編集する ためのアプリケーションが開発されている(たとえば、特許文献 1参照)。 XML文書は 、文書型定義などにより定義されたボキヤブラリ(タグセット)に基づいて作成されてい る。
[0003] XMLでは、一つの文書の中に複数のボキヤブラリが混在することが許される力 複 数のボキヤブラリに同一の要素名または属性名が存在する場合、文書内で要素名ま たは属性名が衝突し、 V、ずれのボキヤブラリに属する要素型または属性型なのかを 特定できない事態が生じる恐れがある。このような問題を解決するために、 XMLでは 、「名前空間」という概念を導入し、文書内に含まれる要素型および属性型がいずれ のボキヤブラリに属するものであるかを記述することになつて 、る。
特許文献 1:特開 2001— 290804号公報
発明の開示
発明が解決しょうとする課題
[0004] しかし、名前空間が適切に記述していない文書を処理する場面も想定される。この ような場合であっても、文書を適切に処理できるよう支援する技術が求められる。
[0005] 本発明はこうした状況に鑑みてなされたものであり、その目的は、名前空間などの 情報を識別できない構造ィヒ文書に対して適切な処理を行い、表示、編集を滞りなく 遂行できる技術を提供することにある。
課題を解決するための手段
[0006] 本発明のある態様は、文書処理装置に関する。この文書処理装置は、マークアップ 言語により記述された文書に含まれる構成要素が属する名前空間を検出する名前空 間検出部と、前記名前空間検出部において正確な名前空間が検出されな力つた際 に、前記文書力 所定の条件に基づいたキーワードを抽出し、それをもとに前記名前 空間を特定する名前空間特定部と、前記キーワードと前記名前空間との対応関係に 係る情報を記憶する名前空間情報格納部と、を備え、前記名前空間特定部は前記 抽出されたキーワードをもとに、前記名前空間情報格納部を参照することにより前記 名前空間を特定し、前記名前空間検出部または前記名前空間特定部において特定 された前記名前空間に基づき、前記文書を表示し、ユーザによる前記文書の編集を 受け付けることを特徴とする。
[0007] マークアップ言語は、 XMLの一开態、例えば、 XHTML (extensible HyperText M arkup Language)、 ¾ V"G (Scalable Vector uraphics)、 MathML (Mathematical Mark up Language)などであってもよく、 SGML (Standard Generalized Markup Language) 、 HTML (HyperText Markup Language)などであってもよい。キーワードとは文書の ファイル名に含まれる拡張子や、文書内に記述された要素名(タグ名)または属性名 など、名前空間を推し量ることのできるものでよい。
[0008] また、本文書処理装置は、前記データ名特定部において検出された複数の名前空 間をユーザに提示し、ユーザがそのいずれかを選択することにより名前空間を特定 する、名前空間提示部をさらに含んでもよい。さらに、前記名前空間情報格納部は、 過去に処理した文書に含まれる構成要素が属する名前空間と、その文書に含まれる キーワードとの対応関係に係る情報を逐次記憶し、その情報をもとに名前空間特定 を行ってもよい。
[0009] 本発明の別の態様は、文書処理方法に関する。この文書処理方法は、マークアツ プ言語により記述された文書に含まれる構成要素が属する名前空間を検出するステ ップと、前記検出するステップにおいて正確な名前空間が識別されな力つた際に、前 記文書から所定の条件に基づいたキーワードを抽出し、それをもとに、あらかじめ記 憶された前記キーワードと前記名前空間との対応関係に係る情報を参照して前記名 前空間を特定するステップと、検出または特定された前記名前空間に基づき、前記 文書を表示し、ユーザによる前記文書の編集を受け付けるステップと、を含むことを 特徴とする。
[0010] なお、以上の構成要素の任意の組合せ、本発明の表現をシステム、記録媒体など の間で変換したものもまた、本発明の態様として有効である。
発明の効果
[0011] 本発明によれば、構造化文書の適切な処理を支援する技術を提供することができ る。
図面の簡単な説明
[0012] [図 1]前提技術に係る文書処理装置の構成を示す図である。
[図 2]処理対象となる XML文書の例を示す図である。
[図 3]図 2に示した XML文書を HTMLで記述された表にマッピングする例を示す図 である。
[図 4(a)]図 2に示した XML文書を図 3に示した表にマッピングするための定義フアイ ルの例を示す図である。
[図 4(b)]図 2に示した XML文書を図 3に示した表にマッピングするための定義フアイ ルの例を示す図である。
[図 5]図 2に示した成績管理ボキヤブラリで記述された XML文書を、図 3に示した対 応により HTMLにマッピングして表示した画面の例を示す図である。
[図 6]ユーザが定義ファイルを生成するために、定義ファイル生成部がユーザに提示 するグラフィカルユーザインターフェースの例を示す図である。
[図 7]定義ファイル生成部により生成された画面レイアウトの他の例を示す図である。
[図 8]文書処理装置による XML文書の編集画面の一例を示す図である。
[図 9]文書処理装置により編集される XML文書の他の例を示す図である。
[図 10]図 9に示した文書を表示した画面の例を示す図である。
[図 11]実施例に係る文書処理装置の構成を示す図である。
[図 12]名前空間を特定する手順を示すフローチャートである。
[図 13]名前空間 URIの記載のない XHTML文書の例を示す図である。
[図 14]拡張子と名前空間の対応付けを示すテーブルの構成例を示す図である。
[図 15]名前空間 URIの記載された XHTML文書の例を示す図である。 [図 16]名前空間 URIの記載のない、 日記タグを用いた XML文書の例を示す図であ る。
[図 17]名前空間 URIの記載のある、 日記タグを用いた XML文書の例を示す図であ る。
[図 18]図 17の XML文書において指定されたスタイルシートファイルの例を示す図で ある。
[図 19]スタイルシートを指定した XML文書の例を示す図である。
[図 20]図 19の XML文書において指定されたスタイルシートファイルの例を示す図で ある。
符号の説明
[0013] 20 文書処理装置、 22 主制御ユニット、 24 編集ユニット、 30 DOMユニット、 3 2 DOM提供部、 34 DOM生成部、 36 出力部、 40 CSSュ-ッ K 42 CSS解 析部、 44 CSS提供部、 46 レンダリング部、 50 HTMLユニット、 52, 62 制御部 、 54, 64 編集部、 56, 66 表示部、 60 SVGユニット、 80 VCユニット、 82 マツ ビング部、 84 定義ファイル取得部、 86 定義ファイル生成部、 300 文書処理装置 、 310 名前空間検出部、 312 名前空間特定部、 314 名前空間表示部、 316 名 前空間情報格納部。
発明を実施するための最良の形態
[0014] 以下、本発明の前提となる技術の説明を行った上で、本実施例の詳細を説明する
[0015] (前提技術)
図 1は、前提技術に係る文書処理装置 20の構成を示す。文書処理装置 20は、文 書内のデータが階層構造を有する複数の構成要素に分類された構造化文書を処理 するが、本前提技術では構造化文書の一例として XML文書を処理する例にっ ヽて 説明する。文書処理装置 20は、主制御ユニット 22、編集ユニット 24、 DOMユニット 3 0、 CSSユニット 40、 HTMLユニット 50、 SVGユニット 60、及び変換部の一例である VCユニット 80を備える。これらの構成は、ハードウェアコンポーネントでいえば、任意 のコンピュータの CPU、メモリ、メモリにロードされたプログラムなどによって実現され る力 ここではそれらの連携によって実現される機能ブロックを描いている。したがつ て、これらの機能ブロックがハードウェアのみ、ソフトウェアのみ、またはそれらの組合 せによっていろいろな形で実現できることは、当業者には理解されるところである。
[0016] 主制御ユニット 22は、プラグインのロードや、コマンド実行のフレームワークを提供 する。編集ユニット 24は、 XML文書を編集するためのフレームワークを提供する。文 書処理装置 20における文書の表示及び編集機能は、プラグインにより実現されてお り、文書の種別に応じて必要なプラグインが主制御ユニット 22又は編集ユニット 24に よりロードされる。主制御ユニット 22又は編集ユニット 24は、処理対象となる XML文 書の名前空間を参照して、 XML文書が 、ずれのボキヤブラリにより記述されて 、る かを判別し、そのボキヤブラリに対応した表示又は編集用のプラグインをロードして表 示や編集を実行させる。例えば、文書処理装置 20には、 HTML文書の表示及び編 集を行う HTMLユニット 50、 SVG文書の表示及び編集を行う SVGユニット 60など、 ボキヤブラリ(タグセット)ごとに表示系及び編集系がプラグインとして実装されており、 HTML文書を編集するときは HTMLユニット 50が、 S VG文書を編集するときは S V Gユニット 60が、それぞれロードされる。後述するように、 HTMLと SVGの双方の構 成要素を含む複合文書が処理対象となって ヽる場合は、 HTMLユニット 50と SVG ユニット 60の双方がロードされる。
[0017] このような構成によれば、ユーザは、必要な機能のみを選択してインストールし、後 力 適宜機能を追加又は削除することができるので、プログラムを格納するハードデ イスクなどの記録媒体の記憶領域を有効に活用することができ、また、プログラム実行 時にも、メモリの浪費を防ぐことができる。また、機能拡張性に優れており、開発主体 としても、プラグインの形で新たなボキヤブラリに対応することが可能なので開発が容 易となり、ユーザとしても、プラグインの追カ卩により容易かつ低コストにて機能を追カロ することができる。
[0018] 編集ユニット 24は、ユーザインターフェースを介してユーザ力も編集指示のイベント を受け付け、そのイベントを適切なプラグインなどに通知するともに、イベントの再実 行 (リドウ)又は実行の取消(アンドゥ)などの処理を制御する。
[0019] DOMユニット 30は、 DOM提供部 32、 DOM生成部 34、及び出力部 36を含み、 X ML文書をデータとして扱うときのアクセス方法を提供するために定められた文書ォ ブジェクトモデル(Document Object Model: DOM)に準拠した機能を実現する。 DO M提供部 32は、編集ユニット 24に定義されているインタフェースを満たす DOMの実 装である。 DOM生成部 34は、 XML文書力も DOMツリーを生成する。後述するよう に、処理対象となる XML文書力 VCユニット 80により他のボキヤブラリにマッピング される場合は、マッピング元の XML文書に対応するソースツリーと、マッピング先の X ML文書に対応するデスティネーションツリーが生成される。出力部 36は、例えば編 集終了時に、 DOMツリーを XML文書として出力する。
[0020] CSSユニット 40は、 CSS解析部 42、 CSS提供部 44、及びレンダリング部 46を含 み、 CSSに準拠した表示機能を提供する。 CSS解析部 42は、 CSSの構文を解析す るバーサの機能を有する。 CSS提供部 44は、 CSSオブジェクトの実装であり、 DOM ツリーに対して CSSのカスケード処理を行う。レンダリング部 46は、 CSSのレンダリン グエンジンであり、 CSSを用いてレイアウトされる HTMLなどのボキヤブラリで記述さ れた文書の表示に用いられる。
[0021] HTMLユニット 50は、 HTMLにより記述された文書を表示又は編集する。 SVGュ ニット 60は、 SVGにより記述された文書を表示又は編集する。これらの表示 Z編集 系は、プラグインの形で実現されており、それぞれ、文書を表示する表示部(Canvas) 56、 66、編集指示を含むイベントを送受信する制御部(Editlet) 52、 62、編集コマン ドを受けて DOMに対して編集を行う編集部 (Zone) 54、 64を備える。制御部 52又は 62が外部力も DOMツリーの編集コマンドを受け付けると、編集部 54又は 64が DO Mツリーを変更し、表示部 56又は 66が表示を更新する。これらは、 MVC (Model-Vi ew-Controller)と呼ばれるフレームワークに類似する構成をとつており、概ね、表示部 56及び 66が「View」に、制御部 52及び 62が「Controller」に、編集部 54及び 64と D OMの実体が「Model」に、それぞれ対応する。本前提技術の文書処理装置 20では、 XML文書をツリー表示形式で編集するだけでなく、それぞれのボキヤブラリに応じた 編集を可能とする。例えば、 HTMLユニット 50は、 HTML文書をワードプロセッサに 類似した方式で編集するためのユーザインターフェースを提供し、 SVGユニット 60は 、 SVG文書を画像描画ツールに類似した方式で編集するためのユーザインターフエ ースを提供する。
[0022] VCユニット 80は、マッピング部 82、定義ファイル取得部 84、及び定義ファイル生 成部 86を含み、あるボキヤブラリにより記述された文書を、他のボキヤブラリにマツピ ングすることにより、マッピング先のボキヤブラリに対応した表示編集用プラグインで文 書を表示又は編集するためのフレームワークを提供する。本前提技術では、この機 能を、ボキヤブラリコネクション(Vocabulary Connection: VC)と呼ぶ。定義ファイル取 得部 84は、マッピングの定義を記述したスクリプトファイルを取得する。この定義ファ ィルは、ノードごとに、ノード間の対応 (コネクション)を記述する。このとき、各ノードの 要素値や属性値の編集の可否を指定してもよい。また、ノードの要素値や属性値を 用いた演算式を記述してもよい。これらの機能については、後で詳述する。マツピン グ部 82は、定義ファイル取得部 84が取得したスクリプトファイルを参照して、 DOM生 成部 34にデスティネーションツリーを生成させ、ソースツリーとデスティネーションッリ 一の対応関係を管理する。定義ファイル生成部 86は、ユーザが定義ファイルを生成 するためのグラフィカルユーザインターフェースを提供する。
[0023] VCユニット 80は、ソースツリーとデスティネーションツリーの間のコネクションを監視 し、表示を担当するプラグインにより提供されるユーザインタフェースを介してユーザ 力も編集指示を受け付けると、まずソースツリーの該当するノードを変更する。 DOM ユニット 30が、ソースツリーが変更された旨のミューテーシヨンイベントを発行すると、 VCユニット 80は、そのミューテーシヨンイベントを受けて、ソースツリーの変更にデス ティネーシヨンツリーを同期させるベぐ変更されたノードに対応するデスティネーショ ンツリーのノードを変更する。デスティネーションツリーを表示/編集するプラグイン、 例えば HTMLユニット 50は、デスティネーションツリーが変更された旨のミューテー シヨンイベントを受けて、変更されたデスティネーションツリーを参照して表示を更新 する。このような構成により、少数のユーザにより利用されるローカルなボキヤブラリに より記述された文書であっても、他のメジャーなボキヤブラリに変換することで、文書を 表示することができるとともに、編集環境が提供される。
[0024] 文書処理装置 20により文書を表示又は編集する動作について説明する。文書処 理装置 20が処理対象となる文書を読み込むと、 DOM生成部 34が、その XML文書 力も DOMツリーを生成する。また、主制御ユニット 22又は編集ユニット 24は、名前空 間を参照して文書を記述しているボキヤブラリを判別する。そのボキヤブラリに対応し たプラグインが文書処理装置 20にインストールされて 、る場合は、そのプラグインを ロードして、文書を表示/編集させる。プラグインカ Sインストールされていない場合は 、マッピングの定義ファイルが存在するか否かを確認する。定義ファイルが存在する 場合、定義ファイル取得部 84が定義ファイルを取得し、その定義に従って、デスティ ネーシヨンツリーが生成され、マッピング先のボキヤブラリに対応するプラグインにより 文書が表示 Z編集される。複数のボキヤブラリを含む複合文書である場合は、後述 するように、それぞれのボキヤブラリに対応したプラグインにより、文書の該当箇所が それぞれ表示 Z編集される。定義ファイルが存在しない場合は、文書のソース又はッ リー構造を表示し、その表示画面にぉ 、て編集が行われる。
[0025] 図 2は、処理対象となる XML文書の例を示す。この XML文書は、生徒の成績デー タを管理するために用いられる。 XML文書のトップノードである構成要素「成績」は、 配下に、生徒ごとに設けられた構成要素「生徒」を複数有する。構成要素「生徒」は、 属性値「名前」と、子要素「国語」、「数学」、「理科」、「社会」を有する。属性値「名前」 は、生徒の名前を格納する。構成要素「国語」、「数学」、「理科」、「社会」は、それぞ れ、国語、数学、理科、社会の成績を格納する。例えば、名前カ^ A」である生徒の国 語の成績は「90」、数学の成績は「50」、理科の成績は「75」、社会の成績は「60」で ある。以下、この文書で使用されているボキヤブラリ(タグセット)を、「成績管理ボキヤ ブラリ」と呼ぶ。
[0026] 本前提技術の文書処理装置 20は、成績管理ボキヤブラリの表示 Z編集に対応し たプラグインを有しないので、この文書をソース表示、ツリー表示以外の方法で表示 するためには、前述した VC機能が用いられる。すなわち、成績管理ボキヤブラリを、 プラグインが用意された別のボキヤブラリ、例えば、 HTMLや SVGなどにマッピング するための定義ファイルを用意する必要がある。ユーザ自身が定義ファイルを作成す るためのユーザインターフェースについては後述することにして、ここでは、既に定義 ファイルが用意されているとして説明を進める。
[0027] 図 3は、図 2に示した XML文書を HTMLで記述された表にマッピングする例を示 す。図 3の例では、成績管理ボキヤブラリの「生徒」ノードを、 HTMLにおける表(「TA BLE」ノード)の行(「TR」ノード)に対応づけ、各行の第 1列には属性値「名前」を、第 2 列には「国語」ノードの要素値を、第 3列には「数学」ノードの要素値を、第 4列には「 理科」ノードの要素値を、第 5列には「社会」ノードの要素値を、それぞれ対応付ける 。これにより、図 2に示した XML文書を、 HTMLの表形式で表示することができる。 また、これらの属性値及び要素値は、編集可能であることが指定されており、ユーザ が HTMLによる表示画面上で、 HTMLユニット 50の編集機能により、これらの値を 編集することができる。第 6列には、国語、数学、理科、社会の成績の加重平均を算 出する演算式が指定されており、生徒の成績の平均点が表示される。このように、定 義ファイルに演算式を指定可能とすることにより、より柔軟な表示が可能となり、編集 時のユーザの利便性を向上させることができる。なお、第 6列は、編集不可であること が指定されており、平均点のみを個別に編集することができないようにしている。この ように、マッピング定義において、編集の可否を指定可能とすることにより、ユーザの 誤操作を防ぐことができる。
[0028] 図 4 (a)及び図 4 (b)は、図 2に示した XML文書を図 3に示した表にマッピングする ための定義ファイルの例を示す。この定義ファイルは、定義ファイル用に定義された スクリプト言語により記述される。定義ファイルには、コマンドの定義と、表示のテンプ レートが記述されている。図 4 (a) (b)の例では、コマンドとして、「生徒の追加」と「生 徒の削除」が定義されており、それぞれ、ソースツリーにノード「生徒」を挿入する操作 と、ソースツリーからノード「生徒」を削除する操作が対応付けられている。また、テン プレートとして、表の第 1行に「名前」、「国語」などの見出しが表示され、第 2行以降 に、ノード「生徒」の内容が表示されることが記述されている。ノード「生徒」の内容を 表示するテンプレート中、「text-of」と記述された項は「編集可能」であることを意味し 、「value-of」と記述された項は「編集不可能」であることを意味する。また、ノード「生 徒」の内容を表示する行のうち、第 6列には、「(src:国語 + src:数学 + src:理科 + src: 社会) div 4」という計算式が記述されており、生徒の成績の平均が表示されることを 意味する。
[0029] 図 5は、図 2に示した成績管理ボキヤブラリで記述された XML文書を、図 3に示した 対応により HTMLにマッピングして表示した画面の例を示す。表 90の各行には、左 から、各生徒の名前、国語の成績、数学の成績、理科の成績、社会の成績、及び平 均点が表示されている。ユーザは、この画面上で、 XML文書を編集することができる 。たとえば、第 2行第 3列の値を「70」に変更すると、このノードに対応するソースッリ 一の要素値、すなわち、生徒「B」の数学の成績が「70」に変更される。このとき、 VC ユニット 80は、デスティネーションツリーをソースツリーに追従させるベぐデスティネ ーシヨンツリーの該当箇所を変更し、 HTMLユニット 50力 変更されたデスティネー シヨンツリーに基づいて表示を更新する。したがって、画面上の表においても、生徒「 B」の数学の成績が「70」に変更され、更に、平均点が「55」に変更される。
[0030] 図 5に示した画面には、図 4 (a) (b)に示した定義ファイルに定義されたように、「生 徒の追加」及び「生徒の削除」のコマンドカ -ユーに表示される。ユーザがこれらの コマンドを選択すると、ソースツリーにおいて、ノード「生徒」が追加又は削除される。 このように、本前提技術の文書処理装置 20では、階層構造の末端の構成要素の要 素値を編集するのみではなぐ階層構造を編集することも可能である。このようなッリ 一構造の編集機能は、コマンドの形でユーザに提供されてもよい。また、例えば、表 の行を追加又は削除するコマンドが、ノード「生徒」を追加又は削除する操作に対応 づけられてもよい。また、他のボキヤブラリを埋め込むコマンドがユーザに提供されて もよい。この表を入力用テンプレートとして、穴埋め形式で新たな生徒の成績データ を追加することもできる。以上のように、 VC機能により、 HTMLユニット 50の表示 Z 編集機能を利用しつつ、成績管理ボキヤブラリで記述された文書を編集することが可 能となる。
[0031] 図 6は、ユーザが定義ファイルを生成するために、定義ファイル生成部 86がユーザ に提示するグラフィカルユーザインタフェースの例を示す。画面左側の領域 91には、 マッピング元の XML文書がツリー表示されている。画面右側の領域 92には、マツピ ング先の XML文書の画面レイアウトが示されている。この画面レイアウトは、 HTML ユニット 50により編集可能となっており、ユーザは、画面右側の領域 92において、文 書を表示するための画面レイアウトを作成する。そして、例えば、マウスなどのポイン ティングデバイスにより、画面左側の領域 91に表示されたマッピング元の XML文書 のノードを、画面右側の領域 92に表示された HTMLによる画面レイアウト中へドラッ グ&ドロップ操作を行うことにより、マッピング元のノードと、マッピング先のノードとの コネクションが指定される。例えば、要素「生徒」の子要素である「数学」を、 HTML画 面の表 90の第 1行第 3列にドロップすると、「数学」ノードと、 3列目の「TD」ノードの間 にコネクションが張られる。各ノードには、編集の可否が指定できるようになつている。 また、表示画面中には、演算式を埋め込むこともできる。画面の編集が終わると、定 義ファイル生成部 86は、画面レイアウトとノード間のコネクションを記述した定義フアイ ルを生成する。
[0032] XHTML, MathML、 SVGなどの主要なボキヤブラリに対応したビューヮゃエディ タは既に開発されて 、るが、図 2に示した文書のようなオリジナルなボキヤブラリで記 述された文書に対応したビューヮゃエディタを開発するのは現実的でな 、。しかし、 上記のように、他のボキヤブラリにマッピングするための定義ファイルを作成すれば、 ビューヮゃエディタを開発しなくても、 VC機能を利用して、オリジナルなボキヤブラリ で記述された文書を表示 ·編集することができる。
[0033] 図 7は、定義ファイル生成部 86により生成された画面レイアウトの他の例を示す。図 7の例では、成績管理ボキヤブラリで記述された XML文書を表示するための画面に 、表 90と、円グラフ 93が作成されている。この円グラフ 93は、 SVGにより記述される。 後述するように、本前提技術の文書処理装置 20は、一つの XML文書内に複数のボ キヤブラリを含む複合文書を処理することができるので、この例のように、 HTMLで記 述された表 90と、 SVGで記述された円グラフ 93とを、一つの画面上に表示すること ができる。
[0034] 図 8は、文書処理装置 20による XML文書の編集画面の一例を示す。図 8の例で は、一つの画面が複数に分割されており、それぞれの領域において、処理対象とな る XML文書を異なる複数の表示形式により表示している。領域 94には、文書のソー スが表示されており、領域 95には、文書のツリー構造が表示されており、領域 96に は、図 5に示した HTMLにより記述された表が表示されている。これらのいずれの画 面上においても、文書の編集が可能であり、いずれかの画面上でユーザが編集を行 うと、ソースツリーが変更され、それぞれの画面の表示を担当するプラグインカ、ソー スツリーの変更を反映すべく画面を更新する。具体的には、ソースツリーの変更を通 知するミューテーシヨンイベントのリスナーとして、それぞれの編集画面の表示を担当 するプラグインの表示部を登録しておき、いずれかのプラグイン又は VCユニット 80に よりソースツリーが変更されたときに、編集画面を表示中の全ての表示部が、発行さ れたミューテーシヨンイベントを受け取って画面を更新する。このとき、プラグインが V C機能により表示を行っている場合は、 VCユニット 80がソースツリーの変更に追従し てデスティネーションツリーを変更した後、変更されたデスティネーションツリーを参照 してプラグインの表示部が画面を更新する。
[0035] 例えば、ソース表示及びツリー表示を、専用のプラグインにより実現している場合は 、ソース表示用プラグインとツリー表示用プラグインは、デスティネーションツリーを用 いず、直接ソースツリーを参照して表示を行う。この場合、いずれかの画面において 編集が行われると、ソース表示用プラグインとツリー表示用プラグインは、変更された ソースツリーを参照して画面を更新し、領域 96の画面を担当して!/、る HTMLユニット 50は、ソースツリーの変更に追従して変更されたデスティネーションツリーを参照して 画面を更新する。
[0036] ソース表示及びツリー表示は、 VC機能を利用して実現することもできる。すなわち 、ソース、ツリー構造を HTMLによりレイアウトし、その HTMLに XML文書をマツピン グして、 HTMLユニット 50により表示してもよい。この場合、ソース形式、ツリー形式、 表形式の 3つのデスティネーションツリーが生成されることになる。いずれかの画面に おいて編集が行われると、 VCユニット 80は、ソースツリーを変更した後、ソース形式、 ツリー形式、表形式の 3つのデスティネーションツリーをそれぞれ変更し、 HTMLュ ニット 50は、それらのデスティネーションツリーを参照して、 3つの画面を更新する。
[0037] このように、一つの画面上に複数の表示形式で文書を表示することにより、ユーザ の利便性を向上させることができる。例えば、ユーザは、ソース表示又はツリー表示 により文書の階層構造を把握しつつ、表 90などを用いて視覚的に分力りやすい形式 で文書を表示し、編集することができる。上記の例では、一つの画面を分割して複数 の表示形式による画面を同時に表示した力 一つの画面に一つの表示形式による画 面を表示し、表示形式をユーザの指示により切り替え可能としてもよい。この場合、主 制御ユニット 22が、ユーザから表示形式の切り替え要求を受け付け、各プラグインに 指示して表示を切り替える。
[0038] 図 9は、文書処理装置 20により編集される XML文書の他の例を示す。図 9に示し た XML文書では、 SVG文書の「foreignObject」タグの中に XHTML文書が埋め込 まれており、さら〖こ、 XHTML文書の中に MathMLで記述された数式が入っている 。このような場合、編集ユニット 24が、名前空間を参照して、適切な表示系に描画作 業を振り分ける。図 9の例では、編集ユニット 24は、まず、 SVGユニット 60に四角形 を描画させ、つづいて、 HTMLユニット 50に XHTML文書を描画させる。さらに、図 示しない MathMLユニットに、数式を描画させる。こうして、複数のボキヤブラリを包 含する複合文書が適切に表示される。表示結果を図 10に示す。
[0039] 文書編集中、カーソル (キャリッジ)の位置に応じて、表示されるメニューを切り替え てもよい。すなわち、カーソルが、 SVG文書が表示された領域内に存在するときは、 SVGユニット 60が提供するメニュー、又は SVG文書をマッピングするための定義フ アイルに定義されたコマンドを表示し、カーソルが、 XHTML文書が表示された領域 内に存在するときは、 HTMLユニット 50が提供するメニュー、又は XHTML文書を マッピングするための定義ファイルに定義されたコマンドを表示する。これにより、編 集位置に応じて適切なユーザインターフェースを提供することができる。
[0040] 複合文書にお!、て、あるボキヤブラリに対応する適切なプラグイン又はマッピング定 義ファイルがな力つた場合は、そのボキヤブラリにより記述された部分は、ソース表示 又はツリー表示されてもよい。従来、ある文書に他の文書を埋め込んだ複合文書を 開くとき、埋め込まれた文書を表示するアプリケーション力 Sインストールされて 、な 、と 、その内容を表示することができな力つた力 本前提技術では、表示用のアプリケー シヨンが存在しなくても、テキストデータにより構成された XML文書をソース表示又は ツリー表示することにより内容を把握することができる。これは、テキストベースである XMLなどの文書ならではの特徴と 、える。
[0041] データがテキストベースで記述されることの他の利点として、例えば、複合文書中の 、あるボキヤブラリにより記述される部分において、同一文書内の他のボキヤブラリで 記述された部分のデータを参照してもよい。また、文書内で検索を実行する時に、 S VGなどの図に埋め込まれた文字列も検索対象とすることができる。
[0042] あるボキヤブラリにより記述された文書内に、他のボキヤブラリのタグを用いてもよい 。この XML文書は、妥当(valid)ではないが、整形式 (welH rmed)であれば、有効な XML文書として処理可能である。この場合、挿入された他のボキヤブラリのタグは、 定義ファイルによりマッピングされてもよい。例えば、 XHTML文書中に、「重要」、「 最重要」などのタグを使用し、これらのタグで囲まれた部分を強調表示してもよ 、し、 重要度の順にソートして表示してもよ 、。
[0043] 図 10に示した編集画面において、ユーザにより文書が編集されると、編集された部 分を担当するプラグイン又は VCユニット 80がソースツリーを変更する。ソースツリー には、ノードごとにミューテーシヨンイベントのリスナーを登録できるようになっており、 通常は、各ノードが属するボキヤブラリに対応したプラグインの表示部又は VCュ-ッ ト 80がリスナーとして登録される。 DOM提供部 32は、ソースツリーが変更されると、 変更されたノードから上位の階層へたどって、登録されたリスナーがあれば、そのリス ナ一へミューテーシヨンイベントを発行する。例えば、図 9に示した文書において、く html >ノードの下位のノードが変更された場合、く html >ノードにリスナーとして登 録された HTMLユニット 50にミューテーシヨンイベントが通知されるとともに、その上 位のく svg>ノードにリスナーとして登録された SVGユニット 60にもミューテーシヨン イベントが通知される。このとき、 HTMLユニット 50は、変更されたソースツリーを参 照して表示を更新する。 SVGユニット 60は、自身のボキヤブラリに属するノードが変 更されて!/、な!/、ので、ミューテーシヨンイベントを無視してもよ!/、。
[0044] 編集の内容によっては、 HTMLユニット 50による表示の更新に伴って、全体のレイ アウトが変わる可能性がある。この場合は、画面のレイアウトを管理する構成、例えば 最上位のノードの表示を担当するプラグインにより、プラグインごとの表示領域のレイ アウトが更新される。例えば、 HTMLユニット 50による表示領域が以前より大きくなつ た場合、 HTMLユニット 50は、まず自身の担当する部分を描画して、表示領域の大 きさを決定する。そして、画面のレイアウトを管理する構成に、変更後の表示領域の 大きさを通知し、レイアウトの更新を依頼する。画面のレイアウトを管理する構成は、 通知を受けて、プラグインごとの表示領域を再レイアウトする。こうして、編集された部 分の表示が適切に更新されるとともに、画面全体のレイアウトが更新される。
以上の前提技術をもとに、以下実施の形態の詳細について説明する。
[0045] (実施の形態)
本発明の実施の形態における文書処理装置は、上述の前提技術を基礎として構 成されており、前提技術における文書処理装置は基本的に本実施の形態の文書処 理装置の一部に含まれるものとする。また本実施の形態では主に、構造化文書の一 例として XMLで構造ィ匕された文書ファイルを処理する例について説明する。
[0046] 図 11は、本実施の形態に係る文書処理装置 300を示す。本図において図 1と同一 の符号を付した構成は、図 1で説明した構成と同一または同様の機能を有する。本 実施の形態に係る文書処理装置 300にお ヽて図 1に記載のな!、構成として、主制御 ユニット 22は、名前空間検出部 310、名前空間特定部 312、名前空間表示部 314を 備え、名前空間情報格納部 316と接続されている。名前空間検出部 310は、処理対 象となる XML文書を読込み、名前空間を識別するための情報、例えば名前空間 UR Iが記述されている行を検出する。名前空間を識別するための情報が検出されなかつ た場合、または検出された名前空間 URIが誤りであった場合など、正確な名前空間 が識別できな力つたとき、名前空間特定部 312は、その旨の信号を名前空間検出部 310より受け取り、名前空間情報格納部 316に問い合わせながら、名前空間の検索 、特定を行う。名前空間表示部 314は、特定された名前空間または名前空間候補を 表示する。候補となる名前空間が最終的に特定されなかった場合は、名前空間表示 部 314は、例えば XML文書のソースなどを表示してもよい。名前空間情報格納部 3 16には、名前空間を導出するためのキーとなる文字列、例えば処理対象となる XML 文書のファイル名に含まれる拡張子や、文書内部に記述されている要素名や属性名 などと、名前空間との対応関係を表す情報をあらかじめ格納しておく。対応関係を表 す情報については後述する力 例えば、拡張子「html」に対して、名前空間 URI「htt p:〃胃 w.w3.org/1999/xhtml」を対応付けたテーブルなどである。以後、名前空間情 報格納部 316には拡張子またはタグ名と、名前空間との対応関係を表す情報が格 納されているとして説明する。
[0047] 図 12は名前空間特定部 312が名前空間情報格納部 316との連携により、名前空 間を特定する手順を示すフローチャートである。まず、名前空間検出部 310より、処 理対象の XML文書中に正確な名前空間を識別できなかった旨の信号を受け取ると (S 10)、 XML文書のファイル名力も拡張子を取得する(S 12)。取得された拡張子を もとに、名前空間情報格納部 316に問い合わせを行い、当該拡張子に対応付けられ て 、る名前空間を検索する (S 14)。拡張子に対応した名前空間が唯一存在する場 合 (S16の Y)、その名前空間のデータを名前空間表示部 314へ送出する(S18)。 名前空間情報格納部 316において当該拡張子の対応付けが存在しない場合、また は複数の名前空間が検出された場合 (S16の N)、XML文書中に含まれる構成要素 の要素名(タグ名)の抽出を行う(S20)。ここでの抽出はタグ名以外に属性名でもよ い。以後、それらのキーワードを代表して、タグ名を用いて説明を行う。タグ名が抽出 されたら(S22の Y)抽出されたタグ名に基づき、後述するような所定の手法により名 前空間の検出を行い(S24)、名前空間が得られた場合は(S26の Y)、そのデータを 名前空間表示部 314へ送出する(S28)。抽出された全てのタグ名に対して、それに 対応する名前空間の情報が名前空間情報格納部 316に存在しなかった場合など、 名前空間が検出できな力つたときや (S26の N)、タグ名が抽出されな力つたとき(S2 2の N)は、対応付け不在信号を名前空間表示部 314へ送信する(S30)。
[0048] 名前空間表示部 314では、名前空間特定部 312において唯一特定された名前空 間の表示を行い、ユーザが最終的に確認を行えるようにしてもよい。このようにして特 定された名前空間を参照し、前提技術と同様に、主制御ユニット 22または編集ュ-ッ ト 24において、 XML文書のボキヤブラリを判別し、そのボキヤブラリに対応した表示 又は編集用のプラグインを利用して表示や編集を実行する。ここで、特定された名前 空間のボキヤブラリを処理するプラグインが当該文書処理装置にインストールされて いない場合は、プラグインのロードを促すメッセージをユーザに示したり、自動的にダ ゥンロードさせるようにしてもよ ヽ。
[0049] 以上の構成により、名前空間の記載がな力つたり、誤記があったりした XML文書を 処理したときでも、ファイルの拡張子や文書中の要素名、属性名など力 自動的に名 前空間を特定することが可能となるため、ユーザが文書中、名前空間のない箇所を 搜索したり、名前空間の検索を自ら行ったりする手間を力けることなぐ文書処理を続 行させることができる。従って処理に力かる時間的コストが軽減される。さらに本実施 の形態は、このような XML文書を読込んだときに発生しがちなシステムダウンを回避 する措置としても位置づけられ、ユーザに対して原因および解決策を提示することが できるため、理解し易ぐ親しみやすい文書処理装置となる。
[0050] 名前空間特定部 312では、名前空間候補が複数存在する場合に、その最終的な 特定を自動的に行わずに、名前空間表示部 314に表示するようにしてもよい。例え ば図 12の S16では、唯一検出された名前空間のみ S18におけるデータ送出対象と したが、複数検出された場合でもそのデータを名前空間表示部 314へ送出し、全て の候補を表示するようにしてもょ 、。このときユーザはそれらの中から適切な名前空 間を選択し、設定を行えるようにしてもよい。また、後述する計算手法により確率を計 算し、確率の高 、名前空間を!、くつか表示するようにしてもょ 、。
[0051] このように、拡張子やタグ名など、複数のキーワードから名前空間を特定する場合 は、検出された名前空間の確率計算を行ったりすることで、名前空間特定に対する 確度が増す。また、名前空間の自動的な特定ができな力つた場合でも、名前空間の 候補を絞り込みユーザに提示することで、ユーザが全ての作業を行う場合に比べ、そ の手間が軽減される。
[0052] 上述した拡張子力 の検索や、タグ名からの検索は、先にタグ名力 の検索を行つ たり、どちらか一方のみを行うなど、任意の組み合わせ方でよい。また、検索キーは 拡張子や要素名、属性名に限定されるものではない。
[0053] 名前空間表示部 314は、名前空間特定部 312からの対応付け不在信号を受け取 ると、処理中の XML文書のソースファイルをそのまま表示し、名前空間が検出されな Vヽ旨の表示をユーザに対して行ってもよ!、。さらにユーザが名前空間を識別するた めの記述を挿入するなど XML文書を直接修正できるようにしてもょ 、。
[0054] ここで、名前空間特定部 312において名前空間を特定、またはその候補を絞り込 む手法について具体的に説明する。図 13は名前空間を識別するための情報である 、 URIの記載がない XHTML文書の例である。図 13に示した文書の例では、く hea d>、 < title >,く body >といった要素型が属する名前空間を識別するための情報 が記載されていない。このように、 XHTML文書などの一般的な文書において名前 空間を推測する場合は、ルールベースの手法により名前空間の特定を行うのが現実 的である。
[0055] 図 14は、ルールベースの手法で参照される、名前空間情報格納部 316に格納され たテーブルの構成例 400を示す。このテーブルは、拡張子名欄 400a、名前空間情 報欄 400bより構成されている。このテーブルを参照し名前空間を特定するステップ は、図 12の S14に相当する。例えば、処理対象となる文書のファイル名が「bunsho.ht ml」であった場合、拡張子「html」に基づきこのテーブルを検索することにより、名前 空間を示す URIが「http:〃 www. w3.org/1999/xhtml」であることが特定される。この検 索手法は、当該文書が単独の XMLファイルとして提供されており、非複合文書であ る場合には、計算コストが少なく有効である。
[0056] 拡張子力 の検索によって複数の名前空間が検出されたときや、名前空間が検出 されなかった場合などは、図 14に示したテーブルの構成例 400のうち拡張子名欄 40 Oaの代わりにタグ名欄を構成要素としたテーブルを参照して、ルールベースの手法 を適用してもよい。このステップは、図 12の S24に相当する。例えば、図 13に示した XML文書では、ルートノードのタグ名力 「html」である。それに基づき図 14と同様の テーブルを参照することにより、名前空間が「http:〃 www. w3.org/1999/xhtml」と特定 される。ユーザまたはシステム構築者は、図 14に示したようなテーブルをあら力じめ 作成し、名前空間情報格納部 316に格納する。
[0057] ルートノードのタグ名によって検出された名前空間が複数ある場合などは、さらに下 位の階層の構成要素について同様の特定を行ってもよい。このとき、名前空間情報 格納部 316には、例えば、第 1層タグ名欄、第 2層タグ名欄および名前空間情報欄 が設けられたテーブルを格納してもよい。図 13に示した XHTML文書の場合は、例 えば第 1層のタグ名力 s「html」であり、第 2層のタグ名が「head」、 「title」、 「body」で あることに基づき、名前空間情報格納部 316に記憶されたテーブルを検索し、名前 空間を特定する。その他の例として、第 1層のタグ名が「3 8」であり、第 2層のタグ名 が「desc」、 「rect」、 「polyline」などであったら SVGで記述されて!、る、第 1層のタグ 名力 S「math」であり、第 2層のタグ名力 S「mi」、 「mo」、 「mfrac」であったら MathMLで 記述されている、というように名前空間を特定してよい。このように、検索キーとなるタ グ名の階層を増やすことにより、名前空間特定の確度を上げることができ、また、候補 の絞込みを効率よく行うことができる。なお、これまでの記述では、拡張子、第 1層の タグ名、第 2層のタグ名というように段階的に検索キーを増カロさせていった力 最初か ら拡張子および複数層のタグ名を検索キーとしてもょ 、し、タグ名のみを検索キーと してちよい。
[0058] 名前空間情報格納部 316には、名前空間の記載がある XML文書などを文書処理 装置にあら力じめ学習させ、その文書が参照した名前空間と、その文書中のタグ名 やファイルの拡張子などとの対応関係の情報を保持する、教師有り学習を行う確率 的分類器 (図示せず)をさらに設けてもよい。教師有り学習を行う確率的分類器には 、ベイズの定理や SVM (Support Vector Machine)など既存の手法を適用してよい。
[0059] 以下に、ベイズの定理によって名前空間を絞り込む簡単な計算例を示す。まず、 S VGのファイルを判定する教師データとして、「svg」要素が 1回、「desc」要素が 3回、 「rect」要素が 3回出現するファイルを分類器に学習させたとする。これを分類 Aとす る。次に、 MathMLを判定する教師データとして、「math」要素が 1回、「mi」要素が 4回、「mfrac」要素が 2回出現するファイルを学習させたとする。これを分類 Bとする。 ここで、名前空間が識別できず、「desC」要素が 3回、「rect」要素が 1回、「mi」要素 力 回出現する文書 Cを処理したとする。このとき、文書 Cの名前空間が分類 A、分類 Bである確率は、ベイズの定理を用いてそれぞれ、
P (A I C) = P (C &B) ZP (C)
= P (B) X P(C I A)/ (P (A) X P (C | A) + P (B) X P (C | B) ) = 0. 75
P (B I C) = 0. 25
と求められる。これにより、文書 Cの名前空間は分類 Aの SVGである確率が高いこと がわかる。例えば図 13に示した XHTML文書の場合、図 15に示した名前空間 URI の記載のある XHTML文書などをあら力じめ教師データとして学習させておけば、名 前空間 URIが「http:〃 www.w3.org/1999/xhtml」であることが、上記のような確率計算 に基づき特定できる。
[0060] 上述のごとき確率的な手法では、タグ名の出現回数から名前空間候補を確率で順 位付けできるため、例えば確率の上位 3つを名前空間候補としたり、確率が 50%以 上など所定のしきい値を設定してそれ以上の確率を有する名前空間を候補としたりし て、名前空間表示部 314に表示してもよい。ユーザがそれらの名前空間候補の中か ら選択することにより、名前空間の最終的な特定を行ってもよい。
[0061] 図 16は名前空間 URIの記載がない、 日記タグを用いた XML文書の例である。この ような独自のボキヤブラリを識別するときは、例えば、あら力じめ図 17に示すような名 前空間 URIの記載のある XML文書を学習させておけば、上述した確率的手法が有 効である。この場合、過去に処理した、名前空間識別情報について記載のある文書 を全て学習させておけば、ある文書処理装置を使用するユーザの処理内容の傾向 に応じた確率計算を行うことができ、名前空間の候補を効率よく絞り込むことができる
[0062] これまで述べてきた名前空間の特定手法は、 XML文書などの他、 XSL (eXtensibl e Stylesheet Language)などの言語による文書にもそのまま適用できる。その例として 、図 18は、図 17の XML文書において指定された XMLスタイルシートのファイル「ca se2.xsl」の内容を示して 、る。この場合は、「http://xmlns.justsystem.co.jp/diary」な る名前空間 URIが記載されているため、図 17に示した XML文書の表示、編集は滞 りなく行われる。
[0063] 次に、図 17と同様の XML文書の例を図 19に示す。ここでは、スタイルシートのファ ィルとして「case2b.xsl」が指定されている。図 20にそのスタイルシートファイル「case2b •xsl」の内容を示す。図 18のスタイルシートファイル「case2.xsl」と比較すると、図 20の スタイルシートでは、名前空間 URIが「http:〃xmlns.justsystem.co.jp/dialy」となって おり、「diary」のつづりに誤りがあることがわかる。このように、名前空間識別情報の記 載はあるが誤っている場合などは、名前空間特定部 312は、類似の名前空間を探す ようにしてもよい。この場合、名前空間情報格納部 316にあら力じめ、名前空間リスト を記憶させておき、その中から文書に記載の誤った名前空間と最も類似性の高い名 前空間を検出するようにしてもよい。ここで類似性の判断には、編集距離 (レーべンシ ユタイン距離)を数え上げるなど、既存の手法を適用してよい。
[0064] 以上、本発明を実施の形態をもとに説明した。この実施の形態は例示であり、その 各構成要素や各処理プロセスの組合せに 、ろ 、ろな変形が可能なこと、またそうした 変形例も本発明の範囲にあることは当業者に理解されるところである。以下、変形例 を挙げる。
[0065] 実施の形態では、 XML文書を処理する例にっ 、て説明した力 本実施例の文書 処理装置 300は、他のマークアップ言語、例えば、 SGML, HTMLなどで記述され た文書も同様に処理可能である。
[0066] 実施の形態では、まず名前空間を特定することにより、そのボキヤブラリに対応した プラグインをロードし、文書を表示 Z編集させる通常の処理を可能にしたが、同様の 手続きにより名前空間に代えて候補となるプラグインをユーザに提示し、ユーザが選 択したプラグインによって文書を表示 Z編集させてもょ 、。
産業上の利用可能性
[0067] 本発明は、構造化文書を処理する装置に利用することができる。

Claims

請求の範囲
[1] マークアップ言語により記述された文書に含まれる構成要素が属する名前空間を 検出する名前空間検出部と、
前記名前空間検出部において正確な名前空間が検出されなかった際に、前記文 書力 所定の条件に基づいたキーワードを抽出し、それをもとに前記名前空間を特 定する名前空間特定部と、
前記キーワードと前記名前空間との対応関係に係る情報を記憶する名前空間情報 格納部と、
を備え、
前記名前空間特定部は前記抽出されたキーワードをもとに、前記名前空間情報格 納部を参照することにより前記名前空間を特定し、
前記名前空間検出部または前記名前空間特定部にお ヽて特定された前記名前空 間に基づき、前記文書を表示し、ユーザによる前記文書の編集を受け付けることを特 徴とする文書処理装置。
[2] 前記キーワードは、前記文書のファイル名に含まれる拡張子であることを特徴とす る請求項 1に記載の文書処理装置。
[3] 前記キーワードは、前記構成要素の要素名または属性名であることを特徴とする請 求項 1または 2に記載の文書処理装置。
[4] 前記名前空間特定部において検出された複数の名前空間をユーザに提示する名 前空間提示部をさらに備え、前記名前空間特定部はユーザによって前記複数の名 前空間より選択された名前空間を、前記特定された名前空間とすることを特徴とする 請求項 1から 3のいずれかに記載の文書処理装置。
[5] 前記名前空間情報格納部は、過去に処理した文書に含まれる構成要素が属する 名前空間と、その文書に含まれるキーワードとの対応関係に係る情報を逐次記憶し て 、くことを特徴とする請求項 1から 4の 、ずれかに記載の文書処理装置。
[6] マークアップ言語により記述された文書に含まれる構成要素が属する名前空間を 検出するステップと、
前記検出するステップにおいて正確な名前空間が識別されな力つた際に、前記文 書力 所定の条件に基づいたキーワードを抽出し、それをもとに、あら力じめ記憶さ れた前記キーワードと前記名前空間との対応関係に係る情報を参照して前記名前空 間を特定するステップと、
検出または特定された前記名前空間に基づき、前記文書を表示し、ユーザによる 前記文書の編集を受け付けるステップと、
を含むことを特徴とする文書処理方法。
マークアップ言語により記述された文書に含まれる構成要素が属する名前空間を 検出する機能と、
前記検出するステップにおいて正確な名前空間が識別されな力つた際に、前記文 書力 所定の条件に基づいたキーワードを抽出し、それをもとに、あら力じめ記憶さ れた前記キーワードと前記名前空間との対応関係に係る情報を参照して前記名前空 間を特定する機能と、
検出または特定された前記名前空間に基づき、前記文書を表示し、ユーザによる 前記文書の編集を受け付ける機能と、
をコンピュータに実現させることを特徴とするコンピュータプログラム。
PCT/JP2005/019824 2004-10-27 2005-10-27 文書処理装置及び文書処理方法 WO2006046665A1 (ja)

Priority Applications (2)

Application Number Priority Date Filing Date Title
US11/576,239 US20080141112A1 (en) 2004-10-27 2005-10-27 Document Processing Device and Document Processing Method
JP2006543264A JPWO2006046665A1 (ja) 2004-10-27 2005-10-27 文書処理装置及び文書処理方法

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2004-312835 2004-10-27
JP2004312835 2004-10-27

Publications (1)

Publication Number Publication Date
WO2006046665A1 true WO2006046665A1 (ja) 2006-05-04

Family

ID=36227907

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2005/019824 WO2006046665A1 (ja) 2004-10-27 2005-10-27 文書処理装置及び文書処理方法

Country Status (3)

Country Link
US (1) US20080141112A1 (ja)
JP (1) JPWO2006046665A1 (ja)
WO (1) WO2006046665A1 (ja)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013511097A (ja) * 2009-11-13 2013-03-28 アビニシオ テクノロジー エルエルシー レコード形式情報の管理

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007148944A (ja) * 2005-11-30 2007-06-14 Ricoh Co Ltd 通信端末装置
US8140969B2 (en) * 2007-12-03 2012-03-20 International Business Machines Corporation Displaying synchronously documents to a user
CN102169431A (zh) * 2010-02-26 2011-08-31 国际商业机器公司 用于优化用户界面的生成的方法与装置
US11385954B2 (en) * 2019-01-28 2022-07-12 Yahoo Assets Llc Graphical management of big data pipelines
EP3913879A4 (en) * 2019-02-21 2022-01-19 Huawei Technologies Co., Ltd. MESSAGE SYNTACSIS METHOD, DATA SENDING END, DATA RECEIVING END AND SYSTEM

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001290803A (ja) * 2000-04-07 2001-10-19 Just Syst Corp 文書処理方法、文書処理装置、および記録媒体
US20040002937A1 (en) * 2002-06-27 2004-01-01 Microsoft Corporation System and method for providing namespace related information

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001101049A (ja) * 1999-09-28 2001-04-13 Mitsubishi Electric Corp ファイル復元装置
JP3997846B2 (ja) * 2002-06-14 2007-10-24 ブラザー工業株式会社 印刷装置
US20040062937A1 (en) * 2002-09-16 2004-04-01 Amorim Industrial Solutions, Inc. Flooring system underlayment
US7120864B2 (en) * 2004-01-27 2006-10-10 International Business Machines Corporation Eliminating superfluous namespace declarations and undeclaring default namespaces in XML serialization processing
US7559020B2 (en) * 2004-12-30 2009-07-07 Microsoft Corporation Methods and systems for preserving unknown markup in a strongly typed environment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001290803A (ja) * 2000-04-07 2001-10-19 Just Syst Corp 文書処理方法、文書処理装置、および記録媒体
US20040002937A1 (en) * 2002-06-27 2004-01-01 Microsoft Corporation System and method for providing namespace related information

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"X-Smiles 0.6 Technical Specifications.", 26 April 2002 (2002-04-26), XP002995738, Retrieved from the Internet <URL:http://www.x-smiles.org/TechSpec/TechSpecPlain.html> *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013511097A (ja) * 2009-11-13 2013-03-28 アビニシオ テクノロジー エルエルシー レコード形式情報の管理
US10445309B2 (en) 2009-11-13 2019-10-15 Ab Initio Technology Llc Managing record format information

Also Published As

Publication number Publication date
US20080141112A1 (en) 2008-06-12
JPWO2006046665A1 (ja) 2008-05-22

Similar Documents

Publication Publication Date Title
US20070277095A1 (en) Data Processing Device And Data Processing Method
US20080262833A1 (en) Document Processing Device and Document Processing Method
US20080005659A1 (en) Data Processing Device, Document Processing Device, and Document Processing Method
US20080040588A1 (en) Data Processing Device and Data Processing Method
US20100107048A1 (en) Document processor and document processing method
US20080133563A1 (en) Data Processing Device And Data Processing Method
US20070258100A1 (en) Document Processing Device and Document Processing Method
US20080046809A1 (en) Data Processing Device and Data Processing Method
US20100162095A1 (en) Data processing apparatus and data processing method
US20100100807A1 (en) Data processing device, and data processing method
US20090083300A1 (en) Document processing device and document processing method
US20100218083A1 (en) Document processing apparatus and document processing method
WO2006046665A1 (ja) 文書処理装置及び文書処理方法
US20070208995A1 (en) Document Processing Device and Document Processing Method
WO2006051869A1 (ja) 文書処理装置及び文書処理方法
US20080005662A1 (en) Server Device and Name Space Issuing Method
WO2005098660A1 (ja) 文書処理装置及び文書処理方法
US20080208790A1 (en) Document Processing Device, and Document Processing Method
US20080250311A1 (en) Document Processing Device, and Document Processing Method
JP4566196B2 (ja) 文書処理方法および装置
US20090287994A1 (en) Document processing device and document processing method
WO2005098662A1 (ja) 文書処理装置及び文書処理方法
JP4627530B2 (ja) 文書処理方法および装置
US20080005085A1 (en) Server Device and Search Method
WO2006051974A1 (ja) 文書処理装置および文書処理方法

Legal Events

Date Code Title Description
AK Designated states

Kind code of ref document: A1

Designated state(s): AE AG AL AM AT AU AZ BA BB BG BW BY BZ CA CH CN CO CR CU CZ DK DM DZ EC EE EG ES FI GB GD GE GM HR HU ID IL IN IS JP KE KG KM KP KR KZ LC LK LR LS LT LU LV LY MD MG MK MN MW MX MZ NA NG NO NZ OM PG PH PL PT RO RU SC SD SG SK SL SM SY TJ TM TN TR TT TZ UG US UZ VC VN YU ZA ZM

AL Designated countries for regional patents

Kind code of ref document: A1

Designated state(s): BW GH GM KE LS MW MZ NA SD SZ TZ UG ZM ZW AM AZ BY KG MD RU TJ TM AT BE BG CH CY DE DK EE ES FI FR GB GR HU IE IS IT LU LV MC NL PL PT RO SE SI SK TR BF BJ CF CG CI CM GA GN GQ GW MR NE SN TD TG

121 Ep: the epo has been informed by wipo that ep was designated in this application
WWE Wipo information: entry into national phase

Ref document number: 2006543264

Country of ref document: JP

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 05805302

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 11576239

Country of ref document: US