Happy Codings - Programming Code Examples
Html Css Web Design Sample Codes CPlusPlus Programming Sample Codes JavaScript Programming Sample Codes C Programming Sample Codes CSharp Programming Sample Codes Java Programming Sample Codes Php Programming Sample Codes Visual Basic Programming Sample Codes


Java Programming Code Examples

Java > XML Code Examples

Validate schema

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
Validate schema package com.ack.xml.jdom; import org.jdom.Document; import org.jdom.JDOMException; import org.jdom.input.SAXBuilder; public class ValidateSchema { public static void main( String[] args ) { SAXBuilder builder = new SAXBuilder( "org.apache.xerces.parsers.SAXParser" ); //DOMBuilder builder = new DOMBuilder( "org.apache.xerces.parsers.DOMParser" ); builder.setValidation( true ); builder.setFeature( "http://apache.org/xml/features/validation/schema", true ); // command line should offer URIs or file names try { Document doc = builder.build( "E:\\projects\\smsgateway\\vertis_sms\\config\\vertismsg.xml" ); } catch( JDOMException e ) { System.out.println( e.getMessage() ); } } }