CN101000622A - Method and device for checking validity of expandable mark language mode - Google Patents
Method and device for checking validity of expandable mark language mode Download PDFInfo
- Publication number
- CN101000622A CN101000622A CN 200710000087 CN200710000087A CN101000622A CN 101000622 A CN101000622 A CN 101000622A CN 200710000087 CN200710000087 CN 200710000087 CN 200710000087 A CN200710000087 A CN 200710000087A CN 101000622 A CN101000622 A CN 101000622A
- Authority
- CN
- China
- Prior art keywords
- schema
- xml
- xml information
- database
- satisfy
- 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
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Document Processing Apparatus (AREA)
Abstract
A device used for verifying effectiveness of expandable label language mode consists of Schema conversion module for converting XML structured as per Schema to be databank table structure, XML information insertion module for inserting converted XML information into databank with table structure from top to bottom, verification module for verifying whether XML information is satisfied with Schema specification requirement or not by utilizing constraint mechanism of databank, warning module for making alarm when that XML information is not satisfied with Schema specification requirement is verified out.
Description
Technical field
The present invention relates to Internet data service field, relate in particular to a kind of method and device of checking validity of expandable mark language mode.
Background technology
The mode of semantic meaning representation more and more is widely used among the present application software design among the XML (extend markup language), and a lot of softwares come mutual form between the defining interface with it.Use the XML form to carry out mutual the time on the other hand between the process, server processes often need the XML information of client process is carried out Schema (pattern, promptly, also can carry out some explanations restrictive and semantically to its content to the explanation of the mechanism of one or one group XML file) verification.
But because the laxity of XML language syntax, the programmer is in structure XML text message, often be difficult to guarantee its correctness during beginning, the validity constraint that whether meets the Schema of corresponding demand, need wait until with the server full confirmation after can determine, and often need expensive energy, and efficient is very low for this reason.
Summary of the invention
The embodiment of the invention provides a kind of method and device of verification extend markup language Schema validity, can't guarantee the problem of correctness when having solved prior art structure XML information.
The embodiment of the invention is achieved through the following technical solutions:
The embodiment of the invention provides a kind of method of checking validity of expandable mark language mode, comprising:
The Mode S chema of expandable mark language XML is converted to database table structure;
The top-down insertion of XML information after the described conversion is had in the database of described list structure;
Utilize the described XML information of tied mechanism verification of database whether to satisfy the code requirement of Schema.
The embodiment of the invention provides a kind of device of checking validity of expandable mark language mode, comprising:
Mode S chema modular converter is used for the expandable mark language XML according to the Schema structure is converted to database table structure;
XML information insert module is used for the top-down insertion of XML information after the described conversion is had the database of described list structure;
The verification module is used in described XML information insert module described XML information being inserted and has the data base procedure of described list structure, utilizes the described XML information of tied mechanism verification of database whether to satisfy the code requirement of Schema.
As seen from the above technical solution provided by the invention, the present invention is by becoming database table structure with the XML information translation, again described XML information is inserted and had in the database of described list structure, utilize the existing function of database to realize verification the Schema validity of XML.By the power of current database technology, check the correctness of XML information easily and efficiently, when having guaranteed between process, to use XML to carry out interactive interfacing, make information satisfy the requirement of data legitimacy.
Description of drawings
Fig. 1 is a kind of embodiment process flow diagram of the method for the invention;
Fig. 2 is a kind of embodiment module diagram of device of the present invention.
Embodiment
The embodiment of the invention is given database with the Schema verification of XML information and is handled, promptly, to be converted to the list structure of database according to the XML tree of Schema structure, described XML information insertion is had in the database of described list structure, utilize the existing function check XML of database information whether to satisfy the code requirement of Schema.
The embodiment of the invention one specific implementation process comprises the steps: as shown in Figure 1
Step 1 is converted to the tree according to the XML of Schema structure that needs verification the list structure of database;
The characteristics of XML grammer are: an XML information is a tree that is made of series of elements, except root element, other element all has corresponding father's element, an element may exist 0 or a plurality of daughter element, therefore in fact constitute a reflexivity between the element entity among the XML, that is, father's element and daughter element are the relations more than 0 pair, all are elements and no matter father's element still is a daughter element itself; Element among the XML can have 0 or a plurality of attribute, and the relation between element entity and the attribute entities is the relation more than 0 pair;
According to the characteristics of above-mentioned XML grammer, construct database table structure as shown in the table:
Utilize above-mentioned list structure, the XML tree according to Schema structure can be converted between simple element entity and the attribute entities and corresponding linear relationship between the element entity;
Instantiation of described conversion process is as follows:
The Schema of an existing XML is defined as follows:
<?xml?version=″1.0″encoding=″UTF-8″?>
<xs:element?name=″name″type=″xs:string″/>
<xs:element?name=″presence″>
<xs:complexType>
<xs:sequence>
<xs:element?ref=″user″/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element?name=″uri″type=″xs:string″/>
<xs:element?name=″user″>
<xs:complexType>
<xs:sequence>
<xs:element?ref=″uri″/>
<xs:element?ref=″name″/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
A corresponding XML document is:
<?xml?version=″1.0″encoding=″UTF-8″?>
<presence>
<user>
<uri>sip:imsuser01@cmcc.com</uri>
<name>cmcc</name>
</user>
</presence>
This Schema has a root element presence as can be seen, and this root element has a daughter element user, and two daughter element: uri and name are arranged under the user element, and being converted into like this will be as follows after the information in the database:
Component identification father component identification name-value
1 NULL presence NULL
2 1 user NULL
3 2 uri sip:imsuser01@cmcc.com
4 2 name cmcc
Step 2 writes in the database with above-mentioned list structure the XML information after the above-mentioned conversion is top-down;
Because father's component identification is actually an external key of element entity in the list of elements, component identification in the attribute list is actually an external key of attribute entities, for satisfying the foreign key constraint requirement of data in the database, it is the master slave relation requirement, therefore must earlier the top layer element be inserted database, and then insert bottom element and corresponding attribute information thereof;
Step 3 utilizes the various tied mechanisms in the database to realize whether verification XML information satisfies the code requirement of Schema;
If in the process of an XML information completely being inserted database, failure occurs, illustrate that then the XML information of above-mentioned structure does not satisfy its Schema requirement, need re-construct; Otherwise then be correct.
Tied mechanism in the described database comprises: the relation of inclusion between the element is handled, satisfied to attribute and element in different ways, the value of some element can not can only can only be character string or the like for digital and/or some element value for empty, some value can only have an element, some element value.
Describedly utilize various tied mechanisms in the database to carry out verification in the checking procedure to go out XML information and do not satisfy the situation that its Schema requires and comprise: with attribute as unit usually handle, put upside down relation of inclusion between the element, can not for the value of the element of sky for empty, an element can only be arranged but not element, can only be nonnumeric for the value of the element of numeral and/or can only be non-character string or the like for the value of the element of character string.During insertion, when above-mentioned arbitrary situation occurring, then insert failure, show that described XML information does not satisfy the code requirement of Schema.
Step 4 when the described XML information of verification does not satisfy the code requirement of Schema, gives a warning, and the described XML information of prompting user does not satisfy the code requirement of Schema.This step is an optional step.
The embodiment of the invention two provides a kind of device of verification extend markup language Schema validity, and a kind of embodiment module diagram of described device comprises as shown in Figure 2:
The Schema modular converter is used for the XML according to the Schema structure is converted to database table structure;
XML information insert module is used for the top-down insertion of XML information after the described conversion is had the database of described list structure;
The verification module, the top-down insertion of XML information that is used for after described XML information insert module is with described conversion has the data base procedure of described list structure, utilizes the described XML information of the various constraint checkings of database whether to satisfy the code requirement of Schema.
Described device can further include:
Alert module is used to receive the check results of verification module, goes out in the calibration mode block check to give a warning when XML information does not satisfy the code requirement of Schema.
In sum, the embodiment of the invention has realized the Schema validity of verification XML, by the power of current database technology, checks the correctness of XML information easily and efficiently, when having guaranteed between process, to use XML to carry out interactive interfacing, make information satisfy the requirement of data legitimacy.
The above; only for the preferable embodiment of the present invention, but protection scope of the present invention is not limited thereto, and anyly is familiar with those skilled in the art in the technical scope that the present invention discloses; the variation that can expect easily or replacement all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection domain of claim.
Claims (7)
1, a kind of method of checking validity of expandable mark language mode is characterized in that, comprising:
The Mode S chema of expandable mark language XML is converted to database table structure;
The top-down insertion of XML information after the described conversion is had in the database of described list structure;
Utilize the described XML information of tied mechanism verification of database whether to satisfy the code requirement of Schema.
2, the method for claim 1 is characterized in that, the method that described Schema with expandable mark language XML is converted to database table structure comprises:
To be converted between element entity and the attribute entities according to the XML tree of Schema structure and corresponding linear relationship table between the element entity.
3, the method for claim 1 is characterized in that, the method that the described tied mechanism of utilizing database comes the described XML information of verification whether to satisfy the code requirement of Schema comprises:
In that the insertion of the XML information after the described conversion is had in the data base procedure of described list structure,, show that then described XML information does not satisfy the code requirement of Schema if insert failure.
4, method as claimed in claim 3, it is characterized in that the situation of described insertion failure comprises: with attribute as unit usually handle, put upside down relation of inclusion between the element, can not for the element value of sky for empty, an element can only be arranged but not element, can only be for the value of the element of numeral nonnumeric and/or can only be for the value of the element of character string but not character string.
5, the method for claim 1 is characterized in that, when the described XML information of verification did not satisfy the code requirement of described Schema, described method further comprised:
Give a warning, the described XML information of prompting user does not satisfy the code requirement of described Schema.
6, a kind of device of checking validity of expandable mark language mode is characterized in that, comprising:
Mode S chema modular converter is used for the expandable mark language XML according to the Schema structure is converted to database table structure;
XML information insert module is used for the top-down insertion of XML information after the described conversion is had the database of described list structure;
The verification module is used in described XML information insert module described XML information being inserted and has the data base procedure of described list structure, utilizes the described XML information of tied mechanism verification of database whether to satisfy the code requirement of Schema.
7, device as claimed in claim 6 is characterized in that, described device also comprises:
Alert module is used to receive the check results of verification module, goes out in the calibration mode block check to give a warning when XML information does not satisfy the code requirement of Schema.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2007100000872A CN101000622B (en) | 2007-01-10 | 2007-01-10 | Method and device for checking validity of expandable mark language mode |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2007100000872A CN101000622B (en) | 2007-01-10 | 2007-01-10 | Method and device for checking validity of expandable mark language mode |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101000622A true CN101000622A (en) | 2007-07-18 |
CN101000622B CN101000622B (en) | 2010-08-11 |
Family
ID=38692594
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2007100000872A Expired - Fee Related CN101000622B (en) | 2007-01-10 | 2007-01-10 | Method and device for checking validity of expandable mark language mode |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101000622B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2013135055A1 (en) * | 2012-03-15 | 2013-09-19 | 北京播思无线技术有限公司 | Method for storing xml data into relational database |
CN104809111A (en) * | 2014-01-23 | 2015-07-29 | 北京北方微电子基地设备工艺研究中心有限责任公司 | Method, device and system for verifying validation of automatic system database file |
CN107357792A (en) * | 2016-05-10 | 2017-11-17 | 北京京东尚科信息技术有限公司 | A kind of method and apparatus of data parsing |
CN107800917A (en) * | 2017-12-15 | 2018-03-13 | 定远县网萌电子商务有限公司 | Archival digitalization Machining Intelligent process flow line platform |
-
2007
- 2007-01-10 CN CN2007100000872A patent/CN101000622B/en not_active Expired - Fee Related
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2013135055A1 (en) * | 2012-03-15 | 2013-09-19 | 北京播思无线技术有限公司 | Method for storing xml data into relational database |
US9928289B2 (en) | 2012-03-15 | 2018-03-27 | Borqs Wireless Ltd. | Method for storing XML data into relational database |
CN104809111A (en) * | 2014-01-23 | 2015-07-29 | 北京北方微电子基地设备工艺研究中心有限责任公司 | Method, device and system for verifying validation of automatic system database file |
CN107357792A (en) * | 2016-05-10 | 2017-11-17 | 北京京东尚科信息技术有限公司 | A kind of method and apparatus of data parsing |
CN107357792B (en) * | 2016-05-10 | 2019-12-31 | 北京京东尚科信息技术有限公司 | Data analysis method and device |
CN107800917A (en) * | 2017-12-15 | 2018-03-13 | 定远县网萌电子商务有限公司 | Archival digitalization Machining Intelligent process flow line platform |
Also Published As
Publication number | Publication date |
---|---|
CN101000622B (en) | 2010-08-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR100424130B1 (en) | Data compression apparatus, database system, data communication system, data compression method, storage medium and program transmission apparatus | |
CN100483419C (en) | Data format verification method and device | |
CN101346689A (en) | A compressed schema representation object and method for metadata processing | |
CN105184189A (en) | Online control and management system for intelligent substation SCD file | |
KR101073847B1 (en) | Method, Apparatus and Recording Medium for Transforming Electronic Document Form | |
CN109670081B (en) | Method and device for processing service request | |
CN106713357A (en) | Universal network protocol analysis method | |
CN104182911A (en) | Calibration method for realizing CIM (Common Information Model) consistency of power distribution network system | |
US20140281912A1 (en) | Communication apparatus and method | |
CN101000622B (en) | Method and device for checking validity of expandable mark language mode | |
CN109460219A (en) | The method of rapid serial Interface Control File | |
EP2209264A1 (en) | Document management method, system and correlated device | |
WO2001040938A3 (en) | Methods for initiating activity in intelligent devices connected to an in home digital network using extensible markup language (xml) for information exchange and systems therefor | |
US7318194B2 (en) | Methods and apparatus for representing markup language data | |
CN101334872B (en) | Electronic government documents exchanging method based on web service | |
CN103885925A (en) | Method for encapsulating XBRL (extensible business reporting language) instance documents | |
CN1996878A (en) | A method for information conversion of the simple object access protocol service management interface | |
CN105245369B (en) | Component issuing container method supporting multiple transport protocols | |
CN109508211A (en) | A kind of multilingual configuration method, device, system and electronic equipment | |
CN103208087A (en) | Power distribution network data checking method based on international electrotechnical commission (IEC) 61968 standard | |
CN104021216B (en) | Message proxy server and information publish subscription method and system | |
CN101799890B (en) | Certificate data processing method and system | |
CN102799629B (en) | WSDL (Web Services Description Language) file quality ensuring system and realizing method thereof | |
CN101866331A (en) | Conversion method and device of XML (Extensible Markup Language) documents of different languages | |
CN113987815A (en) | Method and system for checking converter station model |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20100811 Termination date: 20180110 |
|
CF01 | Termination of patent right due to non-payment of annual fee |