WO2009139245A1 - Xml処理装置、xml処理方法およびxml処理プログラム - Google Patents

Xml処理装置、xml処理方法およびxml処理プログラム Download PDF

Info

Publication number
WO2009139245A1
WO2009139245A1 PCT/JP2009/057330 JP2009057330W WO2009139245A1 WO 2009139245 A1 WO2009139245 A1 WO 2009139245A1 JP 2009057330 W JP2009057330 W JP 2009057330W WO 2009139245 A1 WO2009139245 A1 WO 2009139245A1
Authority
WO
WIPO (PCT)
Prior art keywords
xml
output
cache
output destination
unit
Prior art date
Application number
PCT/JP2009/057330
Other languages
English (en)
French (fr)
Inventor
聡 木下
Original Assignee
日本電気株式会社
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 日本電気株式会社 filed Critical 日本電気株式会社
Priority to US12/992,162 priority Critical patent/US8612945B2/en
Priority to JP2010511927A priority patent/JP5664237B2/ja
Publication of WO2009139245A1 publication Critical patent/WO2009139245A1/ja

Links

Images

Classifications

    • 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/151Transformation
    • G06F40/154Tree transformation for tree-structured or markup documents, e.g. XSLT, XSL-FO or stylesheets
    • 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]

Definitions

  • the present invention relates to an XML processing device, an XML processing method, and an XML processing program.
  • Patent Document 1 describes an apparatus in which a server converts the format of XML transmitted from a client and stores the converted XML in a cache memory.
  • Patent Document 2 describes an apparatus for converting an XML format already existing as a file based on a definition by XSLT.
  • Patent Document 3 describes an apparatus that converts an XML format based on XSLT acquired from an XSLT management server and outputs the converted format through a network.
  • Patent Document 4 describes a processing device capable of switching the output between an shared buffer and the outside by an XPath expression in an XML filtering process.
  • Patent Document 5 describes an apparatus that performs streaming conversion of XML without constructing a complete object tree in memory.
  • Patent Documents 1 to 5 all convert XML format synchronously. Synchronous means converting one XML input when there is one XML input and outputting one XML. In synchronous format conversion, the input and the output always correspond one to one, and the conversion and the output are always performed at the timing when the input is performed. Although the format conversion of Patent Document 5 is streaming like, since the input and the output correspond to each other one by one, they are still synchronous.
  • Patent Documents 1 to 5 can not cope with such asynchronous data. Therefore, in order to process asynchronous data, it was necessary to write a dedicated program. This breaks the generality of XML that the processing method can be easily described by XSLT, and it also costs money for programming.
  • An object of the present invention is to provide an XML processing apparatus, an XML processing method, and an XML processing program capable of describing a processing method according to an existing XML processing language even for asynchronous XML input.
  • an XML processing apparatus which converts XML input asynchronously input from the outside according to a predetermined rule and outputs the converted XML according to the rule Characterized in that it comprises: an XML conversion means for converting, an output destination interpretation means for interpreting an output destination described in the converted XML, and an output distribution means for outputting XML to an output destination interpreted by the output destination interpretation means.
  • another XML processing apparatus is an XML processing apparatus that converts and outputs first and second XML input asynchronously input from the outside according to a predetermined rule, A first XML conversion means for converting the first XML according to the rule according to a rule, a second XML conversion means for converting the input second XML according to the rule, and the converted first and second XML First output destination interpreting means for interpreting the described output destination; first output distribution means for outputting XML to the output destination interpreted by the first output destination interpreting means; A third XML transformation unit that further transforms the second XML according to the rule, a second output interpretation unit that interprets the output described in the transformed third XML, and a second output interpretation unit By And having a second output distribution means for outputting the interpreted XML output destination.
  • an XML processing method is an XML processing method for converting XML input asynchronously input from the outside according to a predetermined rule and outputting the converted XML according to the rule Next, the output destination described in the converted XML is interpreted, and then the XML is output to the interpreted output destination.
  • an XML processing program applies a rule to input XML to a computer that controls an XML processing apparatus that converts and outputs XML input asynchronously input from the outside according to a predetermined rule.
  • Execute an XML conversion process to convert according to the output destination, an output destination interpretation process to interpret an output destination described in the converted XML, and an output distribution process to output the XML to an output destination interpreted by the output destination interpretation process It is characterized by
  • the present invention is configured to output the converted XML to the output destination described in the XML, so the XML can be output to the output destination that performs different processing according to the conditions.
  • it is possible to provide an excellent XML processing apparatus, an XML processing method, and an XML processing program which are superior to the prior art in that the processing method can be described by the existing XML processing language even for asynchronous XML input. .
  • FIG. 1 is a block diagram showing the configuration of an XML processing apparatus 1 according to the first embodiment of the present invention.
  • the XML processing device 1 is a computer device configured of a control unit 11, a storage unit 12, an input / output unit 13, and a cache memory 14.
  • the control unit 11 includes a CPU, a RAM, an OS, and the like, and is a core of a computer that executes application software.
  • the storage unit 12 is an external storage device such as a magnetic disk drive or an optical disk drive.
  • the input / output unit 13 exchanges data with each external device connected to the XML processing device 1.
  • the temperature sensor 15 as the input device and the display 16 as the output device are connected to the input / output unit 13.
  • the cache memory 14 is means for temporarily storing data to be processed by the control unit 11.
  • the control unit 11 includes an XML reception unit 21, an XML conversion unit 22, a cache reference unit 23, an output distribution unit 24, an output destination interpretation unit 25, a cache update unit 26, and an XML transmission unit 27.
  • the XML reception unit 21, the XML conversion unit 22, the cache reference unit 23, the output distribution unit 24, the output destination interpretation unit 25, the cache update unit 26, and the XML transmission unit 27 of the control unit 11 Although implemented on software by causing the CPU to execute an XML processing program, these may be configured as hardware.
  • the storage unit 12 stores a conversion rule 31 and an output destination solution table 32.
  • the XML receiving unit 21 receives XML from the outside via the input / output unit 13 according to a protocol such as HTTP.
  • the XML conversion means 22 reads out from the storage unit 12 a conversion rule 31 described in an XML processing language such as XSLT or XQuery, and based on this, converts the XML received by the XML receiving means 21.
  • the cache reference unit 23 acquires XML from the cache memory 14 based on the instruction of the XML conversion unit 22. This instruction uses a function description in XML processing language and XPath.
  • the output distribution unit 24 distributes the conversion result by the XML conversion unit 22 to the cache update unit 26 or the XML transmission unit 27.
  • the output destination interpretation unit 25 refers to the conversion result by the XML conversion unit 22 and the output destination solution table 32 to determine the output destination, and instructs the output distribution unit 24 to output the output destination.
  • FIG. 2 is a conceptual diagram showing an example of data of the output destination solution table 32 shown in FIG.
  • the output destination resolution table 32 holds, in the form of a table, the correspondence between an identifier specified in XML and an actual output destination. As the identifier, any character string that is unique in the output destination resolution table 32 can be used.
  • the output destination is either the cache memory 14 or the XML transmission means 27.
  • the cache update unit 26 adds XML to the cache memory 14 and deletes XML from the cache memory 14.
  • the cache memory 14 temporarily holds the output result in the form of XML.
  • the XML transmission unit 27 transmits the XML to an external output device such as the display 16 via the input / output unit 13 using a protocol such as HTTP.
  • the stored contents of the cache memory 14 are one XML as a whole, and the root element is ⁇ cache>.
  • XML is added to the cache memory 14
  • an element is added in such a manner that the root element of the XML document to be added becomes a child element of the ⁇ cache> element.
  • the names and contents of the child elements can be freely determined by the rules and input XML because the conversion result by the XML conversion means 22 is used as it is.
  • deletion from the cache memory 14 can be performed by designating an XPath. Elements matching the specified XPath are deleted from the cache memory 14.
  • FIG. 3 is a flowchart showing the process executed by the XML processing device 1 shown in FIG.
  • the XML receiving unit 21 receives XML from the outside using a protocol such as HTTP and passes it to the XML conversion unit 22 (step S101).
  • the XML conversion unit 22 reads the conversion rule 31 from the storage unit 12 and inquires the cache reference unit 23 about a cache reference in the conversion rule 31.
  • the cache reference description in the conversion rule is described in the form of an XPath function call.
  • the cache reference unit 23 resolves the cache reference by reading the cache and returning an XML element to the XML conversion unit 22 (step S102).
  • the cache contains data ⁇ sensor> ⁇ temperature> 20 ⁇ / temperature> ⁇ / sensor>
  • the content "20" can be referred to.
  • the XML conversion unit 22 converts the XML received from the XML reception unit 21 based on the conversion rule 31 read from the storage unit 12 and passes the converted XML to the output distribution unit 24 (step S103).
  • the transformation rules 31 are described in an XML processing language such as XSLT or XQuery.
  • the output distribution unit 24 passes the XML passed from the XML conversion unit 22 to the output destination interpretation unit 25 to inquire about the output destination.
  • the output destination interpretation unit 25 extracts the output destination from the XML in the following procedure.
  • the output destination interpretation unit 25 searches the ⁇ output> element from the XML (step S104).
  • the content of the to attribute is confirmed, and it is determined whether the output destination of the XML is the cache updating unit 26 or the XML transmitting unit 27 according to the content (step S105). This determination is made with reference to the output destination solution table 32.
  • the output destination solution table 32 holds, in the form of a table, the correspondence between the identifier specified in the XML and the actual output destination.
  • the cache memory 14 is updated according to the contents of the child elements of the ⁇ output> element (step S106). If the child element is ⁇ append>, the contents of the child element are added to the cache memory 14. If the child element is ⁇ remove>, the element specified by the select attribute of the remove element is deleted from the cache memory 14. If the output destination is the XML transmission means 27, the content of the child element of the ⁇ output> element is output to the outside using a protocol such as HTTP (step S107).
  • steps S104 to S107 are repeated for all XML elements, and the operation is ended if there are no XML elements for which processing has not been completed (step S108).
  • FIG. 4 is a conceptual view showing an example of the conversion rule 31 shown in FIG.
  • the transformation rule 31 is described in XSLT.
  • the XML receiving unit 21 receives temperature measurement data of, for example, “20 degrees Celsius” from the temperature sensor 15 in an XML format of ⁇ sensor> ⁇ temperature> 20 ⁇ / temperature> ⁇ / sensor>.
  • all units of temperature are degrees Celsius, and for example, a temperature of "20 degrees Celsius” is simply expressed as "20 degrees Celsius”.
  • the cache memory 14 has the form ⁇ cache> ⁇ temperature> 17 ⁇ / temperature> ⁇ temperature> 19 ⁇ / temperature> ⁇ / cache>, and the last and the last temperature measurement data sent from the temperature sensor 15 (previous times It is assumed that “17 degrees” and “19 degrees” in the previous time are stored.
  • the conversion rule 31 intends an operation of transmitting reception information for the past three times when the received temperature information is 20 degrees or more. More specifically, in the xsl: if statement 201 in lines 5 to 11, "If the temperature detected by the sensor is 20 degrees or more, the temperature stored in the cache memory 14 and the current sensor detected The operation of outputting temperature and ⁇ output> element "http" is intended.
  • the XML receiving means 21 receives an XML of ⁇ sensor> ⁇ temperature> ⁇ temperature> 20 ⁇ / temperature> ⁇ / sensor> from the temperature sensor 15 in step S101
  • the XML converting means 22 uses the conversion rule 31 and the contents of the cache memory 14 In step S103, the XML is converted and output.
  • FIG. 5 is a conceptual view showing an example of XML output by the XML conversion means 22 in step S103 of FIG. 3 based on the conversion rule 31 shown in FIG. Since the received XML temperature information (the content of the temperature element) is 20 or more, the output statement 251 in the second to eighth lines responds to the ⁇ output> element “http” according to the judgment of the xsl: if instruction of the XSLT
  • the temperature stored in the cache memory 14 for the past two times and the temperature detected by the current sensor that is, the temperatures for the past three times (17 degrees, 19 degrees, 20 degrees in the order of the previous two times, the previous one, and the current one) are output .
  • the output destination interpretation unit 25 refers to the XML converted and output by the XML conversion unit 22, and is the content of the first ⁇ output> element, ⁇ sensor> ⁇ temperature> 17 ⁇ / temperature> ⁇ temperature> It instructs the XML transmission means 27 to output 19 ⁇ / temperature> ⁇ temperature> 20 ⁇ / temperature> ⁇ / sensor>.
  • the XML transmission means 27 outputs this content to the outside.
  • the output destination interpreting means 25 instructs the cache updating means 26 to output ⁇ append> ⁇ temperature> 20 ⁇ / temperature> ⁇ / append> which is the content of the next ⁇ output> element.
  • the cache updating unit 26 adds a new ⁇ temperature> element to the cache memory 14.
  • a cache memory for storing XML is provided, and the cache reference means can refer to and update the cache memory from the rules described in the XSLT. Therefore, the process of format conversion for asynchronous XML can be described by XSLT. Users can write rules in existing XSLT and design an XML processing mechanism with state without special learning. In the rules described in XSLT, it is easy to describe cache memory reference and deletion by one XPath.
  • Another device receives an output from the XML transmission means 27 indicating a specific state in temperature, for example, an alarm on the display 16, an alarm by a buzzer or an e-mail, or the like, and records data to that effect in a database.
  • the temperature control mechanism may be fed back to perform temperature control.
  • the present embodiment can also be applied to a device that asynchronously outputs humidity, RFID, impact, etc. in XML in addition to temperature.
  • FIG. 6 is a block diagram showing the configuration of an XML processing apparatus 301 according to the second embodiment of the present invention.
  • the hardware configuration of the XML processing apparatus 301 is the same as that of the XML processing apparatus 1 according to the first embodiment, and thus the description thereof is omitted.
  • a plurality of temperature sensors 315 a and humidity sensors 315 b which are input devices are connected to the input / output unit 13.
  • XML conversion means 322a and 322b are connected in series, shared by the serial connection XML conversion means 322a and 322b, and the conversion results by the respective XML conversion means 322a and 322b are used.
  • a cache memory 14 for temporarily storing is provided, and output destination interpretation means 325a, 325b and output distribution means 324a, 324b are provided in multiple stages corresponding to the serially connected XML conversion means 322a, 322b. The details will be described below.
  • the control unit 11 has XML reception means 321a and 321b, XML conversion means 322a and 322b, and conversion rules 331a and 331b corresponding to the temperature sensor 315a and the humidity sensor 315b, respectively.
  • the XML converted by the XML conversion means 322a and 322b is output to the output distribution means 324a.
  • the output distribution unit 324a includes an output destination interpretation unit 325a and an output destination solution table 332a. Then, an XML conversion means 322c, a conversion rule 331c, an output distribution means 324b, an output destination interpretation means 325b, and an output destination solution table 332b are connected to the subsequent stage of the output distribution means 324a.
  • Each functional unit basically has the same function as the functional unit of the same name included in the XML processing device 1 according to the first embodiment. Therefore, only the difference will be described here, and the description will be omitted for the rest. Further, it is assumed that the output destination solution tables 332a and 332b are the same as the output destination solution table 32 shown in FIG. 2 unless otherwise specified.
  • FIG. 7 is a flowchart showing the process executed by the XML processing device 301 shown in FIG.
  • the two data processing systems of the XML receiving unit 321a-XML conversion unit 322a-conversion rule 331a and the XML reception unit 321b-XML conversion unit 322a-conversion rule 331a only one of the systems on the side of receiving XML is The same operation as that shown in steps S101 to S106 and 108 of FIG. 3 is performed.
  • the difference from the operation in the first embodiment shown in FIG. 3 is that, when the output destination of the XML from the output distribution means 324a in step S105 is not the cache update means 26, it becomes the XML conversion means 322c. It starts.
  • the XML conversion means 322c having received the output of XML from the output distribution means 324a resolves the cache reference as in step S102 with reference to the conversion rule 331c (step S401), and performs XML conversion as in step S103. (Step S402).
  • the converted XML is interpreted by the output distribution unit 324b and the output destination interpretation unit 325b, the description of the output destination is searched (step S403), and the output destination is determined (step S404).
  • step S405 if the output destination is a cache, the cache memory 14 is updated (step S405), and otherwise, XML is output from the XML transmission means 27 to the outside (step S406). As described above, even in the second conversion result passed to the XML conversion unit 322c, the processing is repeated for all XML elements (step S407).
  • FIG. 8 to 9 are conceptual diagrams showing an example of the conversion rules 331a to 331c shown in FIG.
  • the XML reception means 321a receives temperature measurement data of, for example, "19 degrees” from the temperature sensor 315a in an XML format of ⁇ sensor> ⁇ temperature> 19 ⁇ / temperature> ⁇ / sensor>.
  • the XML receiving unit 321b receives humidity measurement data of, for example, "30%” from the humidity sensor 315b in an XML format of ⁇ sensor> ⁇ humidity> 30 ⁇ / humidity> ⁇ / sensor>.
  • the unit of humidity is all%.
  • the two pieces of information of temperature and humidity are respectively received asynchronously, and the temperature and humidity are collectively sent as one XML when the two pieces of information are aligned.
  • the initial state it is assumed that there is no information stored in the cache memory 14.
  • the conversion rule 331a for the XML conversion means 322a shown in FIG. 8A is specified to be output to the ⁇ output> element "henkan3".
  • "dummy” is output to the ⁇ output> element "henkan3” in the output statement 501 on lines 5 to 7, and data on the ⁇ output> element “cache” is deleted in the output statement 502 on lines 8 to 10.
  • the operation of outputting the temperature detected by the current sensor in the output statement 503 on lines 11 to 15 to the ⁇ output> element “cache” is intended.
  • the conversion rule 331b for the XML conversion means 322b shown in FIG. 8B is also specified to be output to the ⁇ output> element “henkan3” when the XML output destination is the XML conversion means 322c.
  • "dummy” is output to the ⁇ output> element "henkan3” in the output statement 511 on lines 5 to 7, and data on the ⁇ output> element “cache” is deleted in the output statement 512 on lines 8 to 10.
  • the operation of outputting the humidity detected by the current sensor in the output statement 513 on the 11th to 15th lines to the ⁇ output> element “cache” is intended.
  • the conversion rule 331c for the XML conversion means 322c shown in FIG. 9C operates when the output of "dummy" is received from the XML conversion means 322a and b, and the xsl: if sentence 521 in the fifth to fifteenth lines first If the cache memory 14 has both temperature and humidity data, the temperature and humidity are output, and the cache memory 14 is erased. More specifically, the temperature and humidity data of the cache memory 14 are output to the ⁇ output> element “http” in the output statement 522 in lines 6 to 11, and the cache memory 14 is output in the output statement 523 on lines 12 to 14. It is erased.
  • FIG. 10 is a conceptual view showing an example of XML output from the XML conversion means 322a-c at each step of FIG. 7 based on the conversion rules 331a-c shown in FIGS.
  • the XML reception unit 321a receives temperature information of ⁇ sensor> ⁇ temperature> 19 ⁇ / temperature> ⁇ / sensor>. This is converted by the XML conversion means 322a, and an XML as shown in FIG. 10A is outputted to the XML conversion means 322c.
  • the content of ⁇ cache> ⁇ temperature> 19 ⁇ / temperature> ⁇ / cache> is stored in the cache memory 14.
  • the XML conversion means 322c receives an XML of ⁇ dummy />, and tries to perform conversion processing triggered by this, but since the cache memory 14 does not contain the humidity, it is in the conversion rule 331c of FIG. 8 (c)
  • the output distribution means 324b does nothing.
  • the XML receiving unit 321b receives humidity information of ⁇ sensor> ⁇ humidity> 30 ⁇ / humidity> ⁇ / sensor>. This is converted by the XML conversion means 322b, and an XML as shown in FIG. 10 (b) is output to the XML conversion means 322c.
  • the XML conversion means 322c receives the XML ⁇ dummy /> and performs conversion processing as a trigger. Since both the temperature and the humidity are included in the cache memory 14, the XML conversion means 322c executes the processing of the xsl: if statement 521 in the conversion rule 331c and outputs the XML shown in FIG.
  • the output distribution means 324b that has received it outputs the data to both of the XML transmission means 27 and the cache update means 26.
  • FIG. 11 is a block diagram showing the configuration of an XML processing apparatus 601 according to the third embodiment of the present invention.
  • the hardware configuration of the XML processing unit 601 is the same except that it has two cache memories 614a and 614b.
  • control unit 11 compares the named reference cache referring unit 628 instead of the cache reference unit 23 with the cache updating unit in comparison with each functional unit in the XML processing apparatus 1 according to the first embodiment shown in FIG.
  • the named cache updating means 629 is executed respectively.
  • the storage unit 12 stores a cache name table 633 in addition to each data in the XML processing device 1.
  • a conversion rule 631 described later is stored. Elements other than these points are the same as those of the XML processing device 1 according to the first embodiment, so the same reference numerals and names are given to the same elements and the description is omitted.
  • FIG. 12 is a conceptual diagram showing an example of data of the cache name table 633 shown in FIG.
  • the cache memories 614a and 614b are cache memories each capable of holding one XML document, and can be designated as ⁇ output> elements “temp1” and “temp2”, respectively.
  • the named cache reference unit 628 refers to the cache name table 633, and the cache memory 614a is designated when the identifier "temp1" is designated, and the cache memory 614b is designated when the identifier "temp2" is designated.
  • the named cache updating means 629 similarly updates the stored contents of the cache memories 614a and 614b.
  • FIG. 13 is a flowchart showing the process executed by the XML processing device 601 shown in FIG.
  • the processing to be executed is substantially the same operation as that shown in steps S101 to S108 in FIG. 3, but in this embodiment, a cache name is described in the conversion rule described in the XML processing language.
  • the named cache reference unit 628 refers to the cache name table 633 to determine which of the cache memories 614a and 614b is to be referred Step S701)
  • the process of step S102 is performed with reference to the determined cache memory.
  • step S105 even if the XML output destination is the cache memory in step S105, the named cache updating unit 629 refers to the cache name table 633 to determine which of the cache memories 614a and 614b is to be updated. Then (step S702), the process of step S106 is performed on the determined cache memory.
  • the other processes are the same as the process of FIG.
  • FIG. 14 is a conceptual diagram showing an example of the conversion rule 631 shown in FIG. It is assumed that the XML reception means 21 receives temperature measurement data of, for example, "20 degrees" from the temperature sensor 15 in an XML format of ⁇ sensor> ⁇ temperature> 20 ⁇ / temperature> ⁇ / sensor>.
  • the conversion rule 631 is intended to receive temperature information as an input, and to output temperature information for three times when an input of 20 degrees or more is input three times or an input of five degrees or less is consecutive three times.
  • the cache memory 614a stores history information in the case where temperature information of 20 degrees or more continues, and stores history information in the case where temperature information of 5 degrees or less continues in the cache memory 614b.
  • classification is performed according to the received temperature information. If it is 20 degrees or more, the processing of lines 6 to 20 will be performed. If it is 5 degrees or less, the processing of lines 21 to 35 will be performed. Run.
  • the process of the sixth to twentieth lines in the case of 20.degree. It is intended to output the temperature stored in and the temperature detected by the current sensor in ⁇ output> element “http”.
  • the temperature detected by the current sensor can be added to the ⁇ output> element" temp1 "(cache memory 614a) It is intended that the operation of "output”.
  • the cache memory 614b is executed if the number of data stored in the cache memory 614a is two or more. It is intended to output the temperature stored in and the temperature detected by the current sensor in ⁇ output> element “http”. After that, regardless of the number of data stored in the cache memory 614b, in the output statement 812 in the 30th to 34th lines, “the temperature detected by the current sensor can not be stored in the ⁇ output> element“ temp2 ”(cache memory 614b) It is intended that the operation of "output”.
  • the processing on lines 36 to 44 erases the cache memory 614a by the output statement 821 on lines 37 to 39, and the cache memory 614b in the output statement 822 on lines 40 to 42. Has been erased.
  • the XML held by the cache memory 614a is empty ( ⁇ cache />) and the XML held by the cache memory 614b is ⁇ cache> ⁇ temperature> 3 ⁇ / temperature> ⁇ temperature> 4 ⁇ / temperature> ⁇ / cache> It is assumed that This is a cache state after two consecutive receptions of temperature information of 5 degrees or less.
  • the XML receiving unit 21 receives an XML of ⁇ sensor> ⁇ temperature> -3 ⁇ / temperature> ⁇ / sensor> from the temperature sensor 15.
  • FIG. 15 is a conceptual diagram showing an example of XML output by the XML conversion unit 22 in step S103 of FIG. 13 based on the conversion rule 631 shown in FIG. Since there are exactly two ⁇ temperature> elements in the cache memory 614b, the XML conversion means 22 follows the xsl: if statement 811 to check the temperature stored in the cache memory 614b and the temperature detected by the current sensor. Output> Output to element "http”. Then, the output statement 812 outputs the temperature detected by the current sensor for the ⁇ output> element “temp2”.
  • the argument "temp2" being passed to the cache function is interpreted by the named cache reference unit 628, and the cache name table 633 is referenced to obtain the cache memory 614b as the access destination.
  • the attribute value temp2 possessed by the output statement 812 is interpreted by the named cache updating unit 629, and the cache name table 633 is referenced to obtain the cache memory 614b as an access destination. As a result, the temperature element is added to the cache memory 614b.
  • states can be stored in a plurality of cache memories. This makes it possible to generate multiple pieces of information with different purposes, such as 5 degrees or less, or 20 degrees or more.
  • the present embodiment describes an example in which there are two cache memories, the same method can be easily extended and applied to the case where there are three or more cache memories.
  • FIG. 5 is a conceptual diagram showing an example of XML output by the XML conversion unit in step S103 of FIG. 3 based on the conversion rule shown in FIG.
  • FIG. 6 shows the structure of the XML processing apparatus based on the 2nd Embodiment of this invention. It is a flowchart showing the process which the XML processing apparatus shown in FIG. 6 performs.
  • FIG. 10 is a conceptual diagram showing an example of XML output by the XML conversion means at each step of FIG. 7 based on the conversion rules shown in FIGS. It is a block diagram which shows the structure of the XML processing apparatus based on the 3rd Embodiment of this invention. It is a conceptual diagram which shows the example of data of the cache name table shown in FIG. It is a flowchart showing the process which the XML processing apparatus shown in FIG. 11 performs. It is a conceptual diagram which shows an example of the conversion rule shown in FIG. FIG. 15 is a conceptual diagram showing an example of XML output by the XML conversion unit in step S103 of FIG. 13 based on the conversion rule shown in FIG. 14;

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Document Processing Apparatus (AREA)

Abstract

【課題】非同期的なXML入力に対しても既存のXML処理言語によって処理方法を記述することのできるXML処理装置を提供する。 【解決手段】XML処理装置1は、外部から非同期的に入力されるXMLを所定のルール31に従って変換して出力するXML処理装置であって、入力されたXMLをルールに従ってXMLの変換を行うXML変換手段22と、変換されたXMLに記述された出力先を解釈する出力先解釈手段25と、出力先解釈手段によって解釈された出力先にXMLを出力させる出力分配手段24とを有することを特徴とする。

Description

XML処理装置、XML処理方法およびXML処理プログラム
 本発明は、XML処理装置、XML処理方法およびXML処理プログラムに関する。
 XML文書のフォーマットの変換などについて、次のような技術文書がある。特許文献1には、クライアントから送信されるXMLをサーバがフォーマットを変換してキャッシュメモリに記憶するという装置が記載されている。特許文献2には、ファイルとして既に存在するXMLのフォーマットを、XSLTによる定義に基づいて変換するという装置が記載されている。
 特許文献3には、XSLT管理サーバから取得したXSLTに基づいてXMLのフォーマットを変換してネットワークを介して出力するという装置が記載されている。特許文献4には、XMLのフィルタリング処理で、共有化バッファと外部とにXPath式によって出力を切り替えることのできる処理装置が記載されている。特許文献5には、メモリ内に完全なオブジェクトツリーを構築しないXMLのストリーミング変換を行うという装置が記載されている。
特開2003-271441号公報 特開2006-018449号公報 特開2007-018029号公報 特開2007-034763号公報 特表2005-535982号公報
 特許文献1~5に記載した技術はいずれも、XMLのフォーマットを同期的に変換するものである。同期的とは、一つのXML入力があったときに、そのXML入力に対して変換を行い、一つのXMLを出力するものをいう。同期的なフォーマット変換では、入力と出力が必ず一対一に対応し、入力が行われたタイミングで必ず変換と出力が行われる。ちなみに特許文献5のフォーマット変換はストリーミング的ではあるが、入力と出力が一対一に対応しているので、同期的であることには変わりはない。
 しかしながら最近は、XMLのフォーマットを同期的に変換するのみでなく、たとえばセンサから出力される温度、湿度、RFIDなどのように、非同期的に出力されるデータをXMLとしてXML処理装置に入力し、それを所定のルールおよびフォーマットで出力したいという用途も出てきている。より具体的には、XML文書として入力される温度が20度以上の場合に測定された過去3回分の温度値を出力する、もしくは異なるタイミングでXML文書として入力される温度と湿度の両方が所定の範囲である場合に温度と湿度をXML文書として同時に出力する、などのような場合である。
 特許文献1~5に記載されている技術では、そのような非同期的なデータに対して対応することはできない。そのため、非同期的なデータを処理するために、専用のプログラムを記述する必要があった。これではXSLTによって容易に処理方法を記述することができるというXMLの汎用性を損なうことになり、またプログラミングにコストがかかることにもなる。
 本発明の目的は、非同期的なXML入力に対しても既存のXML処理言語によって処理方法を記述することのできるXML処理装置、XML処理方法およびXML処理プログラムを提供することにある。
 上記目的を達成するため、本発明に係るXML処理装置は、外部から非同期的に入力されるXMLを所定のルールに従って変換して出力するXML処理装置であって、入力されたXMLをルールに従って変換するXML変換手段と、変換されたXMLに記述された出力先を解釈する出力先解釈手段と、出力先解釈手段によって解釈された出力先にXMLを出力させる出力分配手段とを有することを特徴とする。
 上記目的を達成するため、本発明に係る別のXML処理装置は、外部から非同期に入力される第1および第2のXMLを所定のルールに従って変換して出力するXML処理装置であって、入力された第1のXMLをルールに従って変換する第1のXML変換手段と、入力された第2のXMLをルールに従って変換する第2のXML変換手段と、変換された第1および第2のXMLに記述された出力先を解釈する第1の出力先解釈手段と、第1の出力先解釈手段によって解釈された出力先にXMLを出力させる第1の出力分配手段と、変換された第1および第2のXMLをさらにルールに従って変換する第3のXML変換手段と、変換された第3のXMLに記述された出力先を解釈する第2の出力先解釈手段と、第2の出力先解釈手段によって解釈された出力先にXMLを出力させる第2の出力分配手段とを有することを特徴とする。
 上記目的を達成するため、本発明に係るXML処理方法は、外部から非同期的に入力されるXMLを所定のルールに従って変換して出力するXML処理方法であって入力されたXMLをルールに従って変換し、次に変換されたXMLに記述された出力先を解釈し、その後に解釈された出力先にXMLを出力することを特徴とする。
 上記目的を達成するため、本発明に係るXML処理プログラムは、外部から非同期的に入力されるXMLを所定のルールに従って変換して出力するXML処理装置を制御するコンピュータに、入力されたXMLをルールに従って変換するXML変換処理と、変換されたXMLに記述された出力先を解釈する出力先解釈処理と、出力先解釈処理によって解釈された出力先にXMLを出力させる出力分配処理とを実行させることを特徴とする。
 本発明は、XMLに記述された出力先に変換されたXMLを出力できるように構成したので、条件に応じて異なる処理を行う出力先にXMLを出力することができる。これによって、非同期的なXML入力に対しても既存のXML処理言語によって処理方法を記述することができるという、従来にない優れたXML処理装置、XML処理方法およびXML処理プログラムを提供することができる。
 以下、本発明の実施形態を図に基づいて詳細に説明する。
[第1の実施の形態]
 図1は、本発明の第1の実施の形態に係るXML処理装置1の構成を示すブロック図である。XML処理装置1は、制御部11、記憶部12、入出力部13、およびキャッシュメモリ14によって構成されるコンピュータ装置である。制御部11はCPU、RAM、OSなどによって構成され、アプリケーションソフトを実行するコンピュータの中枢である。記憶部12は磁気ディスク装置や光学ディスク装置などの外部記憶装置である。
 入出力部13はXML処理装置1に接続された外部の各装置とのデータのやりとりを行う。図1に示した例では、入力装置として温度センサ15、出力装置としてディスプレイ16が入出力部13に接続されているが、もちろん入力装置および出力装置はこの例に限定されるものではない。キャッシュメモリ14は、制御部11が処理するデータを一時的に記憶しておく手段である。
 制御部11は、XML受信手段21、XML変換手段22、キャッシュ参照手段23、出力分配手段24、出力先解釈手段25、キャッシュ更新手段26、およびXML送信手段27を有している。なお、図1の例では、制御部11の、XML受信手段21、XML変換手段22、キャッシュ参照手段23、出力分配手段24、出力先解釈手段25、キャッシュ更新手段26、およびXML送信手段27は、CPUにXML処理プログラムを実行させることにより、ソフトウェア上で実現しているが、これらをハードウェアとして構築してもよいものである。
記憶部12には、変換ルール31、および出力先解決テーブル32が記憶されている。
 XML受信手段21は、外部から入出力部13を介してHTTPなどのプロトコルによってXMLを受信する。XML変換手段22は、XSLTやXQueryなどのXML処理言語で記述された変換ルール31を記憶部12から読み出し、これに基づいて、XML受信手段21が受信したXMLを変換する。
 キャッシュ参照手段23は、XML変換手段22の指示に基づいてキャッシュメモリ14からXMLを取得する。この指示にはXML処理言語による関数記述と、XPathが使用される。出力分配手段24は、XML変換手段22による変換結果をキャッシュ更新手段26またはXML送信手段27に分配する。出力先解釈手段25は、XML変換手段22による変換結果と出力先解決テーブル32を参照して出力先を決定し、出力分配手段24に出力先を指示する。
 図2は、図1で示した出力先解決テーブル32のデータ例を示す概念図である。出力先解決テーブル32は、XML中で指定される識別子と、実際の出力先との対応関係を表の形で保持している。識別子には、出力先解決テーブル32の中で一意であれば任意の文字列を使用できる。出力先はキャッシュメモリ14またはXML送信手段27のいずれかである。
 図1に戻って、キャッシュ更新手段26は、キャッシュメモリ14へのXMLの追加、およびキャッシュメモリ14からのXMLの削除を行う。キャッシュメモリ14は、出力結果をXMLの形で一時的に保持する。XML送信手段27は、HTTPなどのプロトコルを使用して、入出力部13を介してディスプレイ16などのような外部の出力装置にXMLを送信する。
 キャッシュメモリ14の記憶内容は全体として一つのXMLになっており、ルート要素は<cache>とする。キャッシュメモリ14にXMLが追加されると、追加されるXML文書のルート要素が<cache>要素の子要素になる形で要素が追加される。その子要素の名前および内容は、XML変換手段22による変換結果がそのまま使用されるため、ルールや入力XMLによって自由に決めることができる。またキャッシュメモリ14からの削除はXPathの指定によって行うことができる。キャッシュメモリ14からは指定されたXPathにマッチした要素が削除される。
 図3は、図1で示したXML処理装置1が実行する処理を表すフローチャートである。まず、XML受信手段21が外部からHTTPなどのプロトコルを使用してXMLを受信し、XML変換手段22に渡す(ステップS101)。XML変換手段22は、記憶部12から変換ルール31を読み出し、変換ルール31中でのキャッシュ参照をキャッシュ参照手段23に問い合わせる。変換ルール中のキャッシュ参照記述はXPathの関数呼び出しの形で記述されている。キャッシュ参照手段23は、キャッシュを読み出してXML要素をXML変換手段22に返すことにより、キャッシュ参照を解決する(ステップS102)。
 たとえばキャッシュに<sensor><temperature>20</temperature></sensor>というデータがあった場合、cache()/sensor/temperature[1]/text()という記述によって、最初の<temperature>要素の内容である「20」を参照できる。
 続いてXML変換手段22は、記憶部12から読み出した変換ルール31に基づいて、XML受信手段21から受信したXMLを変換して、変換後のXMLを出力分配手段24に渡す(ステップS103)。変換ルール31はXSLTやXQueryなどのXML処理言語で記述されている。
 出力分配手段24は、XML変換手段22から渡されたXMLを出力先解釈手段25に渡して出力先を問い合わせる。出力先解釈手段25は以下の手順でXMLから出力先を抽出する。変換されたXMLはたとえば、<result><output to=”cache”><append>(中略)</append></output><output to=”http”>(中略)</output></result>のような形式である。
 出力先解釈手段25はまず、XMLから<output>要素を検索する(ステップS104)。次にto属性の内容を確認し、その内容によってXMLの出力先がキャッシュ更新手段26とするか、XML送信手段27とするかを決定する(ステップS105)。この決定は、出力先解決テーブル32を参照して行う。出力先解決テーブル32は、図2に示したように、XML中で指定される識別子と、実際の出力先との対応関係を表の形で保持している。
 この結果、出力先がキャッシュ更新手段26であれば、<output>要素の子要素の内容に従ってキャッシュメモリ14を更新する(ステップS106)。子要素が<append>であれば、そのさらに子要素の内容をキャッシュメモリ14に追加する。子要素が<remove>であれば、remove要素のselect属性で指定された要素をキャッシュメモリ14から削除する。 出力先がXML送信手段27であれば、<output>要素の子要素の内容をHTTPなどのプロトコルを使用して外部に出力する(ステップS107)。
 以後、ステップS104~107に示した処理を全てのXML要素に対して繰り返し、処理が完了していないXML要素がなくなれば動作を終了する(ステップS108)。
 図4は、図1で示した変換ルール31の一例を示す概念図である。変換ルール31はXSLTで記述されている。ここで、XML受信手段21が温度センサ15から、たとえば「摂氏20度」という温度測定データを<sensor><temperature>20</temperature></sensor>というXML形式で受信するものとする。以後、温度の単位は全て摂氏であり、たとえば「摂氏20度」という温度を単に「20度」というように表記する。
 また、キャッシュメモリ14は<cache><temperature>17</temperature><temperature>19</temperature></cache>という形式で、温度センサ15から送信された前回と前々回の温度測定データ(前々回は「17度」、前回は「19度」)を記憶しているものとする。
 変換ルール31は、受信した温度情報が20度以上のとき、過去3回分の受信情報を送信する、という動作を意図している。より具体的には、5~11行目のxsl:if文201で、「センサが関知した温度が20度以上であれば、キャッシュメモリ14に保存されている温度と、現在のセンサが関知した温度とを、<output>要素「http」に出力する」という動作を意図している。
 また、13~17行目のoutput文202で「現在のセンサが関知した温度を、<output>要素「cache」に出力する」という動作を、18~20行目のoutput文203で「<output>要素「cache」の、3回以上前の記憶データを削除する(過去2回分のデータのみを残す)」という動作をそれぞれ意図している。
 XML受信手段21がステップS101で<sensor><temperature>20</temperature></sensor>というXMLを温度センサ15から受信すると、XML変換手段22は変換ルール31とキャッシュメモリ14の内容を使用して、ステップS103でXMLを変換して出力する。
 図5は、図4で示した変換ルール31に基づいて、図3のステップS103でXML変換手段22が出力するXMLの例を示す概念図である。受信したXMLの温度情報(temperature要素の内容)が20以上であるため、XSLTのxsl:if命令の判定に従って、2~8行目のoutput文251で、<output>要素「http」に対して、キャッシュメモリ14に保存されている過去2回分の温度と現在のセンサが関知した温度、つまり過去3回分の温度(前々回、前回、今回の順に17度、19度、20度)が出力される。
 また、9~13行目のoutput文252では現在の温度「20度」が<output>要素「cache」に出力され、14~16行目のoutput文253で<output>要素「cache」の3回以上前の記憶データが削除される。つまりキャッシュメモリ14には前々回の温度「19度」、前回の温度「20度」が記憶されることになる。
 ステップS104で、出力先解釈手段25はXML変換手段22が変換して出力したXMLを参照し、最初の<output>要素の内容である、<sensor><temperature>17</temperature><temperature>19</temperature><temperature>20</temperature></sensor>をXML送信手段27に出力するように指示する。XML送信手段27はこの内容を外部に出力する。
 出力先解釈手段25は、次の<output>要素の内容である<append><temperature>20</temperature></append>をキャッシュ更新手段26に出力するように指示する。この結果、キャッシュ更新手段26によってキャッシュメモリ14に新たな<temperature>要素が追加される。
 出力先解釈手段25は、さらに、次の<output>要素の内容である<remove select=”/cache/temperature[position() <= last() - 2]” />をキャッシュ更新手段26に出力するように指示する。selectの属性の中身のXPathは、<cache>要素の子要素のうちで最後の2つを除いた<temperature>要素にマッチするので、最後の2つの<temperature>要素を残してキャッシュメモリ14の内容を削除する。XPathをXMLの中で表現するため、小なり記号(「<」)は<に置き換えられている。キャッシュメモリ14の内容は次にXML受信手段21がXMLを受信したときに使用される。
 なお、ここまでで示した実施の形態で使用したXMLの要素名や属性名は、一意に識別できれば任意の名称を使用することができる。図に示したoutput、result、append、removeなどの名称は、一例に過ぎないものである。
 本実施の形態では、XMLを記憶するキャッシュメモリを有し、XSLTに記載されたルールからキャッシュ参照手段によってキャッシュメモリの参照および更新を可能にしている。そのため、非同期的なXMLに対するフォーマット変換の処理を、XSLTによって記述することができる。ユーザは特別な学習をすることなく、既存のXSLTでルールを記述し、状態を持つXML処理機構を設計できる。XSLTで記述されるルールでは、一つのXPathによってキャッシュメモリの参照および削除を容易に記述できる。
 温度における特定の状態を示すXML送信手段27からの出力は、別の装置が受け取って、たとえばディスプレイ16に警報を出す、ブザーや電子メールなどによって警報を出す、データベースにその旨のデータを記録する、温度制御機構にフィードバックを出して温度調整を行わせるなどのような処置を行うことができる。温度の他には、湿度、RFID、衝撃などをXMLで非同期的に出力する装置などに対しても、本実施の形態を適用することができる。
[第2の実施の形態]
 図6は、本発明の第2の実施の形態に係るXML処理装置301の構成を示すブロック図である。XML処理装置301のハードウェア構成は第1の実施の形態に係るXML処理装置1と同一であるので説明を省略する。ただし、入出力部13には複数の入力装置である温度センサ315aおよび湿度センサ315bが接続されている。
 図6に示す実施形態2では、XML変換手段322a,322bを直列に接続し、前記直列接続のXML変換手段322a,322bに対して共有され、かつ前記各XML変換手段322a,322bによる変換結果を一時的に保存するキャッシュメモリ14を有し、出力先解釈手段325a,325b及び出力分配手段324a、324bを、前記直列接続のXML変換手段322a,322bに対応させて多段に設けたものである。以下、具体的に説明する。
 制御部11は、温度センサ315aおよび湿度センサ315bの各々に対応するXML受信手段321aおよび321b、XML変換手段322aおよび322b、変換ルール331aおよび331bを有する。XML変換手段322aおよび322bによる変換後のXMLは出力分配手段324aに出力される。出力分配手段324aは出力先解釈手段325a、出力先解決テーブル332aを有する。そして出力分配手段324aの後段に、XML変換手段322c、変換ルール331c、出力分配手段324b、出力先解釈手段325b、出力先解決テーブル332bが接続される。
 各々の機能部は、基本的に第1の実施の形態に係るXML処理装置1に含まれる同一名称の機能部と同一の機能を有する。そのため、ここではその相違点のみを説明し、それ以外については説明を省略する。また、出力先解決テーブル332aおよび332bは、図2で示した出力先解決テーブル32と、特に記述のない限りはそれぞれ同一であるものとする。
 図7は、図6で示したXML処理装置301が実行する処理を表すフローチャートである。XML受信手段321a-XML変換手段322a-変換ルール331aと、XML受信手段321b-XML変換手段322a-変換ルール331aの、2つのデータ処理系統は、どちらか一方XMLを受信した側の系統だけが、図3のステップS101~106および108に示したものと同一の動作を行う。図3に示した第1の実施の形態における動作との相違点は、ステップS105における出力分配手段324aからのXMLの出力先がキャッシュ更新手段26ではない場合に、XML変換手段322cとなることから始まる。
 出力分配手段324aからのXMLの出力を受けたXML変換手段322cは、変換ルール331cを参照してステップS102と同様にキャッシュ参照を解決したのち(ステップS401)、ステップS103と同様にXML変換を行う(ステップS402)。変換されたXMLは、出力分配手段324bおよび出力先解釈手段325bによって解釈され、出力先の記述を検索し(ステップS403)、出力先を判断する(ステップS404)。
 その結果出力先がキャッシュであればキャッシュメモリ14を更新し(ステップS405)、そうでなければXML送信手段27から外部にXMLを出力する(ステップS406)。以上、XML変換手段322cに渡された2回目の変換結果においても、全てのXML要素に対して繰り返す(ステップS407)。
 図8~9は、図6で示した変換ルール331a~cの一例を示す概念図である。ここで、XML受信手段321aが温度センサ315aから、たとえば「19度」という温度測定データを<sensor><temperature>19</temperature></sensor>というXML形式で受信するものとする。また、XML受信手段321bが湿度センサ315bから、たとえば「30%」という湿度測定データを<sensor><humidity>30</humidity></sensor>いうXML形式で受信するものとする。以後、湿度の単位は全て%である。
 これらの温度および湿度の2つの情報が非同期にそれぞれ受信され、2つの情報が揃った段階で温度と湿度をまとめて一つのXMLとして送信するということをここでは考える。また初期状態ではキャッシュメモリ14に記憶されている情報は無いとする。
 図8(a)に示すXML変換手段322aに対する変換ルール331aは、XMLの出力先がXML変換手段322cである場合には<output>要素「henkan3」に出力することが指定される。まず5~7行目のoutput文501で<output>要素「henkan3」に「dummy」を出力し、8~10行目のoutput文502で<output>要素「cache」のデータを削除して、11~15行目のoutput文503で現在のセンサが関知した温度を<output>要素「cache」に出力するという動作を、それぞれ意図している。
 図8(b)に示すXML変換手段322bに対する変換ルール331bもやはり、XMLの出力先がXML変換手段322cである場合には<output>要素「henkan3」に出力することが指定される。まず5~7行目のoutput文511で<output>要素「henkan3」に「dummy」を出力し、8~10行目のoutput文512で<output>要素「cache」のデータを削除して、11~15行目のoutput文513で現在のセンサが関知した湿度を<output>要素「cache」に出力するという動作を、それぞれ意図している。
 図9(c)に示すXML変換手段322cに対する変換ルール331cは、XML変換手段322aおよびbから「dummy」の出力を受けると動作し、まず5~15行目のxsl:if文521で、「キャッシュメモリ14に温度および湿度の両方のデータがあればそれらの温度および湿度を出力し、キャッシュメモリ14を消去する」という動作を意図している。より具体的には、6~11行目のoutput文522でキャッシュメモリ14の温度および湿度データを<output>要素「http」に出力し、12~14行目のoutput文523でキャッシュメモリ14を消去している。
 図10は、図8~9で示した変換ルール331a~cに基づいて、図7の各ステップでXML変換手段322a~cが出力するXMLの例を示す概念図である。まず、XML受信手段321aが<sensor><temperature>19</temperature></sensor>という温度情報を受信したとする。これはXML変換手段322aによって変換され、図10(a)に示すようなXMLがXML変換手段322cに対して出力される。
 この結果、キャッシュメモリ14には、<cache><temperature>19</temperature></cache>という内容が記憶される。XML変換手段322cは<dummy />というXMLを受け取り、これを契機に変換処理を行おうとするが、キャッシュメモリ14にはhumidityが含まれていないため、図8(c)の変換ルール331cにあるxsl:if文521の処理は実行されず、出力分配手段324bには空のresult要素が出力される。出力分配手段324bは何もしない。
 次に、XML受信手段321bが<sensor><humidity>30</humidity></sensor>という湿度情報を受信したとする。これはXML変換手段322bによって変換され、図10(b)に示すようなXMLがXML変換手段322cに対して出力される。
 この結果、キャッシュメモリ14の内容は<cache><temperature>19</temperature><humidity>30</humidity></cache>となる。XML変換手段322cは<dummy />というXMLを受け取り、これを契機に変換処理を行う。キャッシュメモリ14にはtemperatureとhumidityの両方が含まれているため、XML変換手段322cは変換ルール331cにあるxsl:if文521の処理を実行して図10(c)に示すXMLを出力し、それを受けた出力分配手段324bはXML送信手段27とキャッシュ更新手段26の両方にそれぞれ出力を行う。
 XML送信手段27には<sensor><temperature>19</temperature><humidity>30</humidity></sensor>が出力され、温度情報と湿度情報が結合したXMLが送信されることとなる。また、キャッシュ更新手段26には<remove select=”/cache/*” />が出力され、キャッシュメモリ14がクリアされる。
 本実施の形態は、XML変換手段を多段の構成にすることで、非同期入力された情報をすべてキャッシュに出力するため、それをさらにXML変換することができる。これによって、非同期入力された情報に対する変換ルールを容易に記述することができる。温度と湿度という2つの入力情報がある場合の例について説明したが、温度と湿度以外にさらに多くの入力がある場合にも、同じ方法を容易に拡張して適用することができる。
[第3の実施の形態]
 図11は、本発明の第3の実施の形態に係るXML処理装置601の構成を示すブロック図である。XML処理装置601のハードウェア構成は、2つのキャッシュメモリ614aおよび614bを持つ以外は同一である。
 また制御部11は、図1にある第1の実施の形態に係るXML処理装置1にある各機能部と比較して、キャッシュ参照手段23の代わりに名前付きキャッシュ参照手段628を、キャッシュ更新手段26の代わりに名前付きキャッシュ更新手段629を、それぞれ実行する。記憶部12は、XML処理装置1にある各データに加えて、キャッシュ名テーブル633を記憶する。また変換ルール31に代わって、後述の変換ルール631が記憶されている。これらの点以外の要素は、第1の実施の形態に係るXML処理装置1と同一であるので、同一の要素には同一の参照番号と名称を付けて説明を省略する。
 図12は、図11で示したキャッシュ名テーブル633のデータ例を示す概念図である。キャッシュメモリ614aおよび614bは、それぞれ1つずつのXML文書を保持することができるキャッシュメモリであり、各々<output>要素「temp1」および「temp2」として指定することができる。また、名前付きキャッシュ参照手段628は、キャッシュ名テーブル633を参照して、識別子「temp1」が指定された場合にはキャッシュメモリ614aを、識別子「temp2」が指定された場合にはキャッシュメモリ614bを、それぞれ参照する。名前付きキャッシュ更新手段629は、これと同様にキャッシュメモリ614aおよび614bの記憶内容をそれぞれ更新する。
 図13は、図11で示したXML処理装置601が実行する処理を表すフローチャートである。実行される処理は概ね図3のステップS101~108に示したものと同一の動作であるが、本実施の形態では、XML処理言語で記述された変換ルールの中にキャッシュ名が記述されており、ステップS101でXML受信手段21がXMLを受信した後で、名前付きキャッシュ参照手段628がキャッシュ名テーブル633を参照して、キャッシュメモリ614aおよび614bのうちのどちらを参照するかを決定して(ステップS701)、決定された方のキャッシュメモリを参照してステップS102の処理を行う。
 そして、ステップS105でXMLの出力先がキャッシュメモリである場合にも、名前付きキャッシュ更新手段629がキャッシュ名テーブル633を参照して、キャッシュメモリ614aおよび614bのうちのどちらを更新するかを決定して(ステップS702)、決定された方のキャッシュメモリに対してステップS106の処理を行う。他は図3の処理と同一であるので説明を省略する。
 図14は、図11で示した変換ルール631の一例を示す概念図である。XML受信手段21が温度センサ15から、たとえば「20度」という温度測定データを<sensor><temperature>20</temperature></sensor>というXML形式で受信するものとする。変換ルール631は、温度情報を入力として受け取り、20度以上の入力が3回、もしくは5度以下の入力が3回連続した場合にその3回分の温度情報を出力することを意図したものである。キャッシュメモリ614aには20度以上の温度情報が連続した場合の履歴情報を、キャッシュメモリ614bには5度以下の温度情報が連続した場合の履歴情報をそれぞれ保存する。
 変換ルール631では、まず5~45行目のxsl:choose文801で、受信した温度情報によって場合分けを行う。20度以上の場合は6~20行目の処理を、5度以下の場合は21~35行目の処理を、20度以上でも5度以下でもない場合は36~44行目の処理をそれぞれ実行する。
 20度以上の場合の6~20行目の処理は、まず7~14行目のxsl:if文802で「キャッシュメモリ614aに記憶されているデータの個数が2以上であれば、キャッシュメモリ614aに保存されている温度と、現在のセンサが関知した温度とを、<output>要素「http」に出力する」ことを意図している。その後、キャッシュメモリ614aに記憶されているデータの個数に関係なく、15~19行目のoutput文803で「現在のセンサが関知した温度を、<output>要素「temp1」(キャッシュメモリ614a)に出力する」という動作を意図している。
 5度以下の場合の21~35行目の処理は、まず22~29行目のxsl:if文811で「キャッシュメモリ614aに記憶されているデータの個数が2以上であれば、キャッシュメモリ614bに保存されている温度と、現在のセンサが関知した温度とを、<output>要素「http」に出力する」ことを意図している。その後、キャッシュメモリ614bに記憶されているデータの個数に関係なく、30~34行目のoutput文812で「現在のセンサが関知した温度を、<output>要素「temp2」(キャッシュメモリ614b)に出力する」という動作を意図している。
 20度以上でも5度以下でもない場合の36~44行目の処理は、37~39行目のoutput文821でキャッシュメモリ614aを消去し、40~42行目のoutput文822でキャッシュメモリ614bを消去している。
 今、キャッシュメモリ614aが保持するXMLが空(<cache/>)で、キャッシュメモリ614bが保持するXMLが<cache><temperature>3</temperature><temperature>4</temperature></cache>となっていたとする。これは、5度以下の温度情報を2回連続して受信した後のキャッシュ状態である。ここでXML受信手段21が温度センサ15から、<sensor><temperature>-3</temperature></sensor>というXMLを受信した。
 図15は、図14で示した変換ルール631に基づいて、図13のステップS103でXML変換手段22が出力するXMLの例を示す概念図である。キャッシュメモリ614bの持つ<temperature>要素がちょうど2つであるため、XML変換手段22はxsl:if文811に従って、キャッシュメモリ614bに保存されている温度と、現在のセンサが関知した温度とを<output>要素「http」に対して出力する。そしてoutput文812で、<output>要素「temp2」に対して現在のセンサが関知した温度を出力する。
 cache関数に渡されている引数「temp2」は、名前付きキャッシュ参照手段628によって解釈され、キャッシュ名テーブル633を参照することでアクセス先としてキャッシュメモリ614bを得る。そしてoutput文812の持つ属性値temp2は、名前付きキャッシュ更新手段629によって解釈され、キャッシュ名テーブル633を参照することでアクセス先としてキャッシュメモリ614bを得る。この結果キャッシュメモリ614bにtemperature要素が追加される。
 XML受信手段21が温度センサ15から20度以上の温度情報を受信した場合も、上記で説明したものと同一の動作が、キャッシュメモリ614a(<output>要素「temp1」、引数「temp1」)に対して行われる。そして、20度以上でも5度以下でもない温度情報を受信した場合には、キャッシュメモリ614aおよび614bはいずれも消去される。
 本実施の形態は、複数のキャッシュメモリに状態を格納することができる。これによって、5度以下、または20度以上、といった異なる目的を持つ複数の情報を生成することができる。本実施の形態では2つのキャッシュメモリがある場合の例について説明したが、キャッシュメモリが3つ以上の場合にも同じ方法を容易に拡張して適用することができる。
 これまで本発明について図面に示した特定の実施の形態をもって説明してきたが、本発明は図面に示した実施の形態に限定されるものではなく、本発明の効果を奏する限り、これまで知られたいかなる構成であっても採用することができることは言うまでもないことである。
 この出願は2008年5月13日に出願された日本出願特願2008-126515を基礎とする優先権を主張し、その開示の全てをここに取り込む。
 XMLのフォーマットを非同期的に変換することが必要な装置において利用できる。
本発明の第1の実施の形態に係るXML処理装置の構成を示すブロック図である。 図1で示した出力先解決テーブルのデータ例を示す概念図である。 図1で示したXML処理装置が実行する処理を表すフローチャートである。 図1で示した変換ルールの一例を示す概念図である。 図4で示した変換ルールに基づいて、図3のステップS103でXML変換手段が出力するXMLの例を示す概念図である。 本発明の第2の実施の形態に係るXML処理装置の構成を示すブロック図である。 図6で示したXML処理装置が実行する処理を表すフローチャートである。 図6で示した変換ルールの一例を示す概念図である。 図8の続きである。 図8~9で示した変換ルールに基づいて、図7の各ステップでXML変換手段が出力するXMLの例を示す概念図である。 本発明の第3の実施の形態に係るXML処理装置の構成を示すブロック図である。 図11で示したキャッシュ名テーブルのデータ例を示す概念図である。 図11で示したXML処理装置が実行する処理を表すフローチャートである。 図11で示した変換ルールの一例を示す概念図である。 図14で示した変換ルールに基づいて、図13のステップS103でXML変換手段が出力するXMLの例を示す概念図である。
  1,301,601 XML処理装置
  11 制御部
  12 記憶部
  13 入出力部
  14,614a,614b キャッシュメモリ
  15,315a 温度センサ
  16 ディスプレイ
  21,321a,321b XML受信手段
  22,322a,322b,322c XML変換手段
  23 キャッシュ参照手段
  24,324a,324b 出力分配手段
  25,325a,325b 出力先解釈手段
  26 キャッシュ更新手段
  27 XML送信手段
  31,331a,331b,331c,631 変換ルール
  32,332a,332b 出力先解決テーブル
  315b 湿度センサ
  628 名前付きキャッシュ参照手段
  629 名前付きキャッシュ更新手段
  633 キャッシュ名テーブル

Claims (10)

  1.  外部から非同期的に入力されるXMLをルールに従って変換して出力するXML処理装置であって、
     入力された前記XMLを前記ルールに従って変換するXML変換手段と、
     変換された前記XMLに記述された出力先を解釈する出力先解釈手段と、
     前記出力先解釈手段によって解釈された出力先に前記XMLを出力させる出力分配手段とを有することを特徴とするXML処理装置。
  2.  前記出力先解釈手段によって解釈される出力先のうち少なくとも一つが、前記XMLを一時的に保存するキャッシュメモリであることを特徴とする、請求項1に記載のXML処理装置。
  3.  前記ルールが記載されているXSLTを記憶する記憶部を有することを特徴とする、請求項2に記載のXML処理装置。
  4.  前記XML変換手段が前記ルールに従って前記キャッシュメモリを参照することが可能なキャッシュ参照手段を有することを特徴とする、請求項2に記載のXML処理装置。
  5.  前記出力分配手段からの出力に従って前記キャッシュメモリへのXMLの追加および削除を行うキャッシュ更新手段を有することを特徴とする、請求項2に記載のXML処理装置。
  6.  前記キャッシュメモリを複数有し、
     前記XMLに記述された出力先と前記複数個のキャッシュメモリとを対応づける名前付きキャッシュ参照手段を有することを特徴とする、請求項2に記載のXML処理装置。
  7.  前記キャッシュメモリを複数有し、
     前記出力分配手段からの出力に記述された出力先と前記複数個のキャッシュメモリとを対応づけて前記複数個のキャッシュメモリへのXMLの追加および削除を行う名前付きキャッシュ更新手段を有することを特徴とする、請求項2に記載のXML処理装置。
  8.  前記XML変換手段を直列に接続し、
     前記直列接続のXML変換手段に対して共有され、前記各XML変換手段による変換結果を一時的に保存するキャッシュメモリを有し、
     前記出力先解釈手段及び前記出力分配手段を、前記直列接続のXML変換手段に対応させて多段に設けた請求項1に記載のXML処理装置。
  9.  外部から非同期的に入力されるXMLを所定のルールに従って変換して出力するXML処理方法であって、
     入力された前記XMLを前記ルールに従って変換し、
     次に変換された前記XMLに記述された出力先を解釈し、
     その後に前記解釈された出力先に前記XMLを出力する
    ことを特徴とするXML処理方法。
  10.  外部から非同期的に入力されるXMLを所定のルールに従って変換して出力するXML処理装置を制御するコンピュータに、
     入力された前記XMLを前記ルールに従って変換するXML変換処理と、
     変換された前記XMLに記述された出力先を解釈する出力先解釈処理と、
     前記出力先解釈処理によって解釈された出力先に前記XMLを出力させる出力分配処理と
    を実行させることを特徴とするXML処理プログラム。
PCT/JP2009/057330 2008-05-13 2009-04-10 Xml処理装置、xml処理方法およびxml処理プログラム WO2009139245A1 (ja)

Priority Applications (2)

Application Number Priority Date Filing Date Title
US12/992,162 US8612945B2 (en) 2008-05-13 2009-04-10 XML processing device, XML processing method, and XML processing program
JP2010511927A JP5664237B2 (ja) 2008-05-13 2009-04-10 Xml処理装置、xml処理方法およびxml処理プログラム

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2008126515 2008-05-13
JP2008-126515 2008-05-13

Publications (1)

Publication Number Publication Date
WO2009139245A1 true WO2009139245A1 (ja) 2009-11-19

Family

ID=41318618

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2009/057330 WO2009139245A1 (ja) 2008-05-13 2009-04-10 Xml処理装置、xml処理方法およびxml処理プログラム

Country Status (3)

Country Link
US (1) US8612945B2 (ja)
JP (1) JP5664237B2 (ja)
WO (1) WO2009139245A1 (ja)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9043366B2 (en) 2010-10-01 2015-05-26 International Business Machines Corporation High performance map editor for business analysts
EP2479892B1 (en) * 2011-01-19 2013-08-28 Sensirion AG Input device
US9098558B2 (en) * 2013-04-01 2015-08-04 Oracle International Corporation Enhanced flexibility for users to transform XML data to a desired format

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11298520A (ja) * 1998-04-15 1999-10-29 Nippon Telegr & Teleph Corp <Ntt> 電子メール転送装置、電子メール転送プログラムを記録した記録媒体、並びに、メールサーバシステム
JPH11338794A (ja) * 1998-05-25 1999-12-10 Nec Software Kobe Ltd 電子メール受信処理装置

Family Cites Families (28)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2911256B2 (ja) 1991-06-25 1999-06-23 株式会社東芝 ディジタル制御装置
JP3478725B2 (ja) 1997-07-25 2003-12-15 株式会社リコー 文書情報管理システム
EP1194850A1 (en) * 1999-06-30 2002-04-10 Microsoft Corporation System and method for protecting shared system files
US7590644B2 (en) * 1999-12-21 2009-09-15 International Business Machine Corporation Method and apparatus of streaming data transformation using code generator and translator
JP3612472B2 (ja) * 2000-06-22 2005-01-19 株式会社日立製作所 遠隔監視診断システム、及び遠隔監視診断方法
JP4366040B2 (ja) 2002-03-07 2009-11-18 インターナショナル・ビジネス・マシーンズ・コーポレーション ネットワークサービスシステム、サーバ及びプログラム
US7496687B2 (en) * 2002-05-01 2009-02-24 Bea Systems, Inc. Enterprise application platform
US7721202B2 (en) 2002-08-16 2010-05-18 Open Invention Network, Llc XML streaming transformer
US7716632B2 (en) * 2002-11-01 2010-05-11 Vertafore, Inc. Automated software robot generator
US7519948B1 (en) * 2002-12-26 2009-04-14 Judson Ames Cornish Platform for processing semi-structured self-describing data
EP1609061A2 (de) * 2003-04-01 2005-12-28 Siemens Aktiengesellschaft Verfahren und anordnung zur veränderung von software oder quellcode
US20050010896A1 (en) * 2003-07-07 2005-01-13 International Business Machines Corporation Universal format transformation between relational database management systems and extensible markup language using XML relational transformation
TWI237767B (en) * 2003-12-23 2005-08-11 High Tech Comp Corp Serial/parallel data transformer module and related computer systems
US7945903B1 (en) * 2004-04-16 2011-05-17 At&T Intellectual Property Ii, L.P. System and method for converting graphical call flows into finite state machines
JP2007536634A (ja) * 2004-05-04 2007-12-13 フィッシャー−ローズマウント・システムズ・インコーポレーテッド プロセス制御システムのためのサービス指向型アーキテクチャ
JP4220439B2 (ja) 2004-06-30 2009-02-04 株式会社東芝 構造化データ変換装置及び方法
US7467149B2 (en) * 2005-03-14 2008-12-16 Microsoft Corporation Complex syntax validation and business logic validation rules, using VAXs (value-added XSDs) compliant with W3C-XML schema specification
JP2006259928A (ja) 2005-03-15 2006-09-28 Nippon Telegr & Teleph Corp <Ntt> データ収集装置
JP4690798B2 (ja) 2005-07-05 2011-06-01 株式会社リコー ネットワーク装置
JP4519028B2 (ja) 2005-07-28 2010-08-04 日本電信電話株式会社 XPath式処理装置
US8286075B2 (en) * 2006-03-07 2012-10-09 Oracle International Corporation Reducing resource requirements when transforming source data in a source markup language to target data in a target markup language using transformation rules
US20080104579A1 (en) * 2006-10-31 2008-05-01 Sap Ag Systems and methods of transforming XML schemas
GB2443846B (en) * 2006-11-15 2011-12-07 Joseph Timothy Poole Computing system
US8056062B2 (en) * 2007-05-14 2011-11-08 General Electric Company Methods and systems for converting application code in turbine control systems
US20080306986A1 (en) * 2007-06-08 2008-12-11 Accenture Global Services Gmbh Migration of Legacy Applications
US8032826B2 (en) * 2008-02-21 2011-10-04 International Business Machines Corporation Structure-position mapping of XML with fixed length data
US8397222B2 (en) * 2008-12-05 2013-03-12 Peter D. Warren Any-to-any system for doing computing
US8645936B2 (en) * 2009-09-30 2014-02-04 Zynga Inc. Apparatuses, methods and systems for an a API call abstractor

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11298520A (ja) * 1998-04-15 1999-10-29 Nippon Telegr & Teleph Corp <Ntt> 電子メール転送装置、電子メール転送プログラムを記録した記録媒体、並びに、メールサーバシステム
JPH11338794A (ja) * 1998-05-25 1999-12-10 Nec Software Kobe Ltd 電子メール受信処理装置

Also Published As

Publication number Publication date
JPWO2009139245A1 (ja) 2011-09-15
US20110066809A1 (en) 2011-03-17
JP5664237B2 (ja) 2015-02-04
US8612945B2 (en) 2013-12-17

Similar Documents

Publication Publication Date Title
JP3272014B2 (ja) 階層構造データ処理情報を含むデータ処理辞書を作成する方法及び装置
JP4711708B2 (ja) ネストされたテーブルを用いたスキーマレスデータマッピングのためのシステムおよび方法
WO2006116649A2 (en) Parser for structured document
US8306990B2 (en) Transferring and displaying hierarchical data between databases and electronic documents
CN102395968A (zh) 用于为rdf数据库查询生成rdf数据库的方法和设备以及用于rdf数据库查询的检索方法和检索设备
JP2019109693A (ja) データ管理装置、データ管理方法、およびプログラム
WO2004061713A1 (ja) 構造化文書の構造変換装置、構造変換方法、記録媒体
WO2009139245A1 (ja) Xml処理装置、xml処理方法およびxml処理プログラム
EP1990737A1 (en) Document transformation system
US8171040B2 (en) Method and system for navigation of a data structure
JP5142638B2 (ja) 文書変換装置、文書変換方法
JP2006065467A5 (ja)
US7313567B1 (en) Schemaless XML payload generation
JP2012059212A (ja) 抽出装置、抽出方法及び抽出プログラム
EP2843545A1 (en) Representation of multiple markup language files that differ in structure and content in one file for the production of new markup language files
WO2022188103A1 (zh) 数据采集方法、装置、计算设备以及存储介质
CN104504044B (zh) 一种电子文件的智能封装方法及系统
JP4868733B2 (ja) 構造化文書処理装置及び構造化文書処理方法、プログラム
JP5206675B2 (ja) 構造化文書変換装置
JP4205603B2 (ja) 可変長マルチフォーマット変換装置及び方法並びにこれを用いたファイル転送システム
JP4411994B2 (ja) 情報処理装置
Henderson et al. Using ePub as framework for the automated collection, tagging, and transformation of web content for cross-media publication
JP2003140960A (ja) Xmlデータのデータ変換方法及びプログラム
WO2015156336A1 (ja) 用語統一システム及び用語統一プログラム、並びに用語統一方法
JP4134824B2 (ja) 情報処理装置及びプログラム

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 09746452

Country of ref document: EP

Kind code of ref document: A1

DPE1 Request for preliminary examination filed after expiration of 19th month from priority date (pct application filed from 20040101)
WWE Wipo information: entry into national phase

Ref document number: 12992162

Country of ref document: US

Ref document number: 2010511927

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: 09746452

Country of ref document: EP

Kind code of ref document: A1