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 8.10.08

2 08.10.082 Agenda Umgebung Programm Output

3 08.10.083 Umgebung Eclipse 3.3.1.1 Java 1.5 Erweiterung http://jdom.org/dist/binaryhttp://jdom.org/dist/binary java archives: jdom.jar und xerces.jar

4 08.10.084 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() );}}}

5 08.10.085 “Output”

6 08.10.086 “Output”

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

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

9 08.10.089 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