Validating xml with perl
That is, the of the markup content is handled implicitly by virtue of using an application that is specifically designed to render that markup in a predictable way.
Choosing XML to markup web content knocks that implicit validation into a cocked hat.
January 23, 2002 Kip Hampton A fair part of the Web's initial popularity was based in the relative simplicity of HTML authoring.
Love it or hate it, HTML offered a standard, ubiquitous markup language that one could expect would be viewable as more or less intended by anyone requesting the document.
How then do you ensure that the XML content being authored is correct?
Those rules, and the context in which they are evaluated, can be as coarse or as finely-grained as the task at hand requires.
Any valid XPath expression that can be evaluated as true or false can be used to test a document's structure. /usr/bin/perl -w use strict; use XML:: Schematron:: Lib XSLT; my $schema_file = $ARGV; my $xml_file = $ARGV; die "Usage: perl schemafile XMLfile.\n" unless defined $schema_file and defined $xml_file; my $tron = XML:: Schematron:: Lib XSLT-.
The reason is that the Schematron module actually ships with several backends that can be chosen based on the type of processor that you want to use.
This ubiquity made web-based applications possible. By having a common, albeit limited language from which to build user interfaces, client-server applications could often abandon the use of platform- and application-specific client-side executables in favor of accessing data and logic on the server through the CGI or Web server extension.
The importance of HTML's ubiquity in web applications is especially noticeable in the class of applications I'll call "in-browser content editors".