XML Schema Validation Using Java API for XML Processing

SheneJalil Jamal, Chnoor M. Rahman, Mzhda S. Abdulkarim
{"title":"XML Schema Validation Using Java API for XML Processing","authors":"SheneJalil Jamal, Chnoor M. Rahman, Mzhda S. Abdulkarim","doi":"10.25079/ukhjse.v6n1y2022.pp33-41","DOIUrl":null,"url":null,"abstract":"Extensible Markup Language (XML) is a markup language that is developed to organize the structure of information in a text file. The data in XML formatted documents are represented by specifying a number of tags and determining the structural relationship between those tags. It has a simple structure and can be handled by any text editor. Therefore, XML formatted data is being commonly used to transfer and share data between different applications and organizations without having to convert the format of the data (Yang, 2019).\n\n In the XML world, “well-formed” and “valid” are the two most frequently used terms. A well-formed XML document is free from errors that can cause the document to not parse, such as: spelling, punctuation, grammar, and syntax errors. While in addition to having a well-formed markup, a valid XML must conform to a document type definition, this means the document must be semantically correct and matches a described standard of schemas and relationships (Appel, 2020).There are two standards of document type definition that can be used to validate an XML document, one is DTD or Document Type Definition which is used to identify the legal structure and names the legal elements of an XML document (Dykes and Tittel, 2011), and the other is XSD or XML Schema Definition. XSD is a diagrammatic representation that defines the valid structure of an XML document, it enables specifying the building blocks of an XML data set such as elements and attributes and their data types, number of child elements, fixed and default values of the elements and attributes that can appear in the documents (XML Schema Tutorial, 2020). In some applications the process of validating XML documents is combined with parsing the document. However, in some other cases the process of parsing and validating the XML documents need to be separated. This study focuses on constructing a separate XML document validator and validating XML documents against the defined XSD rules. A Java program is used to perform this experiment. Furthermore, the critical differences between XSD and DTD are also mentioned.","PeriodicalId":169900,"journal":{"name":"ISSUE TEN","volume":"6 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2022-06-30","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"ISSUE TEN","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.25079/ukhjse.v6n1y2022.pp33-41","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

Extensible Markup Language (XML) is a markup language that is developed to organize the structure of information in a text file. The data in XML formatted documents are represented by specifying a number of tags and determining the structural relationship between those tags. It has a simple structure and can be handled by any text editor. Therefore, XML formatted data is being commonly used to transfer and share data between different applications and organizations without having to convert the format of the data (Yang, 2019). In the XML world, “well-formed” and “valid” are the two most frequently used terms. A well-formed XML document is free from errors that can cause the document to not parse, such as: spelling, punctuation, grammar, and syntax errors. While in addition to having a well-formed markup, a valid XML must conform to a document type definition, this means the document must be semantically correct and matches a described standard of schemas and relationships (Appel, 2020).There are two standards of document type definition that can be used to validate an XML document, one is DTD or Document Type Definition which is used to identify the legal structure and names the legal elements of an XML document (Dykes and Tittel, 2011), and the other is XSD or XML Schema Definition. XSD is a diagrammatic representation that defines the valid structure of an XML document, it enables specifying the building blocks of an XML data set such as elements and attributes and their data types, number of child elements, fixed and default values of the elements and attributes that can appear in the documents (XML Schema Tutorial, 2020). In some applications the process of validating XML documents is combined with parsing the document. However, in some other cases the process of parsing and validating the XML documents need to be separated. This study focuses on constructing a separate XML document validator and validating XML documents against the defined XSD rules. A Java program is used to perform this experiment. Furthermore, the critical differences between XSD and DTD are also mentioned.
使用Java API进行XML处理的XML模式验证
可扩展标记语言(XML)是一种用于组织文本文件中信息结构的标记语言。XML格式文档中的数据通过指定一些标记和确定这些标记之间的结构关系来表示。它有一个简单的结构,可以由任何文本编辑器处理。因此,XML格式的数据通常用于在不同应用程序和组织之间传输和共享数据,而无需转换数据格式(Yang, 2019)。在XML世界中,“格式良好”和“有效”是两个最常用的术语。格式良好的XML文档没有可能导致文档无法解析的错误,例如:拼写、标点、语法和语法错误。除了具有格式良好的标记之外,有效的XML还必须符合文档类型定义,这意味着文档必须在语义上是正确的,并且匹配所描述的模式和关系标准(Appel, 2020)。文档类型定义有两种标准可用于验证XML文档,一种是DTD或文档类型定义,用于标识XML文档的合法结构和命名合法元素(Dykes和Tittel, 2011),另一种是XSD或XML模式定义。XSD是一种图表表示,它定义了XML文档的有效结构,它允许指定XML数据集的构建块,例如元素和属性及其数据类型、子元素的数量、可以出现在文档中的元素和属性的固定值和默认值(XML Schema Tutorial, 2020)。在一些应用程序中,验证XML文档的过程与解析文档相结合。但是,在其他一些情况下,解析和验证XML文档的过程需要分开。本研究的重点是构造一个单独的XML文档验证器,并根据定义的XSD规则验证XML文档。本实验采用Java程序进行。此外,还提到了XSD和DTD之间的关键区别。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信