WO2008119593A2 - Méthode de vérification efficace de contraintes utilisant un schéma de langage de balisage - Google Patents
Méthode de vérification efficace de contraintes utilisant un schéma de langage de balisage Download PDFInfo
- Publication number
- WO2008119593A2 WO2008119593A2 PCT/EP2008/051974 EP2008051974W WO2008119593A2 WO 2008119593 A2 WO2008119593 A2 WO 2008119593A2 EP 2008051974 W EP2008051974 W EP 2008051974W WO 2008119593 A2 WO2008119593 A2 WO 2008119593A2
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- markup language
- document
- data
- schema definition
- data structure
- Prior art date
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/205—Parsing
- G06F40/226—Validation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/12—Use of codes for handling textual entities
- G06F40/14—Tree-structured documents
- G06F40/143—Markup, e.g. Standard Generalized Markup Language [SGML] or Document Type Definition [DTD]
Definitions
- the invention relates to a method for checking constraints on data elements in a computer program.
- This input may be data to be stored or handled in the application or just configuration information passed to the application to enable it to function in a certain way.
- this data can be passed as input (command- line) parameters or in a plain text file containing name-value pairs.
- XML file For more complicated configuration information or more complex data a very common input method is via an XML file.
- this XML file be constructed according to an XML schema definition (XSD) .
- XSD XML schema definition
- the XSD not only specifies the structure in which the data can occur in the XML file but also implements constraints for the values of XML elements.
- An XML file usually contains a reference to the associated XSD.
- FIG Ia This figure represents a content model, that is, a description of the structure and contents, of a top-level XML element (101) .
- This content model is presented as a hierarchical structure or tree of elements.
- An XML document conforming to this XSD contains: a top-level element (101) called
- the input XML When the input XML is read in by the application it is validated once against the XSD referenced in the XML file in order to avoid processing invalid input data. Further down in the application logic there may arise the need to make checks of individual elements against the same constraints which were already specified in the XSD. This situation occurs e.g. when a graphical user interface (GUI) asks for confirmation of the input and allows to overwrite certain input parameters which were given as input in the XML file.
- GUI graphical user interface
- the application e.g. the GUI control code
- This checking logic needs to implement the same constraints in code as were already specified in the XSD. This can lead to inconsistencies and errors when the two different methods for constraint checking (XSD vs. code) diverge.
- the invention that is presented here aims to overcome the problem of divergent constraint checking methods.
- a first aspect of the invention provides a method for checking constraints on data elements in a computer program, comprising the steps of providing a markup language schema definition for a data structure for validating markup language documents against said markup language schema definition, said markup language schema definition having element information defining constraints on data elements of said data structure in at least one document and structural information on said data structure in at least one further document; receiving a value for a data element of said data structure during execution of said computer program; constructing a markup language document containing said data element and said value; and checking constraints on said data element by validating said markup language document against said element information .
- the invention may comprise the step of splitting said markup language schema definition into said at least one further document containing said structural information and said at least one document containing said element information.
- said markup language schema definition may be received as said at least one further document and said at least one document.
- a method according to the invention may comprise storing said second markup language document in an internal memory of a computer executing said computer program.
- a method according to the invention may comprise, after having access to said markup language schema definition, the step of reading said markup language schema definition from storage to take into account updates to said markup language schema definition .
- All elements contained in said at least one documents containing said element information may be top-level elements.
- Said markup language may be XML.
- a second aspect of the invention provides a computer program product comprising a computer useable medium having a computer readable program, wherein the computer readable program when executed on a computer causes the computer to: provide a markup language schema definition for a data structure for validating language documents against said markup language schema definition, said markup language schema definition having element information defining constraints on data elements of said data structure in at least one document and structural information on said data structure in at least one further document; receive a value for a data element of said data structure during execution of said computer program; construct a second markup language document containing said data element and said value; and check constraints on said data element by validating said markup language document against said element information .
- a third aspect of the invention provides a device for checking constraints on data elements in a computer program, comprising storage for storing a markup language schema definition for a data structure, said markup language schema definition having element information defining constraints on data elements of said data structure in at least one document and structural information on said data structure in at least one further document; validator for validating markup language documents against markup language schema definitions; and markup language document constructor for constructing markup language documents; wherein said markup language constructor is configured to take as input a value received during execution of said computer program and an associated data element and to construct a markup language document for said data element, and said validator is configured to validate said markup language document against said element information.
- FIG Ia shows an example of an XSD as a graphical content model .
- FIG Ib shows the first part of the same XSD as plain text.
- FIG Ic shows the second part of the same XSD as plain text.
- FIG 2a shows the structural part of the XSD depicted in FIG 1.
- FIG 2b shows the same structural part as plain text.
- FIG 3 shows, as an example, a flowchart of a process according to the invention.
- FIG 4a shows, as an example, a block diagram of the components of a system using a process according to the invention.
- FIG 4b shows, as an example, how parts of the system of FIG 4a are used for a conventional XML validation.
- FIG 5 shows a system block diagram of a typical computer system used to execute the software of the present invention.
- the invention is applicable in any computer program that takes input in both markup language format and as individual data fields.
- XML is used as an example of a markup language.
- the major benefit of the invention is the consistency of the error checking.
- the constraint definition in the XML Schema definition (XSD) is the "single source" which also determines the checking logic in an application. Additional benefits include low implementation effort, as the application needs to implement only one very generic checking routine in order to implement all checks against the constraints which are specified in the element information associated with the XSD. Whenever a constraint needs to be changed, there is no need to change code in the application. It is sufficient just to change the XSD, and this lowers maintenance cost.
- the benefits of the invention are accomplished partly by splitting up the XML schema into a structure and an elements part.
- the structure part uses standard XML schema include mechanism to include the elements part. Any complete XML input is checked against the structure XML schema as before. The checks of individual data fields in the program code may use the constraints in the elements part thus eliminating any divergence between code checks and XML schema validation.
- the XSD is split into separate documents either by the programmer or by the program itself.
- the following procedure which is elucidated by reference to the example depicted in FIG Ia and described above, may be used for the splitting.
- the programmer defines those elements for which consistent constraint checking is needed in the application.
- An element information XSD for example, ServerConfig_Elements . xsd, is created that contains the identified elements, including their constraints.
- a structural information XSD for example,
- ServerConfig Structure . xsd is created from the original XSD.
- each identified element is replaced by a reference to the element information XSD.
- the element information XSD should contain all identified elements at its top level to allow validation of values for each element individually, independently of its structural position.
- the element information may be contained in a single file or spread across a plurality of files.
- FIG Ib and FIG Ic list an original XSD, having structural and element information intermixed.
- the resulting element information XSD is depicted in FIG 2a and listed in FIG 2b.
- step 301 the process of FIG 3 is provided with an Extensible Markup Language (XML) schema.
- XML schema is meant a description of a type of XML document, typically expressed in terms of constraints on the structure and content of documents of that type, above and beyond the basic syntax constraints imposed by XML itself.
- the constraints on the structure will hereinafter be called structural information, whereas the constraints on the content will be called element information.
- the structural and element information can either be provided as separate XSD documents, in which case no further preprocessing is required, or as a single XSD document containing structural and element information intermingled with each other. In the latter case, the process performs the split procedure described above to obtain at least two separate documents containing structural and element information, respectively.
- the process may then validate a first XML document against the given XML schema, meaning it checks to see if the XML document conforms to the schema.
- This first XML document may, for example, contain original or default values for data elements of a data structure. The document is only considered valid if it satisfies the requirements of the schema. These requirements typically include such constraints as: elements and attributes that must/may be included, and their permitted structure; the structure is specified by a regular expression syntax; how character data is to be interpreted, e.g. as a number, a date, a URL, or a Boolean. Specialized parsers exist for the purpose of XML schema validation, like Java Architecture for XML Binding (JAXB) or Simple API for XML (SAX) , and may be used as generic routines for the validation.
- Java Architecture for XML Binding Java Architecture for XML Binding (JAXB) or Simple API for XML (SAX)
- step 303 the process then receives as its input content for a data element which is contained in the XML schema.
- This value might originate from a form input field or otherwise be obtained through user input. The user may be allowed, for example, to modify some or all values of the data elements of the data structure.
- step 304 the process constructs from this element an XML document specifying only the name and content of the data element, referring to the element information. More specifically, this second XML document comprises an optional XML declaration and the element consisting of a start tag, an end tag, the element's content appearing between the two tags, and a reference to the applicable element information.
- the name of the element and the applicable schema are typically known by the programmer when the process is implemented and thus inherent in the program logic that triggers the XML construction. A generated sample XML for the element "Hostname" checking the value
- the name of the data element and the applicable schema can be specified as configuration information for the application.
- step 305 the process then checks any given constraints on the data element by validating the generated XML document against the element information referenced in the generated XML document. For this purpose, it may use the same validation routine as in step 302.
- step 306 if new user input becomes available, the process may read an updated XML schema from storage and proceed from step 304 to validate the new input against the up-to-date XML schema .
- FIG 4a shows, as an example, a block diagram of the components of a system or device 410 according to the invention.
- the input markup language schema definition 401 has structural information 402 and element information 403 in separate documents.
- FIG 4 shows one structural information document and one element information document, but it is possible to have e.g. the element information stored distributed in many files.
- a validator 405, typically executed by the processor 416, is a component that takes as input an XML document and checks to see if it conforms to the schema that is referenced within the document.
- a validator 405 may validate an arbitrary first markup language document against the element information 403 or the complete schema definition 401.
- An application using the process according to FIG 3 may provide an input interface for the user. If the application, through its input interface, receives a value for a data element 406, a markup language document constructor 407 generates a markup language document 408a containing this data element and value. The validator 405 may then validate this generated markup language document 408a against the element information 403.
- the validator 405 can validate any further data elements against the element information 403 of the modified markup language schema definition 401 without necessitating any changes to the program logic.
- FIG 4b shows, as an example, how parts of the system 410 of FIG 4a are used for a conventional XML validation.
- the validator 405 validates an arbitrary XML document 408b against the complete markup language schema definition 401.
- FIG 4 shows that the generated XML document 408a is stored in the internal memory 414 of the device 410, this is not to be considered mandatory.
- the generated document 408a may be stored in any storage means.
- the storage 412 may be, for example, a hard disk or CD-ROM.
- FIG 5 shows a system block diagram of a typical computer system used to execute the software of the present invention.
- the computer system includes monitor 506 and keyboard 508.
- the computer system further includes subsystems such as central processor 503, system memory 502, I/O controller 501, display adapter 505, removable disk 507 (e.g., CD-ROM drive), fixed disk 509, network interface 510, and speaker 504.
- Other computer systems suitable for use with the present invention may include additional or fewer subsystems.
- another computer system could include more than once processor 503 (i.e., a multi-processor system) or a cache memory.
- the invention can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment containing both hardware and software elements.
- the invention is implemented in software, which includes but is not limited to firmware, resident software, microcode, etc.
- the invention can take the form of a computer program product accessible from a computer-usable or computer- readable medium providing program code for use by or in connection with a computer or any instruction execution system.
- a computer- usable or computer readable medium can be any apparatus that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
- the medium can be an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system (or apparatus or device) or a propagation medium.
- Examples of a computer-readable medium include a semiconductor or solid state memory, magnetic tape, a removable computer diskette, a random access memory (RAM) , a read-only memory (ROM) , a rigid magnetic disk and an optical disk.
- Current examples of optical disks include compact disk - read only memory (CD- ROM) , compact disk - read/write (CD-R/W) and DVD.
- a data processing system suitable for storing and/or executing program code will include at least one processor coupled directly or indirectly to memory elements through a system bus.
- the memory elements can include local memory employed during actual execution of the program code, bulk storage, and cache memories which provide temporary storage of at least some program code in order to reduce the number of times code must be retrieved from bulk storage during execution.
- I/O devices including but not limited to keyboards, displays, pointing devices, etc.
- I/O controllers can be coupled to the system either directly or through intervening I/O controllers .
- Network adapters may also be coupled to the system to enable the data processing system to become coupled to other data processing systems or remote printers or storage devices through intervening private or public networks.
- Modems, cable modem and Ethernet cards are just a few of the currently available types of network adapters. It is appreciated that although embodiments of the invention have been discussed on the assumption that XML is used as a markup language, this is not to be considered mandatory. It is possible to apply the same process to any other markup language .
- a method in a computer refers to a method whose steps are performed by a computing system containing a suitable combination of one or more processors, memory means and storage means.
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)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Document Processing Apparatus (AREA)
Abstract
La vérification de contraintes sur des éléments de données dans un programme informatique se fait de la façon suivante. Une définition de schéma de langage de balisage pour une structure de données sert à valider des documents de langage de balisage contre la définition du schéma dudit langage de balisage. La définition du schéma dudit langage de balisage comporte des éléments d'information définissant les contraintes sur les éléments de données de ladite structure de données dans au moins un document et des informations structurelles sur ladite structure de données dans au moins un autre document. La valeur d'un élément de données de ladite structure de données est reçue pendant l'exécution dudit programme informatique, et un document de langage de balisage contenant ledit élément de données, et on construit ladite valeur. Les contraintes dudit élément de données sont vérifiées en validant le document de langage de balisage contre lesdites informations d'éléments.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
EP07105387 | 2007-03-30 | ||
EP07105387.0 | 2007-03-30 |
Publications (2)
Publication Number | Publication Date |
---|---|
WO2008119593A2 true WO2008119593A2 (fr) | 2008-10-09 |
WO2008119593A3 WO2008119593A3 (fr) | 2009-02-19 |
Family
ID=39808742
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/EP2008/051974 WO2008119593A2 (fr) | 2007-03-30 | 2008-02-19 | Méthode de vérification efficace de contraintes utilisant un schéma de langage de balisage |
Country Status (1)
Country | Link |
---|---|
WO (1) | WO2008119593A2 (fr) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040002952A1 (en) * | 2002-06-26 | 2004-01-01 | Samsung Electronics Co., Ltd. | Apparatus and method for parsing XML document by using external XML validator |
WO2007013079A2 (fr) * | 2005-07-27 | 2007-02-01 | Technion Research & Development Foundation Ltd. | Validation incrementielle de contraintes de cle et de reference de cle |
US20070055927A1 (en) * | 2005-09-06 | 2007-03-08 | Cisco Technology, Inc. | Method and system for validation of structured documents |
-
2008
- 2008-02-19 WO PCT/EP2008/051974 patent/WO2008119593A2/fr active Application Filing
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040002952A1 (en) * | 2002-06-26 | 2004-01-01 | Samsung Electronics Co., Ltd. | Apparatus and method for parsing XML document by using external XML validator |
WO2007013079A2 (fr) * | 2005-07-27 | 2007-02-01 | Technion Research & Development Foundation Ltd. | Validation incrementielle de contraintes de cle et de reference de cle |
US20070055927A1 (en) * | 2005-09-06 | 2007-03-08 | Cisco Technology, Inc. | Method and system for validation of structured documents |
Non-Patent Citations (1)
Title |
---|
ANONYMOUS: "XML Schema Part 0: Primer Second Edition" W3C, [Online] 28 October 2004 (2004-10-28), XP002505359 Retrieved from the Internet: URL:http://www.w3.org/TR/xmlschema-0/#SchemaInMultDocs> [retrieved on 2008-11-25] * |
Also Published As
Publication number | Publication date |
---|---|
WO2008119593A3 (fr) | 2009-02-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7650590B2 (en) | Flexible code generation | |
US8191038B1 (en) | Using a templating language to produce a host language factory for a safe subset of a templated language | |
US8719770B2 (en) | Verifying programming artifacts generated from ontology artifacts or models | |
US10114861B2 (en) | Expandable ad hoc domain specific query for system management | |
US10083016B1 (en) | Procedurally specifying calculated database fields, and populating them | |
US20090254881A1 (en) | Code generation techniques for administrative tasks | |
WO2013028438A1 (fr) | Système et procédé d'assemblage dynamique d'une application dans un dispositif client | |
JP2006092529A (ja) | Xml入力文書を検証するxmlスキーマを自動的に生成するシステムおよび方法 | |
US20070050707A1 (en) | Enablement of multiple schema management and versioning for application-specific xml parsers | |
US7774300B2 (en) | System and method for data model and content migration in content management applications | |
US9021348B1 (en) | Composition of templates using transclusion that guarantee a valid HTML document | |
US20170300305A1 (en) | Executable guidance experiences based on implicitly generated guidance models | |
Busch et al. | Towards model-driven development of access control policies for web applications | |
US8135757B2 (en) | Generating references to reusable code in a schema | |
US20070050705A1 (en) | Method of xml element level comparison and assertion utilizing an application-specific parser | |
US8205010B1 (en) | User system applicaton interaction for a system as a service | |
US9830204B2 (en) | Facilitating communication between software components that use middleware | |
US10606569B2 (en) | Declarative configuration elements | |
US20070050706A1 (en) | Method of xml transformation and presentation utilizing an application-specific parser | |
US20070234200A1 (en) | Model view controller modeling language | |
Leung | Professional XML Development with Apache Tools: Xerces, Xalan, FOP, Cocoon, Axis, Xindice | |
WO2008119593A2 (fr) | Méthode de vérification efficace de contraintes utilisant un schéma de langage de balisage | |
Guerra et al. | Idioms for code annotations in the java language | |
Święcicki et al. | How is server software configured? examining the structure of configuration files | |
Margheri et al. | Developing and Enforcing Policies for Access Control, Resource Usage, and Adaptation: –A Practical Approach– |
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: 08709092 Country of ref document: EP Kind code of ref document: A2 |
|
DPE1 | Request for preliminary examination filed after expiration of 19th month from priority date (pct application filed from 20040101) | ||
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 08709092 Country of ref document: EP Kind code of ref document: A2 |