Jump to content

XML validation: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
No edit summary
Rescuing 1 sources and tagging 0 as dead.) #IABot (v2.0.9.5) (Eastmain - 19063
 
(36 intermediate revisions by 27 users not shown)
Line 1: Line 1:
{{Refimprove|date=May 2010}}
{{Refimprove|date=May 2010}}
'''XML validation''' is the process of checking a document written in [[XML]] (eXtensible Markup Language) to confirm that it is both [[Well-formed_document|Well Formed]] and also "valid" in that it follows a defined structure. A [[Well-formed_document|Well Formed Document]] follows the basic syntactic rules of XML, which are the same for all XML documents.<ref >{{cite web
'''XML validation''' is the process of checking a document written in [[XML]] (eXtensible Markup Language) to confirm that it is both [[well-formed document|well-formed]] and also "valid" in that it follows a defined structure. A well-formed document follows the basic syntactic rules of XML, which are the same for all XML documents.<ref >{{cite web
|work=Extensible Markup Language (XML) 1.1
|work=Extensible Markup Language (XML) 1.1
|title=Well-Formed XML Documents
|title=Well-Formed XML Documents
Line 6: Line 6:
|date=2004
|date=2004
|publisher=[[W3C]]
|publisher=[[W3C]]
}}</ref> A valid document also respects the rules dictated by a particular [[Document Type Definition|DTD]] or [[XML Schema (W3C)|XML schema]], according to the application-specific choices for those particular .<ref >{{cite web
}}</ref> A valid document also respects the rules dictated by a particular [[Document Type Definition|DTD]] or [[XML Schema (W3C)|XML schema]].<ref >{{cite web
|title=Constraints and Validation Rules
|title=Constraints and Validation Rules
|work=XML Schema Part 1: Structures Second Edition
|work=XML Schema Part 1: Structures Second Edition
Line 12: Line 12:
|publisher=[[W3C]]
|publisher=[[W3C]]
|url=http://www.w3.org/TR/xmlschema-1/#concepts-schemaConstraints
|url=http://www.w3.org/TR/xmlschema-1/#concepts-schemaConstraints
}}</ref> Automated tools – [[validator]]s – can perform well-formedness tests and many other validation tests, but not those that require human judgement, such as correct application of a schema to a data set.
}}</ref>


== Standards ==
In addition, extended tools are available such as OASIS CAM standard specification that provide contextual validation of content and structure that is more flexible than basic schema validations.


* OASIS CAM is a standard specification that provides contextual validation of content and structure that is more flexible than basic schema validations.
''[[libxml2|xmllint]]'' is a command line XML tool that can perform XML validation. It can be found in [[UNIX]] / [[Linux]] environments. An example with the use of this program for validation of a file called ''example.xml'' is
* [[Schematron]], a method for advanced XML validation.
: xmllint --valid --noout example.xml


== References ==
== Tools ==
{{Reflist}}


* ''[[libxml2|xmllint]]'' is a command line XML tool that can perform XML validation. It can be found in [[UNIX]] / [[Linux]] environments.
==External links==
* XML toolkit. [http://xmlsoft.org/xmldtd.html The XML C parser and toolkit of Gnome] &ndash; libxml includes xmllint
; Example C program
* [https://codebeautify.org/xmlvalidator XML Validator Online] Validate your XML data.
* [http://knol2share.blogspot.com/2009/05/validate-xml-against-xsd-in-c.html Validate XML against XSD in C] (using libxml)
* [https://www.corefiling.com/opensource/schemaValidate XML Schema Validator] Validate XML files against an XML Schema.

; XML toolkit
*[http://xmlsoft.org/xmldtd.html The XML C parser and toolkit of Gnome] &ndash; libxml includes xmllint
*[http://www.zlatkovic.com/libxml.en.html Windows port of libxml] &ndash; maintained by Igor Zlatkovic

; Online validators for XML files
*http://www.xmlvalidation.com/
*http://www.stg.brown.edu/service/xmlvalid/
*http://www.jcam.org.uk
*[http://www.XMLdation.com/ XMLdation.com is focused on payment-related ISO 20022 XML files]


==References==
{{Reflist}}
:*
; Articles discussing XML validation
; Articles discussing XML validation
*[http://www.devx.com/xml/Article/41066 DEVX March, 2009 - Taking XML Validation to the Next Level: Introducing CAM]
:*[http://www.devx.com/xml/Article/41066 DEVX March, 2009 - Taking XML Validation to the Next Level: Introducing CAM] {{Webarchive|url=https://web.archive.org/web/20120316091304/http://www.devx.com/xml/Article/41066 |date=2012-03-16 }}




Line 44: Line 37:


{{markup-languages-stub}}
{{markup-languages-stub}}

[[ca:Validació XML]]
[[es:Validación XML]]
[[zh:XML validation]]

Latest revision as of 09:16, 25 April 2024

XML validation is the process of checking a document written in XML (eXtensible Markup Language) to confirm that it is both well-formed and also "valid" in that it follows a defined structure. A well-formed document follows the basic syntactic rules of XML, which are the same for all XML documents.[1] A valid document also respects the rules dictated by a particular DTD or XML schema.[2] Automated tools – validators – can perform well-formedness tests and many other validation tests, but not those that require human judgement, such as correct application of a schema to a data set.

Standards

[edit]
  • OASIS CAM is a standard specification that provides contextual validation of content and structure that is more flexible than basic schema validations.
  • Schematron, a method for advanced XML validation.

Tools

[edit]

References

[edit]
  1. ^ "Well-Formed XML Documents". Extensible Markup Language (XML) 1.1. W3C. 2004.
  2. ^ "Constraints and Validation Rules". XML Schema Part 1: Structures Second Edition. W3C. 2004.
Articles discussing XML validation