CN111222015A - Method for generating document by heterogeneous XML mapping - Google Patents
Method for generating document by heterogeneous XML mapping Download PDFInfo
- Publication number
- CN111222015A CN111222015A CN201911336574.5A CN201911336574A CN111222015A CN 111222015 A CN111222015 A CN 111222015A CN 201911336574 A CN201911336574 A CN 201911336574A CN 111222015 A CN111222015 A CN 111222015A
- Authority
- CN
- China
- Prior art keywords
- nodes
- xml
- mapping
- data
- node
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/80—Information retrieval; Database structures therefor; File system structures therefor of semi-structured data, e.g. markup language structured data such as SGML, XML or HTML
- G06F16/84—Mapping; Conversion
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Document Processing Apparatus (AREA)
Abstract
The invention provides a method for generating a document by heterogeneous XML mapping in the field of XML data management, which comprises the following steps: step S10, configuring a data source of XML; step S20, configuring a standard template of XML; step S30, mapping the data source to a standard template to generate mapping data; step S40, generating a document from the data source according to the mapping data; the step S10 is not in sequence with the step S20. The invention has the advantages that: the efficiency of standardizing XML data of different formats is improved, and the use difficulty is reduced.
Description
Technical Field
The invention relates to the field of XML data management, in particular to a method for generating a document by heterogeneous XML mapping.
Background
XML is an extensible markup language, a structured markup language for marking electronic documents, is well suited for world wide web transmission, and provides a uniform method for describing and exchanging structured data independent of applications or providers. Thus, the XML data format is often used as a data carrier for hospital information to communicate across systems, medical institutions.
The sources of XML data are different, some XML data are from table records of different databases, some XML data are from interface services of systems, the formats of the XML data from different sources are different, and mutual recognition and sharing of the data among different systems are inconvenient. Conventionally, how to standardize XML data in different formats is to read data through codes, compare the data with the data and output the data, and if new requirements or changes exist, developers need to modify the codes, so that the defects that the efficiency of standardization of the XML data is low, the operation needs a programming basis, and the popularization and the use are inconvenient exist.
Therefore, how to provide a method for generating a document by heterogeneous XML mapping to improve the efficiency of standardizing XML data with different formats and reduce the difficulty in use becomes a problem to be solved urgently.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a method for generating a document by mapping heterogeneous XML, so that the efficiency of standardizing XML data with different formats is improved, and the use difficulty is reduced.
The invention is realized by the following steps: a method for generating a document by heterogeneous XML mapping comprises the following steps:
step S10, configuring a data source of XML;
step S20, configuring a standard template of XML;
step S30, mapping the data source to a standard template to generate mapping data;
step S40, generating a document from the data source according to the mapping data;
the step S10 is not in sequence with the step S20.
Further, the step S10 specifically includes:
step S11, setting a data source comprising a WEB service and a database, judging the data source of the XML, and entering step S12 if the data source is the WEB service; if the source is the database, go to step S13;
s12, saving the XML template of the WEB service, and entering the step S20;
step S13, configuring the basic information of the data source based on the database of the source, and proceeding to step S20.
Further, in step S13, the basic information at least includes a host address, a port, a database name, a user name, and a password.
Further, the step S20 is specifically:
creating a rendering rule, configuring nodes of an XML standard template, configuring multivariate information and mandatory information of the nodes by using the rendering rule, and configuring the hierarchical relationship among the nodes; the nodes comprise father nodes and son nodes; the multivariate information is multivariate nodes and non-multivariate nodes; the mandatory information comprises mandatory filling nodes and unnecessary filling nodes.
Further, the rendering rule comprises the steps of only appearing once and filling necessarily, only appearing once and filling not necessarily, appearing at least once and appearing unlimited times;
the multivariate information and the necessary information for configuring the nodes by using the rendering rule are specifically as follows:
if the rendering rule of the nodes is set to be only once and must be filled or at least once, the nodes are necessarily filled, if the nodes are repeatedly present, the nodes are multivariate nodes, and if the nodes are present only once, the nodes are non-multivariate nodes; if the rendering rule of the nodes is set to be that only one-time unnecessary filling occurs or the occurrence times are not limited, the nodes are unnecessary filling, if the nodes occur for multiple times, the nodes are multi-element nodes, and if the nodes occur only once, the nodes are non-multi-element nodes.
Further, the step S30 specifically includes:
step S31, creating a database table for storing XML mapping information, judging the source of XML data source, and entering step S32 if the source is WEB service; if the source is the database, go to step S33;
step S32, configuring the XPATH of the data source node, the name of the data source node, the XPATH of the target node, the name of the target node, the multivariate information of the target node, the hierarchy of the current node and the mapping configuration of the father node, generating first mapping data to be stored in the database table, and entering step S40;
step S33, configuring ID of data source, query SQL statement, parameter expression, dependency information, XPATH of dependent node, name of dependent node, binding field, XPATH of target node, name of target node, multivariate information of target node, current node level and mapping configuration of father node, generating second mapping data to be stored in the database table, and proceeding to step S40.
Further, the parameter expression comprises a parameter name, a parameter mapping node XPATH, an attribute and a default value in the query SQL statement; the parameter mapping node XPATH is used for acquiring data from the appointed XPATH and assigning the data to the parameter;
the dependency information comprises dependency and independence, the dependency refers to the configuration parameters of other nodes, and the independence refers to the nodes which take the set values from the database.
Further, the step S40 is specifically:
and according to the mapping data and the rendering rule, marking the rendering rule as unlimited occurrence times, marking the nodes without mapping as deleted, rendering non-multivariate nodes, recursively rendering multivariate nodes from the outermost layer, deleting the nodes marked as deleted, and further generating a document from the data source.
The invention has the advantages that:
the XML data source and the standard template are configured, the data source is mapped to the standard template to generate mapping data, the data source is generated into a document according to the mapping data, errors possibly generated in the code development and code development processes are skipped, the whole process is very visual and efficient through configuration, the efficiency of standardizing XML data in different formats is improved, and the use difficulty is reduced. The heterogeneous data (content and format) can be reliably and efficiently generated into the standard document, the difficulty of mutual recognition and sharing of the data in a hospital service system is reduced, and the availability and the interactivity of the data are greatly improved.
Drawings
The invention will be further described with reference to the following examples with reference to the accompanying drawings.
FIG. 1 is a flow chart of a method for generating a document by heterogeneous XML mapping according to the present invention.
Detailed Description
Referring to fig. 1, a preferred embodiment of a method for generating a document by using heterogeneous XML mapping according to the present invention includes the following steps:
step S10, configuring a data source of XML;
step S20, configuring a standard template of XML;
step S30, mapping the data source to a standard template to generate mapping data;
step S40, generating a document from the data source according to the mapping data; generating a document, namely generating an XML file which accords with the standard;
the step S10 is not in sequence with the step S20.
The step S10 specifically includes:
step S11, setting a data source comprising a WEB service and a database, judging the data source of the XML, and entering step S12 if the data source is the WEB service; if the source is the database, go to step S13; databases supporting mainstream, such as MySQL, Oracle, SQLServer, etc.;
s12, saving the XML template of the WEB service, and entering the step S20; the XML template is also an XML, namely all data can be filled according to the template;
step S13, configuring the basic information of the data source based on the database of the source, and proceeding to step S20.
In step S13, the basic information at least includes a host address, a port, a database name, a user name, and a password.
The step S20 specifically includes:
creating a rendering rule, configuring nodes of an XML standard template, configuring multivariate information and mandatory information of the nodes by using the rendering rule, and configuring the hierarchical relationship among the nodes; the nodes comprise father nodes and son nodes; the multivariate information is multivariate nodes and non-multivariate nodes; the mandatory information is a mandatory filling node and an unnecessary filling node; the hierarchical relationship is the tree structure relationship of each node.
The rendering rules comprise only one occurrence and bound occurrence, only one occurrence and non-bound occurrence, represented by 1 … … 1, 0 … … 1, 1 … … and 0 … … respectively;
the multivariate information and the necessary information for configuring the nodes by using the rendering rule are specifically as follows:
if the rendering rule of the nodes is set to be only once and must be filled or at least once, the nodes are necessarily filled, if the nodes are repeatedly present, the nodes are multivariate nodes, and if the nodes are present only once, the nodes are non-multivariate nodes; if the rendering rule of the nodes is set to be that only one-time unnecessary filling occurs or the occurrence times are not limited, the nodes are unnecessary filling, if the nodes occur for multiple times, the nodes are multi-element nodes, and if the nodes occur only once, the nodes are non-multi-element nodes.
The step S30 specifically includes:
step S31, creating a database table for storing XML mapping information, judging the source of XML data source, and entering step S32 if the source is WEB service; if the source is the database, go to step S33;
step S32, configuring the XPATH of the data source node, the name of the data source node, the XPATH of the target node, the name of the target node, the multivariate information of the target node, the hierarchy of the current node and the mapping configuration of the father node, generating first mapping data to be stored in the database table, and entering step S40; XPATH is XML Path Language (XML Path Language), which is a Language used to determine the location of a part in an XML document;
step S33, configuring ID of data source, query SQL statement, parameter expression, dependency information, XPATH of dependent node, name of dependent node, binding field, XPATH of target node, name of target node, multivariate information of target node, current node level and mapping configuration of father node, generating second mapping data to be stored in the database table, and proceeding to step S40.
The parameter expression comprises a parameter name, a parameter mapping node XPATH, an attribute and a default value in the query SQL statement; the parameter mapping node XPATH is used for acquiring data from the appointed XPATH and assigning the data to the parameter;
the dependency information comprises dependency and independence, the dependency refers to the configuration parameters of other nodes, and the independence refers to the nodes which take the set values from the database.
The step S40 specifically includes:
and according to the mapping data and the rendering rule, marking the rendering rule as unlimited occurrence times, marking the nodes without mapping as deleted, rendering non-multivariate nodes, recursively rendering multivariate nodes from the outermost layer, deleting the nodes marked as deleted, and further generating a document from the data source.
In summary, the invention has the advantages that:
the XML data source and the standard template are configured, the data source is mapped to the standard template to generate mapping data, the data source is generated into a document according to the mapping data, errors possibly generated in the code development and code development processes are skipped, the whole process is very visual and efficient through configuration, the efficiency of standardizing XML data in different formats is improved, and the use difficulty is reduced. The heterogeneous data (content and format) can be reliably and efficiently generated into the standard document, the difficulty of mutual recognition and sharing of the data in a hospital service system is reduced, and the availability and the interactivity of the data are greatly improved.
Although specific embodiments of the invention have been described above, it will be understood by those skilled in the art that the specific embodiments described are illustrative only and are not limiting upon the scope of the invention, and that equivalent modifications and variations can be made by those skilled in the art without departing from the spirit of the invention, which is to be limited only by the appended claims.
Claims (8)
1. A method for generating a document by heterogeneous XML mapping is characterized in that: the method comprises the following steps:
step S10, configuring a data source of XML;
step S20, configuring a standard template of XML;
step S30, mapping the data source to a standard template to generate mapping data;
step S40, generating a document from the data source according to the mapping data;
the step S10 is not in sequence with the step S20.
2. The method of claim 1 for a heterogeneous XML map production document, wherein: the step S10 specifically includes:
step S11, setting a data source comprising a WEB service and a database, judging the data source of the XML, and entering step S12 if the data source is the WEB service; if the source is the database, go to step S13;
s12, saving the XML template of the WEB service, and entering the step S20;
step S13, configuring the basic information of the data source based on the database of the source, and proceeding to step S20.
3. The method of claim 2, wherein the heterogeneous XML map production document: in step S13, the basic information at least includes a host address, a port, a database name, a user name, and a password.
4. The method of claim 1 for a heterogeneous XML map production document, wherein: the step S20 specifically includes:
creating a rendering rule, configuring nodes of an XML standard template, configuring multivariate information and mandatory information of the nodes by using the rendering rule, and configuring the hierarchical relationship among the nodes; the nodes comprise father nodes and son nodes; the multivariate information is multivariate nodes and non-multivariate nodes; the mandatory information comprises mandatory filling nodes and unnecessary filling nodes.
5. The method of claim 4, wherein the method for generating a document from a heterogeneous XML map comprises: the rendering rule comprises the steps of only appearing once and filling necessarily, only appearing once and filling not necessarily, appearing at least once and not limiting the appearing times;
the multivariate information and the necessary information for configuring the nodes by using the rendering rule are specifically as follows:
if the rendering rule of the nodes is set to be only once and must be filled or at least once, the nodes are necessarily filled, if the nodes are repeatedly present, the nodes are multivariate nodes, and if the nodes are present only once, the nodes are non-multivariate nodes; if the rendering rule of the nodes is set to be that only one-time unnecessary filling occurs or the occurrence times are not limited, the nodes are unnecessary filling, if the nodes occur for multiple times, the nodes are multi-element nodes, and if the nodes occur only once, the nodes are non-multi-element nodes.
6. The method of claim 4, wherein the method for generating a document from a heterogeneous XML map comprises: the step S30 specifically includes:
step S31, creating a database table for storing XML mapping information, judging the source of XML data source, and entering step S32 if the source is WEB service; if the source is the database, go to step S33;
step S32, configuring the XPATH of the data source node, the name of the data source node, the XPATH of the target node, the name of the target node, the multivariate information of the target node, the hierarchy of the current node and the mapping configuration of the father node, generating first mapping data to be stored in the database table, and entering step S40;
step S33, configuring ID of data source, query SQL statement, parameter expression, dependency information, XPATH of dependent node, name of dependent node, binding field, XPATH of target node, name of target node, multivariate information of target node, current node level and mapping configuration of father node, generating second mapping data to be stored in the database table, and proceeding to step S40.
7. The method of claim 6, wherein the heterogeneous XML map production document: the parameter expression comprises a parameter name, a parameter mapping node XPATH, an attribute and a default value in the query SQL statement; the parameter mapping node XPATH is used for acquiring data from the appointed XPATH and assigning the data to the parameter;
the dependency information comprises dependency and independence, the dependency refers to the configuration parameters of other nodes, and the independence refers to the nodes which take the set values from the database.
8. The method of claim 5, wherein the heterogeneous XML map generation document comprises: the step S40 specifically includes:
and according to the mapping data and the rendering rule, marking the rendering rule as unlimited occurrence times, marking the nodes without mapping as deleted, rendering non-multivariate nodes, recursively rendering multivariate nodes from the outermost layer, deleting the nodes marked as deleted, and further generating a document from the data source.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911336574.5A CN111222015B (en) | 2019-12-23 | 2019-12-23 | Method for generating document by heterogeneous XML mapping |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911336574.5A CN111222015B (en) | 2019-12-23 | 2019-12-23 | Method for generating document by heterogeneous XML mapping |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111222015A true CN111222015A (en) | 2020-06-02 |
CN111222015B CN111222015B (en) | 2022-06-07 |
Family
ID=70827807
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911336574.5A Active CN111222015B (en) | 2019-12-23 | 2019-12-23 | Method for generating document by heterogeneous XML mapping |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111222015B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116703337A (en) * | 2023-08-08 | 2023-09-05 | 金现代信息产业股份有限公司 | Project document examination system and method based on artificial intelligence technology |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104361221A (en) * | 2014-10-31 | 2015-02-18 | 沈阳锐易特软件技术有限公司 | Heterogeneous system data mapping template-based medical data acquisition system and method |
CN107315768A (en) * | 2017-05-17 | 2017-11-03 | 上海交通大学 | The distribution information interacting method and system mapped based on Heterogeneous Information model |
US20190361908A1 (en) * | 2016-11-07 | 2019-11-28 | University-Industry Cooperation Group Of Kyung Hee University | Method, apparatus and computer program for mapping medical data |
-
2019
- 2019-12-23 CN CN201911336574.5A patent/CN111222015B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104361221A (en) * | 2014-10-31 | 2015-02-18 | 沈阳锐易特软件技术有限公司 | Heterogeneous system data mapping template-based medical data acquisition system and method |
US20190361908A1 (en) * | 2016-11-07 | 2019-11-28 | University-Industry Cooperation Group Of Kyung Hee University | Method, apparatus and computer program for mapping medical data |
CN107315768A (en) * | 2017-05-17 | 2017-11-03 | 上海交通大学 | The distribution information interacting method and system mapped based on Heterogeneous Information model |
Non-Patent Citations (1)
Title |
---|
普通网友: "《XML实现异构数据库间转换的实现与分析》", 《HTTPS://BLOG.CSDN.NET/WEIXIN_34409703/ARTICLE/DETAILS/94538031》 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116703337A (en) * | 2023-08-08 | 2023-09-05 | 金现代信息产业股份有限公司 | Project document examination system and method based on artificial intelligence technology |
Also Published As
Publication number | Publication date |
---|---|
CN111222015B (en) | 2022-06-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20210263948A1 (en) | Content transfer | |
US7533102B2 (en) | Method and apparatus for converting legacy programming language data structures to schema definitions | |
US6732095B1 (en) | Method and apparatus for mapping between XML and relational representations | |
US7526769B2 (en) | Message translation and parsing of data structures in a distributed component architecture | |
US8756568B2 (en) | Documentation generation for web APIs based on byte code analysis | |
US20220147326A1 (en) | Automated api code generation | |
US8856732B2 (en) | System and method for creating, managing, and reusing schema type definitions in services oriented architecture services, grouped in the form of libraries | |
US7873899B2 (en) | Mapping schemes for creating and storing electronic documents | |
US9535966B1 (en) | Techniques for aggregating data from multiple sources | |
CN104133772A (en) | Automatic test data generation method | |
US9967370B2 (en) | OData enabled mobile software applications | |
US11144307B2 (en) | Service interface creation and modification for object-oriented services | |
CN104461531A (en) | Implementing method for self-defined functions of reporting system | |
CN115934673A (en) | System and method for facilitating metadata identification and import | |
CN111222015B (en) | Method for generating document by heterogeneous XML mapping | |
CN111198678A (en) | Method and device for generating GraphQL front-end operation interface | |
CN114138748A (en) | Database mapping file generation method, device, equipment and storage medium | |
CN111045660A (en) | Method, device and storage medium for verifying tax declaration data on network | |
US20050137846A1 (en) | On-demand creation of Java locale source | |
Le Zou et al. | On synchronizing with web service evolution | |
CN109241515B (en) | Method and device for generating report file | |
CN111104409A (en) | Database processing method and device, storage medium and electronic equipment | |
CN104360890A (en) | Method for generating XML file based on Java | |
CN113190264B (en) | JPA-based automatic data version generation and application device and method | |
CN111597389B (en) | Data processing method, device, equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |