Class typechk

java.lang.Object
   |
   +----typechk

public final class typechk
extends Object
This program acts as a type checker for XML documents that have been marked-up with the SQL typing attributes proposed by Tim Bray. See http://www.textuality.com/xml/typing.html. It accepts an XML document or stdin or on the command line and checks its content. It prints error messages when it finds elements the content of which does not match the rules of the above proposal. No output is produced for correct documents.

An element that has an attribute called "xml-sqltype" is a strongly typed element. It must match these rules:

  1. It can have no child elements other than comments and data.

  2. The value of xml-sqltype is one of: char, varchar, integer, decimal, float, date, time, timestamp (all of them case-insensitive).

  3. The element may have attributes xml-sqlsize, xml-sqlmin and xml-sqlmax.

  4. The concatenation of the element's data conforms to the rules for the particular xml-sqltype, possibly modified by the xml-sqlsize, xml-sqlmin and xml-sqlmax attributes (see the code below and the proposal mentioned above).

[Note: implementing all checks is rather boring; I haven't implemented the checks for TIME and TIMESTAMP, but they are not hard and will come later.]

Version:
$Id: typechk.html,v 1.2 1997/06/09 22:24:04 bbos Exp $
Author:
Bert Bos
See Also:
XMLTokenizer, Node, TreeListener, Parser, ParserDef

Constructor Index

 o typechk()

Method Index

 o main(String[])

Constructors

 o typechk
 public typechk()

Methods

 o main
 public static void main(String argv[]) throws IOException, UnknownEncoding