Presentation is loading. Please wait.

Presentation is loading. Please wait.

Schema validation with java xml xsd 8.10.08. 08.10.082 Agenda Umgebung Programm Output.

Similar presentations


Presentation on theme: "Schema validation with java xml xsd 8.10.08. 08.10.082 Agenda Umgebung Programm Output."— Presentation transcript:

1 Schema validation with java xml xsd

2 Agenda Umgebung Programm Output

3 Umgebung Eclipse Java 1.5 Erweiterung java archives: jdom.jar und xerces.jar

4 Program public class Xmlschema { public static void main( String[] args ) {try { File xsdFile = new File(“c:\countries.xsd"); File xmlFile = new File(“c:\countries.xml"); SAXBuilder builder = new SAXBuilder("org.apache.xerces.parsers.SAXParser", true); builder.setFeature("http://apache.org/xml/features/validation/schema", true); builder.setProperty(http://apache.org/xml/properties/schema +http://apache.org/xml/properties/schema "/external-noNamespaceSchemaLocation", xsdFile.toURL().toString() ); org.jdom.Document doc = builder.build( xmlFile ); System.out.println( "Successfully parsed and validated" ); catch ( Exception cause ) {System.err.println( cause.toString() );}}}

6 “Output”

7 schema location File: defineexample1.xml xsi:schemaLocation="http://www.cdisc.org/ns/odm/v1.2 define1-0-0.xsd"

8 schemata define1-0-0.xsd define-extension.xsd

9 Fragen Gibt es andere Lösungen (sas) ?


Download ppt "Schema validation with java xml xsd 8.10.08. 08.10.082 Agenda Umgebung Programm Output."

Similar presentations


Ads by Google