jp.ne.dti.lares.foozy.sasax
Class ValidationDemo
java.lang.Object
|
+--jp.ne.dti.lares.foozy.sasax.ValidationDemo
- All Implemented Interfaces:
- DemoConstants, Validation
- public class ValidationDemo
- extends java.lang.Object
- implements Validation, DemoConstants
Demonstration how to validate value in XML document by SASAX.
This class can parse XML document,
which matches against below schema.
<xs:schema
targetNamespace="http://www.lares.dti.ne.jp/~foozy/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:local="http://www.lares.dti.ne.jp/~foozy/">
<xs:simpleType name="int">
<xs:restriction base="xs:integer"/>
</xs:simpleType>
<xs:element name="int" type="local:int"/>
</xs:schema>
This class reads XML document in from standard input
at invocation of main(String[])
.
- Author:
- FUJIWARA Katsunori <foozy@lares.dti.ne.jp>(code/doc)
Method Summary |
static void |
main(java.lang.String[] args)
Invoke demonstration. |
java.lang.Object |
validate(ParseContext context,
java.lang.Object value)
Examine whether specified value is even integer or not. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ValidationDemo
public ValidationDemo()
validate
public java.lang.Object validate(ParseContext context,
java.lang.Object value)
throws org.xml.sax.SAXException
- Examine whether specified value is even integer or not.
- Specified by:
validate
in interface Validation
main
public static void main(java.lang.String[] args)
throws java.lang.Exception
- Invoke demonstration.